27namespace globaltracking
32 ic.
options().
get<std::string>(
"cosmics-full-infile"));
33 connectTree(mFileName);
38 auto ent = mTree->GetReadEntry() + 1;
40 const bool noEntry = ent >= mTree->GetEntries();
42 LOG(info) <<
"no entry to read, publishing empty output";
49 LOG(info) <<
"Pushing " << mCosmics.size() <<
" cosmics with clusters at entry " << ent;
55 if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
61void TrackCosmicsExtendedReader::connectTree(
const std::string&
filename)
64 mFile.reset(TFile::Open(
filename.c_str()));
65 if (!mFile || mFile->IsZombie()) {
66 LOGP(fatal,
"Failed to open {}",
filename);
68 mTree.reset((TTree*)mFile->Get(
"cosmicsFull"));
70 LOGP(fatal,
"Tree cosmicsFull is not found in {}",
filename);
72 mTree->SetBranchAddress(
"cosmics", &mCosmicsPtr);
73 mTree->SetBranchAddress(
"tfInfo", &mTFInfoPtr);
74 mTree->SetBranchAddress(
"tfID", &mTFIDPtr);
75 LOG(info) <<
"Loaded tree from " <<
filename <<
" with " << mTree->GetEntries() <<
" entries";
80 std::vector<OutputSpec> outputs;
81 outputs.emplace_back(
"GLO",
"COSMFULL", 0, Lifetime::Timeframe);
82 outputs.emplace_back(
"GLO",
"COSMFULLTF", 0, Lifetime::Timeframe);
83 outputs.emplace_back(
"GLO",
"COSMFULLTFID", 0, Lifetime::Timeframe);
91 {
"cosmics-full-infile", VariantType::String,
"o2_cosmics_full.root", {
"Name of the input file"}},
92 {
"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 init(InitContext &ic) final
void run(ProcessingContext &pc) final
Defining ITS Vertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
framework::DataProcessorSpec getTrackCosmicsExtendedReaderSpec()
create a processor spec to read the extended cosmics (as written by cosmics-full-writer) from a root ...
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"