39 mFile.reset(TFile::Open(
filename.c_str()));
40 if (!mFile->IsOpen()) {
41 LOG(error) <<
"Cannot open the " <<
filename.c_str() <<
" file !";
42 throw std::runtime_error(
"cannot open input digits file");
44 mTree.reset((TTree*)mFile->Get(
"o2rec"));
46 LOG(error) <<
"Did not find o2sim tree in " <<
filename.c_str();
47 throw std::runtime_error(
"Did not find o2rec tree in ZDC reco file");
54 std::vector<o2::zdc::BCRecData> RecBC, *RecBCPtr = &RecBC;
55 std::vector<o2::zdc::ZDCEnergy> Energy, *EnergyPtr = &Energy;
56 std::vector<o2::zdc::ZDCTDCData> TDCData, *TDCDataPtr = &TDCData;
57 std::vector<uint16_t> Info, *InfoPtr = &Info;
58 std::vector<o2::zdc::ZDCWaveform> WaveformData, *WaveformDataPtr = &WaveformData;
60 mTree->SetBranchAddress(
"ZDCRecBC", &RecBCPtr);
61 mTree->SetBranchAddress(
"ZDCRecE", &EnergyPtr);
62 mTree->SetBranchAddress(
"ZDCRecTDC", &TDCDataPtr);
63 mTree->SetBranchAddress(
"ZDCRecInfo", &InfoPtr);
64 mTree->SetBranchAddress(
"ZDCWaveform", &WaveformDataPtr);
66 auto ent = mTree->GetReadEntry() + 1;
67 assert(ent < mTree->GetEntries());
69 LOG(info) <<
"ZDCRecoReader pushed " << RecBC.size() <<
" b.c. " << Energy.size() <<
" Energies " << TDCData.size() <<
" TDCs " << Info.size() <<
" Infos " << WaveformData.size() <<
" Waveform chunks";
76 if (mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
84 std::vector<OutputSpec> outputs;
85 outputs.emplace_back(
"ZDC",
"BCREC", 0, Lifetime::Timeframe);
86 outputs.emplace_back(
"ZDC",
"ENERGY", 0, Lifetime::Timeframe);
87 outputs.emplace_back(
"ZDC",
"TDCDATA", 0, Lifetime::Timeframe);
88 outputs.emplace_back(
"ZDC",
"INFO", 0, Lifetime::Timeframe);
89 outputs.emplace_back(
"ZDC",
"WAVE", 0, Lifetime::Timeframe);
97 {
"zdc-reco-infile", VariantType::String,
"zdcreco.root", {
"Name of the input file"}},
98 {
"enable-waveform", VariantType::Bool,
false, {
"Read waveform data"}},
99 {
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
Class to describe fired triggered and/or stored channels for the BC and to refer to channel data.
Definition of the Names Generator class.
Class to describe pedestal data accumulated over the orbit.
Class to describe reconstructed ZDC event (single BC with signal in one of detectors)
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 init(framework::InitContext &ic) final
void run(framework::ProcessingContext &pc) final
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
struct o2::upgrades_utils::@463 zdc
structure to keep FT0 information
framework::DataProcessorSpec getRecoReaderSpec()
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"