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,
74 for (
size_t iRof{0}; iRof < rofs.size(); ++iRof) {
75 const auto& rof = rofs[iRof];
76 for (
int clusterId{rof.getFirstEntry()}; clusterId < rof.getFirstEntry() + rof.getNEntries(); ++clusterId) {
78 const auto sensorID =
c.getSensorID();
79 const auto layer = geom->getLayer(sensorID);
81 float sigmaY2{0}, sigmaZ2{0}, sigmaYZ{0};
87 const auto gloXYZ = geom->getMatrixL2G(sensorID) * locXYZ;
96 float alpha = geom->getSensorRefAlpha(sensorID);
97 float x = trkXYZ.x(),
y = trkXYZ.y();
100 x = std::hypot(gloXYZ.x(), gloXYZ.y());
101 alpha = std::atan2(gloXYZ.y(), gloXYZ.x());
103 math_utils::detail::bringToPMPi(
alpha);
105 tf->addTrackingFrameInfoToLayer(
layer, gloXYZ.x(), gloXYZ.y(), gloXYZ.z(),
x,
alpha,
106 std::array<float, 2>{y, trkXYZ.z()},
107 std::array<float, 3>{sigmaY2, sigmaYZ, sigmaZ2});
110 tf->addClusterToLayer(
layer, gloXYZ.x(), gloXYZ.y(), gloXYZ.z(),
tf->getUnsortedClusters()[
layer].size());
111 tf->addClusterExternalIndexToLayer(
layer, clusterId);
113 for (
unsigned int iL{0}; iL <
tf->getUnsortedClusters().
size(); ++iL) {
114 tf->mROFramesClusters[iL][iRof + 1] = (
int)
tf->getUnsortedClusters()[iL].size();
120 for (
auto&
v :
tf->mNTrackletsPerCluster) {
121 v.resize(
tf->getUnsortedClusters()[1].size());
123 for (
auto&
v :
tf->mNTrackletsPerClusterSum) {
124 v.resize(
tf->getUnsortedClusters()[1].size() + 1);
127 if (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
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, const dataformats::MCTruthContainer< MCCompLabel > *mcLabels=nullptr)