Skip to content

Commit 1dc8fd9

Browse files
authored
CheckResid stores cl.size and track snp for points (#16000)
1 parent feecef2 commit 1dc8fd9

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

‎Detectors/GlobalTrackingWorkflow/study/include/GlobalTrackingStudy/CheckResidTypes.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ struct Point {
2323
float sig2z = 0.f;
2424
float phi = 0.f;
2525
float z = 0.f;
26+
float snp = 0.f;
27+
int16_t clSize = 0;
2628
int16_t sens = -1;
2729
int8_t lr = -1; // -1 = vtx
28-
ClassDefNV(Point, 1)
30+
ClassDefNV(Point, 2)
2931
};
3032

3133
struct Track {

‎Detectors/GlobalTrackingWorkflow/study/src/CheckResidSpec.cxx‎

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ class CheckResidSpec final : public Task
114114
float mITSROFrameLengthMUS = 0.f;
115115
o2::dataformats::MeanVertexObject mMeanVtx{};
116116
ITSClusters mITSClustersArray; ///< ITS clusters from compact clusters, by composed ID
117+
std::vector<int16_t> mITSClusterSizes; ///< number of pixels per converted cluster
117118
const o2::itsmft::TopologyDictionary* mITSDict = nullptr; ///< cluster patterns dictionary
118119
o2::vertexing::PVertexer mVertexer;
119120
std::shared_ptr<DataRequest> mDataRequest;
@@ -255,11 +256,25 @@ void CheckResidSpec::process()
255256
const auto& params = o2::checkresid::CheckResidConfig::Instance();
256257
int nLr = mDataRequest->getITSPerLayer() ? o2::globaltracking::MaxITSLayers : 1;
257258
mITSClustersArray.init(nLr);
259+
mITSClusterSizes.clear();
258260
for (int lr = 0; lr < nLr; lr++) { // with a single (monolithic) input all clusters are in the layer slot 0
259261
mITSClustersArray.beginLayer(lr);
260262
const auto clusITS = mRecoData->getITSClusters(lr);
261263
auto pattIt = mRecoData->getITSClustersPatterns(lr).begin();
262-
mITSClustersArray.getClusters().reserve(mITSClustersArray.size() + clusITS.size());
264+
{
265+
auto sizePattIt = mRecoData->getITSClustersPatterns(lr).begin();
266+
mITSClustersArray.getClusters().reserve(mITSClustersArray.size() + clusITS.size());
267+
mITSClusterSizes.reserve(mITSClusterSizes.size() + clusITS.size());
268+
for (const auto& clu : clusITS) {
269+
const auto pattID = clu.getPatternID();
270+
if (pattID == o2::itsmft::CompCluster::InvalidPatternID || mITSDict->isGroup(pattID)) {
271+
o2::itsmft::ClusterPattern patt(sizePattIt);
272+
mITSClusterSizes.emplace_back(patt.getNPixels());
273+
} else {
274+
mITSClusterSizes.emplace_back(mITSDict->getNpixels(pattID));
275+
}
276+
}
277+
}
263278
o2::its::ioutils::convertCompactClusters(clusITS, pattIt, mITSClustersArray.getClusters(), mITSDict);
264279
}
265280
mITSClustersArray.finalize();
@@ -405,6 +420,7 @@ bool CheckResidSpec::processITSTrack(const o2::its::TrackITS& iTrack, const o2::
405420
float pvAlpha = 0;
406421
float bz = prop->getNominalBz();
407422
std::array<const o2::BaseCluster<float>*, 8> clArr{};
423+
std::array<int16_t, 8> clSizeArr{};
408424
const auto& params = CheckResidConfig::Instance();
409425
std::array<o2::track::TrackParCov, 8> extrapOut, extrapInw; // 2-way Kalman extrapolations, vertex + 7 layers
410426

@@ -465,6 +481,7 @@ bool CheckResidSpec::processITSTrack(const o2::its::TrackITS& iTrack, const o2::
465481
LOGP(error, "Cluster at lr {} was already assigned, old sens {}, new sens {}", llr, clArr[1 + llr]->getSensorID(), curClu.getSensorID());
466482
}
467483
clArr[1 + geom->getLayer(curClu.getSensorID())] = &curClu;
484+
clSizeArr[1 + geom->getLayer(curClu.getSensorID())] = mITSClusterSizes[itsClRefs[iTrack.getClusterEntry(i)]];
468485
}
469486
o2::track::TrackPar refLinInw0, refLinOut0, *refLinOut = nullptr, *refLinInw = nullptr;
470487
o2::track::TrackPar refLinIBOut0, refLinOBInw0, *refLinOBInw = nullptr, *refLinIBOut = nullptr;
@@ -526,7 +543,7 @@ bool CheckResidSpec::processITSTrack(const o2::its::TrackITS& iTrack, const o2::
526543
// posCl.push_back(clArr[i]->getXYZGlo(*o2::its::GeometryTGeo::Instance()));
527544
auto phi = i == 0 ? tInw.getPhi() : tInw.getPhiPos();
528545
o2::math_utils::bringTo02Pi(phi);
529-
resTrack.points.emplace_back(clArr[i]->getY() - yw, clArr[i]->getZ() - zw, cTot[0] + clArr[i]->getSigmaY2(), cTot[1] + clArr[i]->getSigmaZ2(), phi, clArr[i]->getZ(), clArr[i]->getSensorID(), i - 1);
546+
resTrack.points.emplace_back(clArr[i]->getY() - yw, clArr[i]->getZ() - zw, cTot[0] + clArr[i]->getSigmaY2(), cTot[1] + clArr[i]->getSigmaZ2(), phi, clArr[i]->getZ(), 0.5 * (tInw.getSnp() + tOut.getSnp()), clSizeArr[i], clArr[i]->getSensorID(), i - 1);
530547
if (!innerDone) {
531548
resTrack.track = tInw;
532549
innerDone = true;
@@ -1151,7 +1168,7 @@ void CheckResidSpec::drawHistos()
11511168
const float yRange = iyz == 0 ? params.resMMLrY[il] : params.resMMLrZ[il];
11521169
bool drawn = false;
11531170
const int id = 15000 + iyz * 10 + (2 * il + ib) * 100 + 1 + iv;
1154-
auto [minV, maxV, absMax] = getHMinMax(id, 0.15, (iv == 0 ? 2 : 4) * yRange, 10);
1171+
auto [minV, maxV, absMax] = getHMinMax(id, 0.15, (iv == 0 ? 2 : 8) * yRange, 10);
11551172
TH1* firstAuto = nullptr;
11561173
float maxAuto = 0.f;
11571174
for (int j = 0; j < nh; j++) {

0 commit comments

Comments
 (0)