34 LOG(
debug) <<
"Init Cluster reader!";
36 ic.
options().
get<std::string>(
"tof-cluster-infile"));
37 connectTree(mFileName);
42 auto ent = mTree->GetReadEntry() + 1;
48 const bool noEntry = ent >= mTree->GetEntries();
50 LOG(info) <<
"no entry to read, publishing empty output";
54 LOG(
debug) <<
"Pushing " << mClustersPtr->size() <<
" TOF clusters at entry " << ent;
62 if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
68void ClusterReader::connectTree(
const std::string&
filename)
71 mFile.reset(TFile::Open(
filename.c_str()));
72 assert(mFile && !mFile->IsZombie());
73 mTree.reset((TTree*)mFile->Get(
"o2sim"));
75 mTree->SetBranchAddress(
"TOFCluster", &mClustersPtr);
77 if (mTree->GetBranch(
"TOFClusterMult")) {
78 mTree->SetBranchAddress(
"TOFClusterMult", &mClustersMultPtr);
84 mTree->SetBranchAddress(
"TOFClusterMCTruth", &mLabelsPtr);
86 LOG(
debug) <<
"Loaded tree from " <<
filename <<
" with " << mTree->GetEntries() <<
" entries";
91 std::vector<OutputSpec> outputs;
104 {
"tof-cluster-infile", VariantType::String,
"tofclusters.root", {
"Name of the input file"}},
105 {
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
Helper for geometry and GRP related CCDB requests.
Header of the General Run Parameters object.
Definition of the Names Generator class.
static GRPGeomHelper & instance()
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
constexpr o2::header::DataOrigin gDataOriginTOF
constexpr int LHCMaxBunches
Defining ITS Vertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
framework::DataProcessorSpec getClusterReaderSpec(bool useMC)
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"