39 mFirstEntry = ic.
options().
get<
int>(
"first-entry");
40 mLastEntry = ic.
options().
get<
int>(
"last-entry");
41 mFile.reset(TFile::Open(
filename.c_str()));
42 if (!mFile->IsOpen()) {
43 LOG(error) <<
"Cannot open the " <<
filename.c_str() <<
" file !";
44 throw std::runtime_error(
"cannot open input digits file");
46 mTree.reset((TTree*)mFile->Get(
"o2sim"));
48 LOG(error) <<
"Did not find o2sim tree in " <<
filename.c_str();
49 throw std::runtime_error(
"Did not fine o2sim file in ZDC digits tree");
56 std::vector<o2::zdc::OrbitData> zdcOrbitData, *zdcOrbitDataPtr = &zdcOrbitData;
57 std::vector<o2::zdc::BCData> zdcBCData, *zdcBCDataPtr = &zdcBCData;
58 std::vector<o2::zdc::ChannelData> zdcChData, *zdcChDataPtr = &zdcChData;
60 mTree->SetBranchAddress(
"ZDCDigitOrbit", &zdcOrbitDataPtr);
61 mTree->SetBranchAddress(
"ZDCDigitBC", &zdcBCDataPtr);
62 mTree->SetBranchAddress(
"ZDCDigitCh", &zdcChDataPtr);
65 mTree->SetBranchAddress(
"ZDCDigitLabels", &plabels);
68 auto ent = mTree->GetReadEntry() < 0 ? mTree->GetReadEntry() + mFirstEntry + 1 : mTree->GetReadEntry() + 1;
69 assert(ent < mTree->GetEntries());
71 LOG(info) <<
"ZDCDigitReader pushed " << zdcOrbitData.size() <<
" orbits with " << zdcBCData.size() <<
" bcs and " << zdcChData.size() <<
" digits";
78 uint64_t nextEntry = mTree->GetReadEntry() + 1;
79 if (nextEntry >= mTree->GetEntries() || (mLastEntry >= 0 && nextEntry > mLastEntry)) {
87 std::vector<OutputSpec> outputs;
88 outputs.emplace_back(
"ZDC",
"DIGITSBC", 0, Lifetime::Timeframe);
89 outputs.emplace_back(
"ZDC",
"DIGITSCH", 0, Lifetime::Timeframe);
90 outputs.emplace_back(
"ZDC",
"DIGITSPD", 0, Lifetime::Timeframe);
92 outputs.emplace_back(
"ZDC",
"DIGITSLBL", 0, Lifetime::Timeframe);
100 {
"zdc-digit-infile", VariantType::String,
"zdcdigits.root", {
"Name of the input file"}},
101 {
"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 a container to keep Monte Carlo truth external to simulation objects.
Definition of the Names Generator class.
Class to describe pedestal data accumulated over the orbit.
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(framework::ProcessingContext &pc) final
void init(framework::InitContext &ic) 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 getDigitReaderSpec(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"