26#include <fairlogger/Logger.h>
33namespace globaltracking
45 void connectTree(
const std::string&
filename);
47 std::unique_ptr<TFile> mFile;
48 std::unique_ptr<TTree> mTree;
49 std::string mFileName =
"";
50 std::vector<o2::dataformats::MatchInfoFwd> mTracks, *mTracksPtr = &mTracks;
51 std::vector<o2::MCCompLabel> mLabels, *mLabelsPtr = &mLabels;
57 ic.
options().
get<std::string>(
"mftmch-match-infile"));
58 connectTree(mFileName);
63 auto ent = mTree->GetReadEntry() + 1;
64 assert(ent < mTree->GetEntries());
66 LOG(info) <<
"Pushing " << mTracks.size() <<
" MFTMCH matches at entry " << ent;
70 if (mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
76void MatchMFTMCHReader::connectTree(
const std::string&
filename)
79 mFile.reset(TFile::Open(
filename.c_str()));
80 assert(mFile && !mFile->IsZombie());
81 mTree.reset((TTree*)mFile->Get(
"o2sim"));
83 mTree->SetBranchAddress(
"matches", &mTracksPtr);
84 LOG(info) <<
"Loaded tree from " <<
filename <<
" with " << mTree->GetEntries() <<
" entries";
89 std::vector<OutputSpec> outputs;
90 outputs.emplace_back(
"GLO",
"MTC_MFTMCH", 0, Lifetime::Timeframe);
93 "mftmch-matches-reader",
98 {
"mftmch-match-infile", VariantType::String,
"mftmchmatches.root", {
"Name of the input file"}},
99 {
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
Header of the General Run Parameters object.
Definition of the Names Generator class.
Type wrappers for enfording a specific serialization method.
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.
~MatchMFTMCHReader() override=default
MatchMFTMCHReader(bool useMC)
void run(ProcessingContext &pc) final
void init(InitContext &ic) final
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
framework::DataProcessorSpec getMFTMCHMatchedReaderSpec(bool useMC)
create a processor spec
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"