From 80d9bb977b3b4cfb9e870c1d1580bd2d0653a69a Mon Sep 17 00:00:00 2001 From: Matthias Kleiner Date: Wed, 7 Oct 2026 22:31:10 +0200 Subject: [PATCH] TPC track reader: do not accumulate MC labels over entries With one entry per call, TrackReader::accumulate swapped the tracks and cluster references of the new entry in, but appended its MC labels to mMCTruthOut, which is never cleared. From the second tree entry on, the consumers therefore got the labels of the first entry for the tracks of the current one (label i = label of track i of entry 0). Swap the labels as well. Only visible when a tpctracks.root holds more than one TF (e.g. merged MC files); O2DPG writes one TF per file. Co-Authored-By: Claude Opus 5.5 --- Detectors/TPC/workflow/readers/src/TrackReaderSpec.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/TPC/workflow/readers/src/TrackReaderSpec.cxx b/Detectors/TPC/workflow/readers/src/TrackReaderSpec.cxx index c511603d407a7..8d0f7681c2f33 100644 --- a/Detectors/TPC/workflow/readers/src/TrackReaderSpec.cxx +++ b/Detectors/TPC/workflow/readers/src/TrackReaderSpec.cxx @@ -97,7 +97,7 @@ void TrackReader::accumulate(int from, int n) mTracksOut.swap(*mTracksInp); mCluRefVecOut.swap(*mCluRefVecInp); if (mUseMC) { - std::copy(mMCTruthInp->begin(), mMCTruthInp->end(), std::back_inserter(mMCTruthOut)); + mMCTruthOut.swap(*mMCTruthInp); } } else { for (int iev = 0; iev < n; iev++) {