Skip to content

Commit 29cf278

Browse files
sawenzelclaude
andcommitted
Write tracked V0s, cascades and 3-bodies in collision order
This fixes the row order of the tracked strangeness tables written by the AOD producer. - The tracked V0, cascade and 3-body rows were written in strangeness-tracker order, which is not always collision order. - Analyses slicing them by collision then abort with "TraCascIndices index fIndexCollisions is not sorted". - The rows are now written in the per-collision order already built in prepareStrangenessTracking. - The track index of a row no longer comes from a running counter, so a skipped strange track cannot shift the rows after it. https://its.cern.ch/jira/browse/O2-7197 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a63596e commit 29cf278

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎Detectors/AOD/src/AODProducerWorkflowSpec.cxx‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,6 @@ template <typename V0C, typename CC, typename D3BC>
15361536
void AODProducerWorkflowDPL::fillStrangenessTrackingTables(const o2::globaltracking::RecoContainer& recoData, V0C& v0Curs, CC& cascCurs, D3BC& d3BodyCurs)
15371537
{
15381538
int itsTableIdx = -1;
1539-
int sTrkID = 0;
15401539
int nV0 = 0;
15411540
int nCasc = 0;
15421541
int nD3Body = 0;
@@ -1555,7 +1554,10 @@ void AODProducerWorkflowDPL::fillStrangenessTrackingTables(const o2::globaltrack
15551554
cascCurs.reserve(nCasc);
15561555
d3BodyCurs.reserve(nD3Body);
15571556

1558-
for (const auto& sTrk : recoData.getStrangeTracks()) {
1557+
// Write the rows grouped by collision, the order analyses slice these tables in
1558+
auto sTracks = recoData.getStrangeTracks();
1559+
for (const auto& collStrTrk : mCollisionStrTrk) {
1560+
const auto& sTrk = sTracks[collStrTrk.second];
15591561
auto ITSIndex = GIndex{sTrk.mITSRef, GIndex::ITS};
15601562
auto item = mGIDToTableID.find(ITSIndex);
15611563
if (item != mGIDToTableID.end()) {
@@ -1565,7 +1567,7 @@ void AODProducerWorkflowDPL::fillStrangenessTrackingTables(const o2::globaltrack
15651567
continue;
15661568
}
15671569
if (sTrk.mPartType == dataformats::kStrkV0) {
1568-
v0Curs(mStrTrkIndices[sTrkID++],
1570+
v0Curs(mStrTrkIndices[collStrTrk.second],
15691571
itsTableIdx,
15701572
sTrk.mDecayRef,
15711573
sTrk.mDecayVtx[0],
@@ -1577,7 +1579,7 @@ void AODProducerWorkflowDPL::fillStrangenessTrackingTables(const o2::globaltrack
15771579
sTrk.mTopoChi2,
15781580
sTrk.getAverageClusterSize());
15791581
} else if (sTrk.mPartType == dataformats::kStrkCascade) {
1580-
cascCurs(mStrTrkIndices[sTrkID++],
1582+
cascCurs(mStrTrkIndices[collStrTrk.second],
15811583
itsTableIdx,
15821584
sTrk.mDecayRef,
15831585
sTrk.mDecayVtx[0],
@@ -1589,7 +1591,7 @@ void AODProducerWorkflowDPL::fillStrangenessTrackingTables(const o2::globaltrack
15891591
sTrk.mTopoChi2,
15901592
sTrk.getAverageClusterSize());
15911593
} else {
1592-
d3BodyCurs(mStrTrkIndices[sTrkID++],
1594+
d3BodyCurs(mStrTrkIndices[collStrTrk.second],
15931595
itsTableIdx,
15941596
sTrk.mDecayRef,
15951597
sTrk.mDecayVtx[0],

0 commit comments

Comments
 (0)