Skip to content

Commit 5e1b56b

Browse files
committed
Store TPC cluster flag in UnbinnedResid::channel
1 parent 16b6488 commit 5e1b56b

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

Detectors/TPC/calibration/SpacePoints/include/SpacePoints/TrackInterpolation.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ struct TPCClusterResiduals {
6666
float snp{}; ///< sin of the phi angle between padrow and track
6767
unsigned char sec{}; ///< sector number 0..35
6868
unsigned char dRow{}; ///< distance to previous row in units of pad rows
69-
ClassDefNV(TPCClusterResiduals, 5);
69+
unsigned char flags{}; ///< cluster flags
70+
ClassDefNV(TPCClusterResiduals, 6);
7071
};
7172

7273
/// This struct is used to store the unbinned TPC cluster residuals in a compact way
@@ -275,6 +276,7 @@ class TrackInterpolation
275276
float clAngle{0.f};
276277
unsigned short clAvailable{0};
277278
unsigned char clSec{0};
279+
unsigned char clFlags{0};
278280
};
279281

280282
/// Structure for on-the-fly re-calculated track parameters at the validation stage
@@ -460,8 +462,10 @@ class TrackInterpolation
460462
std::vector<int> mParentID{}; ///< entry of more global parent track for skimmed seeds (-1: no parent)
461463
std::map<int, int> mTrackTypes; ///< mapping of track source to array index in mTrackIndices
462464
std::array<std::vector<uint32_t>, 4> mTrackIndices; ///< keep GIDs of input tracks separately for each track type
463-
gsl::span<const TPCClRefElem> mTPCTracksClusIdx; ///< input TPC cluster indices from span
465+
gsl::span<const TPCClRefElem> mTPCTrackClusIdx; ///< input TPC cluster indices from span
466+
gsl::span<const unsigned char> mTPCShClassMap; ///< TPC cluster sharing map
464467
const ClusterNativeAccess* mTPCClusterIdxStruct = nullptr; ///< struct holding the TPC cluster indices
468+
465469
// ITS specific input only needed for debugging
466470
gsl::span<const int> mITSTrackClusIdx; ///< input ITS track cluster indices span
467471
std::vector<o2::BaseCluster<float>> mITSClustersArray; ///< ITS clusters created in run() method from compact clusters

