From 1de4f2a0a68b3612d2ac4b6c3bb7896bfa5fc850 Mon Sep 17 00:00:00 2001 From: shahoian Date: Mon, 2 Nov 2026 12:07:51 +0100 Subject: [PATCH 1/2] TrackCosmicsExt.Reader pushes TF ID info only if explicitly requested The content of tfID branch written in the TrackCosmicsExtended tree is identical to TimingInfo provided by DPL from the o2_tfidinfo.root tree. By default the corresponding input {GLO,COSMFULLTFID,0} will be skipped, can be requested via --push-tfid-info option. --- .../TrackCosmicsExtendedReaderSpec.h | 1 + .../readers/src/TrackCosmicsExtendedReaderSpec.cxx | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Detectors/GlobalTrackingWorkflow/readers/include/GlobalTrackingWorkflowReaders/TrackCosmicsExtendedReaderSpec.h b/Detectors/GlobalTrackingWorkflow/readers/include/GlobalTrackingWorkflowReaders/TrackCosmicsExtendedReaderSpec.h index 8c904e48651f6..43e9dabfa5e6c 100644 --- a/Detectors/GlobalTrackingWorkflow/readers/include/GlobalTrackingWorkflowReaders/TrackCosmicsExtendedReaderSpec.h +++ b/Detectors/GlobalTrackingWorkflow/readers/include/GlobalTrackingWorkflowReaders/TrackCosmicsExtendedReaderSpec.h @@ -39,6 +39,7 @@ class TrackCosmicsExtendedReader : public Task private: void connectTree(const std::string& filename); + bool mIncludeTFIDInfo = false; std::unique_ptr mFile; std::unique_ptr mTree; std::string mFileName = ""; diff --git a/Detectors/GlobalTrackingWorkflow/readers/src/TrackCosmicsExtendedReaderSpec.cxx b/Detectors/GlobalTrackingWorkflow/readers/src/TrackCosmicsExtendedReaderSpec.cxx index d6c47753b41c4..5fc776d831b13 100644 --- a/Detectors/GlobalTrackingWorkflow/readers/src/TrackCosmicsExtendedReaderSpec.cxx +++ b/Detectors/GlobalTrackingWorkflow/readers/src/TrackCosmicsExtendedReaderSpec.cxx @@ -28,6 +28,7 @@ namespace globaltracking { void TrackCosmicsExtendedReader::init(InitContext& ic) { + mIncludeTFIDInfo = ic.options().get("push-tfid-info"); mFileName = o2::utils::Str::concat_string(o2::utils::Str::rectifyDirectory(ic.options().get("input-dir")), ic.options().get("cosmics-full-infile")); connectTree(mFileName); @@ -50,8 +51,9 @@ void TrackCosmicsExtendedReader::run(ProcessingContext& pc) pc.outputs().snapshot(Output{"GLO", "COSMFULL", 0}, mCosmics); pc.outputs().snapshot(Output{"GLO", "COSMFULLTF", 0}, mTFInfo); - pc.outputs().snapshot(Output{"GLO", "COSMFULLTFID", 0}, mTFID); - + if (mIncludeTFIDInfo) { + pc.outputs().snapshot(Output{"GLO", "COSMFULLTFID", 0}, mTFID); + } if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) { pc.services().get().endOfStream(); pc.services().get().readyToQuit(QuitRequest::Me); @@ -71,7 +73,9 @@ void TrackCosmicsExtendedReader::connectTree(const std::string& filename) } mTree->SetBranchAddress("cosmics", &mCosmicsPtr); mTree->SetBranchAddress("tfInfo", &mTFInfoPtr); - mTree->SetBranchAddress("tfID", &mTFIDPtr); + if (mIncludeTFIDInfo) { + mTree->SetBranchAddress("tfID", &mTFIDPtr); + } LOG(info) << "Loaded tree from " << filename << " with " << mTree->GetEntries() << " entries"; } @@ -89,6 +93,7 @@ DataProcessorSpec getTrackCosmicsExtendedReaderSpec() AlgorithmSpec{adaptFromTask()}, Options{ {"cosmics-full-infile", VariantType::String, "o2_cosmics_full.root", {"Name of the input file"}}, + {"push-tfid-info", VariantType::Bool, false, {"Include tfID branch (identical to o2_tfidinfo.root content pushed by DPL)"}}, {"input-dir", VariantType::String, "none", {"Input directory"}}}}; } From ebec8f187c142ab22f23bafb9cc37218f75bb7d6 Mon Sep 17 00:00:00 2001 From: shahoian Date: Mon, 2 Nov 2026 13:46:52 +0100 Subject: [PATCH 2/2] Remove tfID info also from the RecoContainer --- .../include/DataFormatsGlobalTracking/RecoContainer.h | 7 ++----- DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx | 6 ------ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/DataFormats/Detectors/GlobalTracking/include/DataFormatsGlobalTracking/RecoContainer.h b/DataFormats/Detectors/GlobalTracking/include/DataFormatsGlobalTracking/RecoContainer.h index 037898a3786a3..58b456d84b304 100644 --- a/DataFormats/Detectors/GlobalTracking/include/DataFormatsGlobalTracking/RecoContainer.h +++ b/DataFormats/Detectors/GlobalTracking/include/DataFormatsGlobalTracking/RecoContainer.h @@ -174,7 +174,6 @@ class StrangeTrack; class TrackCosmics; struct TrackCosmicsExtended; struct CosmicsTFInfo; -struct TFIDInfo; class GlobalFwdTrack; class MatchInfoFwd; class TrackMCHMID; @@ -330,7 +329,6 @@ struct RecoContainer { COSM_TRACKS_MC, COSMEXT_TRACKS, // extended cosmics (with clusters), no MC COSMEXT_TFINFO, // per-TF info of the extended cosmics - COSMEXT_TFID, // TFIDInfo of the extended cosmics NCOSMSLOTS }; // slots to register ITS/MFT clusters data (per layer, or all layers together in the slot 0) @@ -378,7 +376,7 @@ struct RecoContainer { std::unique_ptr> mcMIDTracks; o2::ctp::LumiInfo mCTPLumi; - std::shared_ptr cosmExtHolder[3]; // owners of the extended cosmics, TF info and TFID objects deserialized from the messages + std::shared_ptr cosmExtHolder[2]; // owners of the extended cosmics and TF info objects deserialized from the messages gsl::span clusterShMapTPC; ///< externally set TPC clusters sharing map gsl::span occupancyMapTPC; ///< externally set TPC clusters occupancy map @@ -764,11 +762,10 @@ struct RecoContainer { auto getCosmicTracks() const { return cosmPool.getSpan(COSM_TRACKS); } auto getCosmicTrackMCLabels() const { return cosmPool.getSpan(COSM_TRACKS_MC); } - // Extended cosmic tracks (with clusters); the user must include DataFormatsGlobalTracking/TrackCosmicsExtended.h and CommonDataFormat/TFIDInfo.h + // Extended cosmic tracks (with clusters); the user must include DataFormatsGlobalTracking/TrackCosmicsExtended.h const o2::dataformats::TrackCosmicsExtended& getCosmicExtTrack(int i) const { return cosmPool.get_as(COSMEXT_TRACKS, i); } auto getCosmicExtTracks() const { return cosmPool.getSpan(COSMEXT_TRACKS); } const o2::dataformats::CosmicsTFInfo& getCosmicExtTFInfo() const { return cosmPool.get_as(COSMEXT_TFINFO, 0); } - const o2::dataformats::TFIDInfo& getCosmicExtTFID() const { return cosmPool.get_as(COSMEXT_TFID, 0); } // IRFrames where ITS was reconstructed and tracks were seen (e.g. sync.w-flow mult. selection) auto getIRFramesITS() const { return getSpan(GTrackID::ITS, VARIA); } diff --git a/DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx b/DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx index a2ff513247595..a46f2387a01d6 100644 --- a/DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx +++ b/DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx @@ -32,7 +32,6 @@ #include "ReconstructionDataFormats/VtxTrackRef.h" #include "ReconstructionDataFormats/TrackCosmics.h" #include "DataFormatsGlobalTracking/TrackCosmicsExtended.h" -#include "CommonDataFormat/TFIDInfo.h" #include "ReconstructionDataFormats/TrackMCHMID.h" #include "DataFormatsITSMFT/TrkClusRef.h" #include "DataFormatsITSMFT/TopologyDictionary.h" @@ -435,7 +434,6 @@ void DataRequest::requestCosmicExtTracks(bool mc) { addInput({"cosmicsExt", "GLO", "COSMFULL", 0, Lifetime::Timeframe}); addInput({"cosmicsExtTF", "GLO", "COSMFULLTF", 0, Lifetime::Timeframe}); - addInput({"cosmicsExtTFID", "GLO", "COSMFULLTFID", 0, Lifetime::Timeframe}); if (mc) { LOG(error) << "Extended cosmics do not support MC truth"; } @@ -925,18 +923,14 @@ void RecoContainer::addPVerticesTMP(ProcessingContext& pc, bool mc) void RecoContainer::addCosmicExtTracks(ProcessingContext& pc, bool mc) { using o2::dataformats::CosmicsTFInfo; - using o2::dataformats::TFIDInfo; using o2::dataformats::TrackCosmicsExtended; // the messages are ROOT-serialized, keep the deserialized objects alive until the next TF std::shared_ptr> cosm = pc.inputs().get*>("cosmicsExt"); std::shared_ptr tfInfo = pc.inputs().get("cosmicsExtTF"); - std::shared_ptr tfID = pc.inputs().get("cosmicsExtTFID"); cosmPool.registerContainer(*cosm, COSMEXT_TRACKS); cosmPool.registerContainer(gsl::span(tfInfo.get(), 1), COSMEXT_TFINFO); - cosmPool.registerContainer(gsl::span(tfID.get(), 1), COSMEXT_TFID); cosmExtHolder[0] = std::move(cosm); cosmExtHolder[1] = std::move(tfInfo); - cosmExtHolder[2] = std::move(tfID); if (mc) { LOG(error) << "Extended cosmics do not support MC truth"; }