43 ic.
options().
get<std::string>(
"fdd-digits-infile"));
45 mFile.reset(TFile::Open(mInputFileName.c_str()));
46 if (!mFile->IsOpen()) {
47 LOG(error) <<
"Cannot open the " << mInputFileName.c_str() <<
" file !";
48 throw std::runtime_error(
"cannot open input digits file");
50 mTree.reset((TTree*)mFile->Get(
"o2sim"));
52 LOG(error) <<
"Did not find o2sim tree in " << mInputFileName.c_str();
53 throw std::runtime_error(
"Did not fine o2sim file in FDD digits tree");
59 std::vector<o2::fdd::Digit>* digitsBC =
nullptr;
60 std::vector<o2::fdd::ChannelData>* digitsCh =
nullptr;
61 std::vector<o2::fdd::DetTrigInput>* digitsTrig =
nullptr;
64 mTree->SetBranchAddress(mDigitBCBranchName.c_str(), &digitsBC);
65 mTree->SetBranchAddress(mDigitChBranchName.c_str(), &digitsCh);
66 if (mTree->GetBranch(mTriggerBranchName.c_str())) {
67 mTree->SetBranchAddress(mTriggerBranchName.c_str(), &digitsTrig);
71 if (mTree->GetBranch(mDigitMCTruthBranchName.c_str())) {
72 mTree->SetBranchAddress(mDigitMCTruthBranchName.c_str(), &mcTruthRootBuffer);
73 LOG(info) <<
"Will use MC-truth from " << mDigitMCTruthBranchName;
75 LOG(info) <<
"MC-truth is missing";
79 auto ent = mTree->GetReadEntry() + 1;
80 assert(ent < mTree->GetEntries());
83 LOG(info) <<
"FDD DigitReader pushes " << digitsBC->size() <<
" digits";
91 std::vector<char> flatbuffer;
94 mcTruth.
restore_from(flatbuffer.data(), flatbuffer.size());
97 if (mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
105 std::vector<OutputSpec> outputSpec;
119 {
"fdd-digits-infile", VariantType::String,
"fdddigits.root", {
"Name of the input file"}},
120 {
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
A special IO container - splitting a given vector to enable ROOT IO.
Definition of a container to keep Monte Carlo truth external to simulation objects.
Definition of the Names Generator class.
void run(ProcessingContext &pc) final
void init(InitContext &ic) final
DigitReader(bool useMC=true)
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.
constexpr o2::header::DataOrigin gDataOriginFDD
framework::DataProcessorSpec getFDDDigitReaderSpec(bool useMC)
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
struct o2::upgrades_utils::@459 fdd
Collision labels.
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"