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;
85 const bool noEntry = ent >= mTree->GetEntries();
87 LOG(info) <<
"no entry to read, publishing empty output";
92 static const std::vector<o2::fdd::Digit> noDigitsBC;
93 static const std::vector<o2::fdd::ChannelData> noDigitsCh;
94 static const std::vector<o2::fdd::DetTrigInput> noDigitsTrig;
95 const auto& digitsBCOut = noEntry ? noDigitsBC : *digitsBC;
96 const auto& digitsChOut = noEntry ? noDigitsCh : *digitsCh;
97 LOG(info) <<
"FDD DigitReader pushes " << digitsBCOut.size() <<
" digits";
107 std::vector<char> flatbuffer;
109 mcTruth.
restore_from(flatbuffer.data(), flatbuffer.size());
113 if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
121 std::vector<OutputSpec> outputSpec;
135 {
"fdd-digits-infile", VariantType::String,
"fdddigits.root", {
"Name of the input file"}},
136 {
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
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.