34 LOG(warning) <<
"ZDC RecEvent reader at the moment does not process MC";
41 ic.
options().
get<std::string>(
"zdc-reco-infile"));
42 connectTree(mInputFileName);
47 auto ent = mTree->GetReadEntry() + 1;
53 const bool noEntry = ent >= mTree->GetEntries();
55 LOG(info) <<
"no entry to read, publishing empty output";
60 static const std::vector<o2::zdc::BCRecData> noBCRecData;
61 static const std::vector<o2::zdc::ZDCEnergy> noEnergy;
62 static const std::vector<o2::zdc::ZDCTDCData> noTDCData;
63 static const std::vector<uint16_t> noInfo;
64 const auto& bcRecData = noEntry ? noBCRecData : *mBCRecData;
65 const auto& energy = noEntry ? noEnergy : *mZDCEnergy;
66 const auto& tdcData = noEntry ? noTDCData : *mZDCTDCData;
67 const auto& info = noEntry ? noInfo : *mZDCInfo;
68 LOG(info) <<
"ZDC RecEventReader pushes " << bcRecData.size() <<
" events with " << energy.size() <<
" energy, " << tdcData.size() <<
" TDC and " << info.size() <<
" info records at entry " << ent;
74 if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
80void RecEventReader::connectTree(
const std::string&
filename)
84 mFile.reset(TFile::Open(
filename.c_str()));
85 assert(mFile && !mFile->IsZombie());
86 mTree.reset((TTree*)mFile->Get(mRecEventTreeName.c_str()));
89 mTree->SetBranchAddress(mBCRecDataBranchName.c_str(), &mBCRecData);
90 mTree->SetBranchAddress(mZDCEnergyBranchName.c_str(), &mZDCEnergy);
91 mTree->SetBranchAddress(mZDCTDCDataBranchName.c_str(), &mZDCTDCData);
92 mTree->SetBranchAddress(mZDCInfoBranchName.c_str(), &mZDCInfo);
94 LOG(warning) <<
"MC-truth is not supported for ZDC recpoints currently";
98 LOG(info) <<
"Loaded ZDC RecEvents tree from " <<
filename <<
" with " << mTree->GetEntries() <<
" entries";
103 std::vector<OutputSpec> outputs;
104 outputs.emplace_back(
"ZDC",
"BCREC", 0, Lifetime::Timeframe);
105 outputs.emplace_back(
"ZDC",
"ENERGY", 0, Lifetime::Timeframe);
106 outputs.emplace_back(
"ZDC",
"TDCDATA", 0, Lifetime::Timeframe);
107 outputs.emplace_back(
"ZDC",
"INFO", 0, Lifetime::Timeframe);
109 LOG(warning) <<
"MC-truth is not supported for ZDC RecEvents currently";
118 {
"zdc-reco-infile", VariantType::String,
"zdcreco.root", {
"Name of the input file"}},
119 {
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
Definition of the Names Generator class.
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
ServiceRegistryRef services()
The services registry associated with this processing context.
virtual void endOfStream(EndOfStreamContext &context)
This is invoked whenever we have an EndOfStream event.
void run(ProcessingContext &pc) final
void init(InitContext &ic) final
RecEventReader(bool useMC=true)
Defining ITS Vertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
struct o2::upgrades_utils::@478 zdc
structure to keep FT0 information
framework::DataProcessorSpec getRecEventReaderSpec(bool useMC)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
static std::string rectifyDirectory(const std::string_view p)
static std::string concat_string(Ts const &... ts)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"