51 ic.
options().
get<std::string>((mDetNameLC +
"-cluster-infile").c_str()));
52 connectTree(mFileName);
58 auto ent = mTree->GetReadEntry() + 1;
59 assert(ent < mTree->GetEntries());
62 for (uint32_t iLayer = 0; iLayer < NLayers; ++iLayer) {
63 LOG(info) << mDetName <<
"ClusterReader:" << iLayer <<
" pushes " << mClusROFRec[iLayer]->size() <<
" ROFRecords, " << mClusterCompArray[iLayer]->size() <<
" compact clusters at entry " << ent;
75 std::vector<o2::itsmft::PhysTrigger> dummyTrig;
78 if (mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
88 mFile.reset(TFile::Open(
filename.c_str()));
89 assert(mFile && !mFile->IsZombie());
90 mTree.reset((TTree*)mFile->Get(mClusTreeName.c_str()));
93 for (uint32_t iLayer = 0; iLayer < NLayers; ++iLayer) {
94 setBranchAddress(mClusROFBranchName, mClusROFRec[iLayer], iLayer);
95 setBranchAddress(mClusterCompBranchName, mClusterCompArray[iLayer], iLayer);
97 setBranchAddress(mClusterPattBranchName, mPatternsArray[iLayer], iLayer);
100 if (mTree->GetBranch(getBranchName(mClustMCTruthBranchName, iLayer).c_str()) &&
101 mTree->GetBranch(getBranchName(mClustMC2ROFBranchName, iLayer).c_str())) {
102 setBranchAddress(mClustMCTruthBranchName, mClusterMCTruth[iLayer], iLayer);
103 setBranchAddress(mClustMC2ROFBranchName, mClusMC2ROFs[iLayer], iLayer);
105 LOG(info) <<
"MC-truth is missing";
110 LOG(info) <<
"Loaded tree from " <<
filename <<
" with " << mTree->GetEntries() <<
" entries";
119 return mDetName + base;
123template <
typename Ptr>
126 const auto name = getBranchName(base,
layer);
127 if (Int_t ret = mTree->SetBranchAddress(
name.c_str(), &addr); ret != 0) {
128 LOGP(fatal,
"failed to set branch address for {} ret={}",
name, ret);
135std::vector<OutputSpec> makeOutChannels(
o2::header::DataOrigin detOrig,
bool mctruth,
bool usePatterns,
bool triggerOut)
137 std::vector<OutputSpec> outputs;
139 outputs.emplace_back(detOrig,
"CLUSTERSROF", iLayer, Lifetime::Timeframe);
140 outputs.emplace_back(detOrig,
"COMPCLUSTERS", iLayer, Lifetime::Timeframe);
142 outputs.emplace_back(detOrig,
"PATTERNS", iLayer, Lifetime::Timeframe);
145 outputs.emplace_back(detOrig,
"CLUSTERSMCTR", iLayer, Lifetime::Timeframe);
146 outputs.emplace_back(detOrig,
"CLUSTERSMC2ROF", iLayer, Lifetime::Timeframe);
150 outputs.emplace_back(detOrig,
"PHYSTRIG", 0, Lifetime::Timeframe);
159 .
name =
"its-cluster-reader",
161 .outputs = makeOutChannels<o2::detectors::DetID::ITS>(
"ITS", useMC, usePatterns, triggerOut),
162 .algorithm =
AlgorithmSpec{adaptFromTask<ITSClusterReader>(useMC, usePatterns, triggerOut)},
164 {
"its-cluster-infile", VariantType::String,
"o2clus_its.root", {
"Name of the input cluster file"}},
165 {
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
171 .
name =
"mft-cluster-reader",
173 .outputs = makeOutChannels<o2::detectors::DetID::MFT>(
"MFT", useMC, usePatterns, triggerOut),
174 .algorithm =
AlgorithmSpec{adaptFromTask<MFTClusterReader>(useMC, usePatterns, triggerOut)},
176 {
"mft-cluster-infile", VariantType::String,
"mftclusters.root", {
"Name of the input cluster file"}},
177 {
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
Definition of the Names Generator class.
Definition Physics trigger record extracted from the ITS/MFT stream.
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.
void run(ProcessingContext &pc) final
std::string getBranchName(const std::string &base, int index) const
void connectTree(const std::string &filename)
std::array< std::vector< unsigned char > *, NLayers > mPatternsArray
void init(InitContext &ic) final
void setBranchAddress(const std::string &base, Ptr &addr, int layer)
std::array< std::vector< o2::itsmft::CompClusterExt > *, NLayers > mClusterCompArray
std::array< std::vector< o2::itsmft::MC2ROFRecord > *, NLayers > mClusMC2ROFs
std::array< std::vector< o2::itsmft::ROFRecord > *, NLayers > mClusROFRec
std::array< o2::dataformats::MCTruthContainer< o2::MCCompLabel > *, NLayers > mClusterMCTruth
GLsizei const GLchar *const * string
GLuint const GLchar * name
GLenum GLuint GLint GLint layer
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
framework::DataProcessorSpec getMFTClusterReaderSpec(bool useMC=true, bool usePatterns=true, bool useTriggers=true)
framework::DataProcessorSpec getITSClusterReaderSpec(bool useMC=true, bool usePatterns=true, bool useTriggers=true)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.
std::string to_string(gsl::span< T, Size > span)
static constexpr bool supportsStaggering() noexcept
static std::string rectifyDirectory(const std::string_view p)
static std::string concat_string(Ts const &... ts)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"