Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class TrackCosmicsExtendedReader : public Task
std::string mFileName = "";
std::vector<o2::dataformats::TrackCosmicsExtended> mCosmics, *mCosmicsPtr = &mCosmics;
o2::dataformats::CosmicsTFInfo mTFInfo, *mTFInfoPtr = &mTFInfo;
o2::dataformats::TFIDInfo mTFID, *mTFIDPtr = &mTFID;
};

/// create a processor spec to read the extended cosmics (as written by cosmics-full-writer) from a root file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ namespace globaltracking
{
void TrackCosmicsExtendedReader::init(InitContext& ic)
{
mIncludeTFIDInfo = ic.options().get<bool>("push-tfid-info");
mFileName = o2::utils::Str::concat_string(o2::utils::Str::rectifyDirectory(ic.options().get<std::string>("input-dir")),
ic.options().get<std::string>("cosmics-full-infile"));
connectTree(mFileName);
Expand All @@ -43,17 +42,13 @@ void TrackCosmicsExtendedReader::run(ProcessingContext& pc)
LOG(info) << "no entry to read, publishing empty output";
mCosmics.clear();
mTFInfo = {};
mTFID = {};
} else {
mTree->GetEntry(ent);
}
LOG(info) << "Pushing " << mCosmics.size() << " cosmics with clusters at entry " << ent;

pc.outputs().snapshot(Output{"GLO", "COSMFULL", 0}, mCosmics);
pc.outputs().snapshot(Output{"GLO", "COSMFULLTF", 0}, mTFInfo);
if (mIncludeTFIDInfo) {
pc.outputs().snapshot(Output{"GLO", "COSMFULLTFID", 0}, mTFID);
}
if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
Expand All @@ -73,9 +68,6 @@ void TrackCosmicsExtendedReader::connectTree(const std::string& filename)
}
mTree->SetBranchAddress("cosmics", &mCosmicsPtr);
mTree->SetBranchAddress("tfInfo", &mTFInfoPtr);
if (mIncludeTFIDInfo) {
mTree->SetBranchAddress("tfID", &mTFIDPtr);
}
LOG(info) << "Loaded tree from " << filename << " with " << mTree->GetEntries() << " entries";
}

Expand All @@ -84,7 +76,6 @@ DataProcessorSpec getTrackCosmicsExtendedReaderSpec()
std::vector<OutputSpec> outputs;
outputs.emplace_back("GLO", "COSMFULL", 0, Lifetime::Timeframe);
outputs.emplace_back("GLO", "COSMFULLTF", 0, Lifetime::Timeframe);
outputs.emplace_back("GLO", "COSMFULLTFID", 0, Lifetime::Timeframe);

return DataProcessorSpec{
"cosmic-ext-reader",
Expand All @@ -93,7 +84,6 @@ DataProcessorSpec getTrackCosmicsExtendedReaderSpec()
AlgorithmSpec{adaptFromTask<TrackCosmicsExtendedReader>()},
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"}}}};
}

Expand Down
Loading