Skip to content

Commit 1de4f2a

Browse files
committed
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.
1 parent 798e8d5 commit 1de4f2a

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎Detectors/GlobalTrackingWorkflow/readers/include/GlobalTrackingWorkflowReaders/TrackCosmicsExtendedReaderSpec.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class TrackCosmicsExtendedReader : public Task
3939

4040
private:
4141
void connectTree(const std::string& filename);
42+
bool mIncludeTFIDInfo = false;
4243
std::unique_ptr<TFile> mFile;
4344
std::unique_ptr<TTree> mTree;
4445
std::string mFileName = "";

‎Detectors/GlobalTrackingWorkflow/readers/src/TrackCosmicsExtendedReaderSpec.cxx‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace globaltracking
2828
{
2929
void TrackCosmicsExtendedReader::init(InitContext& ic)
3030
{
31+
mIncludeTFIDInfo = ic.options().get<bool>("push-tfid-info");
3132
mFileName = o2::utils::Str::concat_string(o2::utils::Str::rectifyDirectory(ic.options().get<std::string>("input-dir")),
3233
ic.options().get<std::string>("cosmics-full-infile"));
3334
connectTree(mFileName);
@@ -50,8 +51,9 @@ void TrackCosmicsExtendedReader::run(ProcessingContext& pc)
5051

5152
pc.outputs().snapshot(Output{"GLO", "COSMFULL", 0}, mCosmics);
5253
pc.outputs().snapshot(Output{"GLO", "COSMFULLTF", 0}, mTFInfo);
53-
pc.outputs().snapshot(Output{"GLO", "COSMFULLTFID", 0}, mTFID);
54-
54+
if (mIncludeTFIDInfo) {
55+
pc.outputs().snapshot(Output{"GLO", "COSMFULLTFID", 0}, mTFID);
56+
}
5557
if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
5658
pc.services().get<ControlService>().endOfStream();
5759
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
@@ -71,7 +73,9 @@ void TrackCosmicsExtendedReader::connectTree(const std::string& filename)
7173
}
7274
mTree->SetBranchAddress("cosmics", &mCosmicsPtr);
7375
mTree->SetBranchAddress("tfInfo", &mTFInfoPtr);
74-
mTree->SetBranchAddress("tfID", &mTFIDPtr);
76+
if (mIncludeTFIDInfo) {
77+
mTree->SetBranchAddress("tfID", &mTFIDPtr);
78+
}
7579
LOG(info) << "Loaded tree from " << filename << " with " << mTree->GetEntries() << " entries";
7680
}
7781

@@ -89,6 +93,7 @@ DataProcessorSpec getTrackCosmicsExtendedReaderSpec()
8993
AlgorithmSpec{adaptFromTask<TrackCosmicsExtendedReader>()},
9094
Options{
9195
{"cosmics-full-infile", VariantType::String, "o2_cosmics_full.root", {"Name of the input file"}},
96+
{"push-tfid-info", VariantType::Bool, false, {"Include tfID branch (identical to o2_tfidinfo.root content pushed by DPL)"}},
9297
{"input-dir", VariantType::String, "none", {"Input directory"}}}};
9398
}
9499

0 commit comments

Comments
 (0)