Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 35 additions & 39 deletions Detectors/ITSMFT/ITS/tracking/src/TimeFrame.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -128,50 +128,46 @@ int TimeFrame::loadROFrameData(gsl::span<o2::itsmft::ROFRecord> rofs,
geom->fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2L, o2::math_utils::TransformType::L2G));

mNrof = 0;
for (int clusterId{0}; clusterId < clusters.size() && mNrof < rofs.size(); ++clusterId) {
auto& c = clusters[clusterId];

int layer = geom->getLayer(c.getSensorID());

auto pattID = c.getPatternID();
o2::math_utils::Point3D<float> locXYZ;
float sigmaY2 = DefClusError2Row, sigmaZ2 = DefClusError2Col, sigmaYZ = 0; // Dummy COG errors (about half pixel size)
if (pattID != itsmft::CompCluster::InvalidPatternID) {
sigmaY2 = dict->getErr2X(pattID);
sigmaZ2 = dict->getErr2Z(pattID);
if (!dict->isGroup(pattID)) {
locXYZ = dict->getClusterCoordinates(c);
for (auto& rof : rofs) {
for (int clusterId{rof.getFirstEntry()}; clusterId < rof.getFirstEntry() + rof.getNEntries(); ++clusterId) {
auto& c = clusters[clusterId];

int layer = geom->getLayer(c.getSensorID());

auto pattID = c.getPatternID();
o2::math_utils::Point3D<float> locXYZ;
float sigmaY2 = DefClusError2Row, sigmaZ2 = DefClusError2Col, sigmaYZ = 0; // Dummy COG errors (about half pixel size)
if (pattID != itsmft::CompCluster::InvalidPatternID) {
sigmaY2 = dict->getErr2X(pattID);
sigmaZ2 = dict->getErr2Z(pattID);
if (!dict->isGroup(pattID)) {
locXYZ = dict->getClusterCoordinates(c);
} else {
o2::itsmft::ClusterPattern patt(pattIt);
locXYZ = dict->getClusterCoordinates(c, patt);
}
} else {
o2::itsmft::ClusterPattern patt(pattIt);
locXYZ = dict->getClusterCoordinates(c, patt);
locXYZ = dict->getClusterCoordinates(c, patt, false);
}
} else {
o2::itsmft::ClusterPattern patt(pattIt);
locXYZ = dict->getClusterCoordinates(c, patt, false);
auto sensorID = c.getSensorID();
// Inverse transformation to the local --> tracking
auto trkXYZ = geom->getMatrixT2L(sensorID) ^ locXYZ;
// Transformation to the local --> global
auto gloXYZ = geom->getMatrixL2G(sensorID) * locXYZ;

addTrackingFrameInfoToLayer(layer, gloXYZ.x(), gloXYZ.y(), gloXYZ.z(), trkXYZ.x(), geom->getSensorRefAlpha(sensorID),
std::array<float, 2>{trkXYZ.y(), trkXYZ.z()},
std::array<float, 3>{sigmaY2, sigmaYZ, sigmaZ2});

/// Rotate to the global frame
addClusterToLayer(layer, gloXYZ.x(), gloXYZ.y(), gloXYZ.z(), mUnsortedClusters[layer].size());
addClusterExternalIndexToLayer(layer, clusterId);
}
auto sensorID = c.getSensorID();
// Inverse transformation to the local --> tracking
auto trkXYZ = geom->getMatrixT2L(sensorID) ^ locXYZ;
// Transformation to the local --> global
auto gloXYZ = geom->getMatrixL2G(sensorID) * locXYZ;

addTrackingFrameInfoToLayer(layer, gloXYZ.x(), gloXYZ.y(), gloXYZ.z(), trkXYZ.x(), geom->getSensorRefAlpha(sensorID),
std::array<float, 2>{trkXYZ.y(), trkXYZ.z()},
std::array<float, 3>{sigmaY2, sigmaYZ, sigmaZ2});

/// Rotate to the global frame
addClusterToLayer(layer, gloXYZ.x(), gloXYZ.y(), gloXYZ.z(), mUnsortedClusters[layer].size());
addClusterExternalIndexToLayer(layer, clusterId);

while (mNrof < rofs.size() && clusterId >= rofs[mNrof].getFirstEntry() + rofs[mNrof].getNEntries() - 1) {
for (unsigned int iL{0}; iL < mUnsortedClusters.size(); ++iL) {
mROframesClusters[iL].push_back(mUnsortedClusters[iL].size());
if (iL < 2) {
mTrackletsIndexROf[iL].push_back(mUnsortedClusters[1].size()); // Tracklets used in vertexer are always computed wrt clusters on the second layer
}
}
mNrof++;
for (unsigned int iL{0}; iL < mUnsortedClusters.size(); ++iL) {
mROframesClusters[iL].push_back(mUnsortedClusters[iL].size());
}
mNrof++;
}
if (mcLabels) {
mClusterLabels = mcLabels;
Expand Down