39 mFile.reset(TFile::Open(
filename.c_str()));
40 if (!mFile->IsOpen()) {
42 throw std::runtime_error(
"cannot open input digits file");
44 mTree.reset((TTree*)mFile->Get(
"o2rec"));
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;
72 const bool noEntry = ent >= mTree->GetEntries();
74 LOG(info) <<
"no entry to read, publishing empty output";
78 LOG(info) <<
"ZDCRecoReader pushed " << RecBC.size() <<
" b.c. " << Energy.size() <<
" Energies " << TDCData.size() <<
" TDCs " << Info.size() <<
" Infos " << WaveformData.size() <<
" Waveform chunks";
85 if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
93 std::vector<OutputSpec> outputs;
94 outputs.emplace_back(
"ZDC",
"BCREC", 0, Lifetime::Timeframe);
95 outputs.emplace_back(
"ZDC",
"ENERGY", 0, Lifetime::Timeframe);
96 outputs.emplace_back(
"ZDC",
"TDCDATA", 0, Lifetime::Timeframe);
97 outputs.emplace_back(
"ZDC",
"INFO", 0, Lifetime::Timeframe);
98 outputs.emplace_back(
"ZDC",
"WAVE", 0, Lifetime::Timeframe);
106 {
"zdc-reco-infile", VariantType::String,
"zdcreco.root", {
"Name of the input file"}},
107 {
"enable-waveform", VariantType::Bool,
false, {
"Read waveform data"}},
108 {
"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.
char error[CURL_ERROR_SIZE]
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 ITS Vertex explicitly as messageable.
std::vector< InputSpec > Inputs
struct o2::upgrades_utils::@482 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"