Detectors/TPC/calibration/SpacePoints/src/TrackInterpolation.cxx

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,8 @@ void TrackInterpolation::process()
338338
return;
339339
}
340340
// set the input containers
341-
mTPCTracksClusIdx = mRecoCont->getTPCTracksClusterRefs();
341+
mTPCTrackClusIdx = mRecoCont->getTPCTracksClusterRefs();
342+
mTPCShClassMap = mRecoCont->clusterShMapTPC;
342343
mTPCClusterIdxStruct = &mRecoCont->getTPCClusters();
343344
int nbOccTOT = o2::gpu::GPUO2InterfaceRefit::fillOccupancyMapGetSize(mNHBPerTF, mTPCParam.get());
344345
o2::gpu::GPUO2InterfaceUtils::paramUseExternalOccupancyMap(mTPCParam.get(), mNHBPerTF, mRecoCont->occupancyMapTPC.data(), nbOccTOT);
@@ -511,7 +512,9 @@ void TrackInterpolation::interpolateTrack(int iSeed)
511512
for (int iCl = trkTPC.getNClusterReferences(); iCl--;) {
512513
uint8_t sector, row;
513514
uint32_t clusterIndexInRow;
514-
const auto& clTPC = trkTPC.getCluster(mTPCTracksClusIdx, iCl, *mTPCClusterIdxStruct, sector, row);
515+
trkTPC.getClusterReference(mTPCTrackClusIdx, iCl, sector, row, clusterIndexInRow);
516+
unsigned int absoluteIndex = mTPCClusterIdxStruct->clusterOffset[sector][row] + clusterIndexInRow;
517+
const auto& clTPC = mTPCClusterIdxStruct->clustersLinear[absoluteIndex];
515518
float clTPCX;
516519
std::array<float, 2> clTPCYZ;
517520
mFastTransform->TransformIdeal(sector, row, clTPC.getPad(), clTPC.getTime(), clTPCX, clTPCYZ[0], clTPCYZ[1], clusterTimeBinOffset);
@@ -520,6 +523,10 @@ void TrackInterpolation::interpolateTrack(int iSeed)
520523
mCache[row].clY = clTPCYZ[0];
521524
mCache[row].clZ = clTPCYZ[1];
522525
mCache[row].clAngle = o2::math_utils::sector2Angle(sector);
526+
mCache[row].clFlags = clTPC.getFlags();
527+
if (mTPCShClassMap[absoluteIndex] & o2::gpu::GPUTPCGMMergedTrackHit::flagShared) {
528+
mCache[row].clFlags |= o2::gpu::GPUTPCGMMergedTrackHit::flagShared;
529+
}
523530
mCacheDEDX[row].first = std::min<uint16_t>(clTPC.getQtot(), UINT16_MAX);
524531
mCacheDEDX[row].second = clTPC.getQmax();
525532
int imb = int(clTPC.getTime() * mNTPCOccBinLengthInv);
@@ -670,7 +677,7 @@ void TrackInterpolation::interpolateTrack(int iSeed)
670677
const auto z = mCache[iRow].z[Int];
671678
const auto snp = mCache[iRow].snp[Int];
672679
const auto sec = mCache[iRow].clSec;
673-
clusterResiduals.emplace_back(dY, dZ, y, z, snp, sec, deltaRow);
680+
clusterResiduals.emplace_back(dY, dZ, y, z, snp, sec, deltaRow, mCache[iRow].clFlags);
674681

675682
deltaRow = 1;
676683
}
@@ -717,8 +724,9 @@ void TrackInterpolation::interpolateTrack(int iSeed)
717724
const auto y = clusterResiduals[iCl].y;
718725
const auto z = clusterResiduals[iCl].z;
719726
const auto sec = clusterResiduals[iCl].sec;
727+
const short flags = clusterResiduals[iCl].flags;
720728
if ((std::abs(dy) < param::MaxResid) && (std::abs(dz) < param::MaxResid) && (std::abs(y) < param::MaxY) && (std::abs(z) < param::MaxZ) && (std::abs(tgPhi) < param::MaxTgSlp)) {
721-
mClRes.emplace_back(dy, dz, tgPhi, y, z, iRow, sec, -1, rej);
729+
mClRes.emplace_back(dy, dz, tgPhi, y, z, iRow, sec, flags, rej);
722730
mDetInfoRes.emplace_back().setTPC(mCacheDEDX[iRow].first, mCacheDEDX[iRow].second); // qtot, qmax
723731
++nClValidated;
724732
} else {
@@ -983,7 +991,9 @@ void TrackInterpolation::extrapolateTrack(int iSeed)
983991
for (int iCl = trkTPC.getNClusterReferences(); iCl--;) {
984992
uint8_t sector, row;
985993
uint32_t clusterIndexInRow;
986-
const auto& cl = trkTPC.getCluster(mTPCTracksClusIdx, iCl, *mTPCClusterIdxStruct, sector, row);
994+
trkTPC.getClusterReference(mTPCTrackClusIdx, iCl, sector, row, clusterIndexInRow);
995+
unsigned int absoluteIndex = mTPCClusterIdxStruct->clusterOffset[sector][row] + clusterIndexInRow;
996+
const auto& cl = mTPCClusterIdxStruct->clustersLinear[absoluteIndex];
987997
if (clRowPrev == row) {
988998
// if there are split clusters we only take the first one on the pad row
989999
continue;
@@ -1014,7 +1024,11 @@ void TrackInterpolation::extrapolateTrack(int iSeed)
10141024
const auto tz = trkWork.getZ();
10151025
const auto snp = trkWork.getSnp();
10161026
const auto sec = sector;
1017-
clusterResiduals.emplace_back(dY, dZ, ty, tz, snp, sec, row - rowPrev);
1027+
unsigned char flags = cl.getFlags();
1028+
if (mTPCShClassMap[absoluteIndex] & o2::gpu::GPUTPCGMMergedTrackHit::flagShared) {
1029+
flags |= o2::gpu::GPUTPCGMMergedTrackHit::flagShared;
1030+
}
1031+
clusterResiduals.emplace_back(dY, dZ, ty, tz, snp, sec, row - rowPrev, flags);
10181032
mCacheDEDX[row].first = cl.getQtot();
10191033
mCacheDEDX[row].second = cl.getQmax();
10201034
rowPrev = row;
@@ -1061,8 +1075,9 @@ void TrackInterpolation::extrapolateTrack(int iSeed)
10611075
const auto dz = clusterResiduals[iCl].dz;
10621076
const auto y = clusterResiduals[iCl].y;
10631077
const auto z = clusterResiduals[iCl].z;
1078+
const short flags = clusterResiduals[iCl].flags;
10641079
if ((std::abs(dy) < param::MaxResid) && (std::abs(dz) < param::MaxResid) && (std::abs(y) < param::MaxY) && (std::abs(z) < param::MaxZ) && (std::abs(tgPhi) < param::MaxTgSlp)) {
1065-
mClRes.emplace_back(dy, dz, tgPhi, y, z, iRow, clusterResiduals[iCl].sec, -1, rej);
1080+
mClRes.emplace_back(dy, dz, tgPhi, y, z, iRow, clusterResiduals[iCl].sec, flags, rej);
10661081
mDetInfoRes.emplace_back().setTPC(mCacheDEDX[iRow].first, mCacheDEDX[iRow].second); // qtot, qmax
10671082
++nClValidated;
10681083
} else {

0 commit comments

Comments
 (0)