26 gsl::span<const unsigned char>::iterator& pattIt,
33 bool applyMisalignment =
false;
35 for (
int il = 0; il < geom->getNumberOfLayers(); ++il) {
36 if (conf.sysErrY2[il] > 0.f || conf.sysErrZ2[il] > 0.f) {
37 applyMisalignment =
true;
43 float sigmaY2 = NAN, sigmaZ2 = NAN;
45 const auto detID =
c.getSensorID();
49 auto& cl3d =
output.emplace_back(detID, geom->getMatrixT2L(detID) ^ locXYZ);
50 if (applyMisalignment) {
51 const auto lrID = geom->getLayer(detID);
52 sigmaY2 += conf.sysErrY2[lrID];
53 sigmaZ2 += conf.sysErrZ2[lrID];
55 cl3d.setErrors(sigmaY2, sigmaZ2, 0.f);
60 gsl::span<const o2::itsmft::ROFRecord> rofs,
61 gsl::span<const itsmft::CompClusterExt>
clusters,
62 gsl::span<const unsigned char>::iterator& pattIt,
75 const auto& timing =
tf->getROFOverlapTableView().getLayer(
layer >= 0 ?
layer : 0);
76 if (timing.mNROFsTF != rofs.size()) {
77 LOGP(fatal,
"Received inconsistent number of rofs on layer:{} expected:{} received:{}",
layer, timing.mNROFsTF, rofs.size());
82 for (
size_t iRof{0}; iRof < rofs.size(); ++iRof) {
83 const auto& rof = rofs[iRof];
84 for (
int clusterId{rof.getFirstEntry()}; clusterId < rof.getFirstEntry() + rof.getNEntries(); ++clusterId) {
86 const auto sensorID =
c.getSensorID();
87 const auto lay = geom->getLayer(sensorID);
89 float sigmaY2{0}, sigmaZ2{0}, sigmaYZ{0};
95 const auto gloXYZ = geom->getMatrixL2G(sensorID) * locXYZ;
104 float alpha = geom->getSensorRefAlpha(sensorID);
105 float x = trkXYZ.x(),
y = trkXYZ.y();
108 x = std::hypot(gloXYZ.x(), gloXYZ.y());
109 alpha = std::atan2(gloXYZ.y(), gloXYZ.x());
111 math_utils::detail::bringToPMPi(
alpha);
113 tf->addTrackingFrameInfoToLayer(lay, gloXYZ.x(), gloXYZ.y(), gloXYZ.z(),
x,
alpha,
114 std::array<float, 2>{y, trkXYZ.z()},
115 std::array<float, 3>{sigmaY2, sigmaYZ, sigmaZ2});
118 tf->addClusterToLayer(lay, gloXYZ.x(), gloXYZ.y(), gloXYZ.z(),
tf->getUnsortedClusters()[lay].size());
119 tf->addClusterExternalIndexToLayer(lay, clusterId);
123 tf->mROFramesClusters[
layer][iRof + 1] =
tf->mUnsortedClusters[
layer].size();
125 for (
unsigned int iL{0}; iL <
tf->mUnsortedClusters.size(); ++iL) {
126 tf->mROFramesClusters[iL][iRof + 1] =
tf->mUnsortedClusters[iL].size();
131 tf->setClusterSize(
layer >= 0 ?
layer : 0, clusterSizeVec);
134 for (
auto i = 0;
i <
tf->mNTrackletsPerCluster.size(); ++
i) {
135 tf->mNTrackletsPerCluster[
i].resize(
tf->mUnsortedClusters[1].size());
136 tf->mNTrackletsPerClusterSum[
i].resize(
tf->mUnsortedClusters[1].size() + 1);
140 if (mcLabels !=
nullptr) {
int loadROFrameDataITS3(its::TimeFrame< 7 > *tf, gsl::span< const o2::itsmft::ROFRecord > rofs, gsl::span< const itsmft::CompClusterExt > clusters, gsl::span< const unsigned char >::iterator &pattIt, const o2::its3::TopologyDictionary *dict, int layer, const dataformats::MCTruthContainer< MCCompLabel > *mcLabels=nullptr)
void convertCompactClusters(gsl::span< const itsmft::CompClusterExt > clusters, gsl::span< const unsigned char >::iterator &pattIt, std::vector< o2::BaseCluster< float > > &output, const o2::its3::TopologyDictionary *dict)
convert compact clusters to 3D spacepoints