Skip to content

Commit f3fa6a9

Browse files
committed
ALICE3: assign cluster MC labels in TimeFrame loading
1 parent 4e9e2b9 commit f3fa6a9

3 files changed

Lines changed: 12 additions & 28 deletions

File tree

Detectors/Upgrades/ALICE3/GlobalReconstruction/reconstruction/src/TimeFrame.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,10 @@ int TimeFrame<nLayers>::loadROFsFromHitTree(TTree* hitsTree, GeometryTGeo* gman,
275275
}
276276
// Update primary vertices ROF structure
277277
}
278-
this->mClusterLabels[0] = labels;
279278
}
279+
// The MC labels container is the same pointer for every event — assign once
280+
// after the loop instead of redundantly on each iteration.
281+
this->mClusterLabels[0] = labels;
280282
return nRofs;
281283
}
282284

Detectors/Upgrades/ALICE3/GlobalReconstruction/reconstruction/src/TimeFrameGPU.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,10 @@ int TimeFrameGPU<nLayers>::loadROFsFromHitTree(TTree* hitsTree, GeometryTGeo* gm
255255
this->mROFramesClusters[iLayer][iRof] = this->mUnsortedClusters[iLayer].size();
256256
}
257257
}
258-
this->mClusterLabels[0] = labels;
259258
}
259+
// The MC labels container is the same pointer for every event — assign once
260+
// after the loop instead of redundantly on each iteration.
261+
this->mClusterLabels[0] = labels;
260262
return nRofs;
261263
}
262264

Detectors/Upgrades/ALICE3/GlobalReconstruction/workflow/src/TrackerSpec.cxx

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,10 @@ TrackerDPL::TrackerDPL(std::shared_ptr<o2::base::GRPGeomRequest> gr,
7474
}
7575
mIsMC = isMC;
7676
mDeviceType = dType;
77-
// mITSTrackingInterface.setTrackingMode(trMode);
7877
}
7978

8079
void TrackerDPL::init(InitContext& ic)
8180
{
82-
// mTimer.Stop();
83-
// mTimer.Reset();
84-
// o2::base::GRPGeomHelper::instance().setRequest(mGGCCDBRequest);
85-
// mChainITS.reset(mRecChain->AddChain<o2::gpu::GPUChainITS>());
86-
// mITSTrackingInterface.setTraitsFromProvider(mChainITS->GetITSVertexerTraits(),
87-
// mChainITS->GetITSTrackerTraits(),
88-
// mChainITS->GetITSTimeframe());
89-
9081
#ifdef O2_WITH_ACTS
9182
mUseACTS = ic.options().get<bool>("useACTS");
9283
#endif
@@ -529,6 +520,12 @@ void TrackerDPL::run(ProcessingContext& pc)
529520
LOGP(info, "TRK pushed {} tracks in {} ROFs and {} IR frames{}",
530521
allTracks.size(), allTrackROFs.size(), irFrames.size(),
531522
mIsMC ? " (with MC labels)" : "");
523+
524+
// Clear tracking state so the TimeFrame is ready for the next TF.
525+
// Today timeFrame is a stack local and is destroyed at end of this
526+
// lambda anyway, but wipe() matches the ITS lifecycle pattern and stays
527+
// correct if/when timeFrame is hoisted to a member for cross-TF reuse.
528+
timeFrame.wipe();
532529
};
533530

534531
#ifdef TRK_HAS_GPU_TRACKING
@@ -555,11 +552,6 @@ void TrackerDPL::run(ProcessingContext& pc)
555552
LOGP(info, "CPU Reconstruction time for this TF {} s (cpu), {} s (wall)", mTimer.CpuTime() - cput, mTimer.RealTime() - realt);
556553
}
557554

558-
// void TrackerDPL::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
559-
// {
560-
// // mITSTrackingInterface.finaliseCCDB(matcher, obj);
561-
// }
562-
563555
void TrackerDPL::endOfStream(EndOfStreamContext& ec)
564556
{
565557
LOGF(info, "TRK CA-Tracker total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
@@ -618,20 +610,8 @@ DataProcessorSpec getTrackerSpec(bool useMC, const std::string& hitRecoConfig, c
618610
}
619611
}
620612

621-
// inputs.emplace_back("itscldict", "TRK", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("ITS/Calib/ClusterDictionary"));
622-
// inputs.emplace_back("itsalppar", "TRK", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam"));
623-
624-
// outputs.emplace_back("TRK", "TRACKCLSID", 0, Lifetime::Timeframe);
625-
// outputs.emplace_back("TRK", "TRKTrackROF", 0, Lifetime::Timeframe);
626-
// outputs.emplace_back("TRK", "VERTICES", 0, Lifetime::Timeframe);
627-
// outputs.emplace_back("TRK", "VERTICESROF", 0, Lifetime::Timeframe);
628-
// outputs.emplace_back("TRK", "IRFRAMES", 0, Lifetime::Timeframe);
629-
630613
if (useMC) {
631-
// outputs.emplace_back("TRK", "VERTICESMCTR", 0, Lifetime::Timeframe);
632-
// outputs.emplace_back("TRK", "VERTICESMCPUR", 0, Lifetime::Timeframe);
633614
outputs.emplace_back("TRK", "TRACKSMCTR", 0, Lifetime::Timeframe);
634-
// outputs.emplace_back("TRK", "TRKTrackMC2ROF", 0, Lifetime::Timeframe);
635615
}
636616

637617
return DataProcessorSpec{

0 commit comments

Comments
 (0)