34 LOG(warning) <<
"FT0 RecPoint reader at the moment does not process MC";
42 connectTree(mInputFileName);
47 auto ent = mTree->GetReadEntry() + 1;
53 const bool noEntry = ent >= mTree->GetEntries();
55 LOG(info) <<
"no entry to read, publishing empty output";
60 static const std::vector<o2::ft0::RecPoints> noRecPoints;
61 static const std::vector<o2::ft0::ChannelDataFloat> noChannelData;
62 const auto& recPoints = noEntry ? noRecPoints : *mRecPoints;
63 const auto& channelData = noEntry ? noChannelData : *mChannelData;
64 LOG(
debug) <<
"FT0 RecPointReader pushes " << recPoints.size() <<
" recpoints with " << channelData.size() <<
" channels at entry " << ent;
68 if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
74void RecPointReader::connectTree(
const std::string&
filename)
77 mFile.reset(TFile::Open(
filename.c_str()));
78 assert(mFile && !mFile->IsZombie());
79 mTree.reset((TTree*)mFile->Get(mRecPointTreeName.c_str()));
82 mTree->SetBranchAddress(mRecPointBranchName.c_str(), &mRecPoints);
83 mTree->SetBranchAddress(mChannelDataBranchName.c_str(), &mChannelData);
85 LOG(warning) <<
"MC-truth is not supported for FT0 recpoints currently";
89 LOG(info) <<
"Loaded FT0 RecPoints tree from " <<
filename <<
" with " << mTree->GetEntries() <<
" entries";
94 std::vector<OutputSpec> outputSpec;
98 LOG(warning) <<
"MC-truth is not supported for FT0 recpoints currently";
102 "ft0-recpoints-reader",
107 {
"infile", VariantType::String,
"o2reco_ft0.root", {
"Name of the input file"}},
108 {
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
Definition of the Names Generator class.
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(ProcessingContext &pc) final
void init(InitContext &ic) final
RecPointReader(bool useMC=false)
constexpr o2::header::DataOrigin gDataOriginFT0
Defining ITS Vertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
framework::DataProcessorSpec getRecPointReaderSpec(bool useMC)
struct o2::upgrades_utils::@477 ft0
structure to keep V0C information
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"