18#include "fairlogger/Logger.h"
38void TRDDigitReaderSpec::connectTree()
40 mTreeDigits.reset(
nullptr);
41 mFile.reset(TFile::Open(mFileName.c_str()));
42 assert(mFile && !mFile->IsZombie());
43 mTreeDigits.reset((TTree*)mFile->Get(mDigitTreeName.c_str()));
45 mTreeDigits->SetBranchAddress(mDigitBranchName.c_str(), &mDigitsPtr);
46 if (mUseTriggerRecords) {
47 mTreeDigits->SetBranchAddress(mTriggerRecordBranchName.c_str(), &mTriggerRecordsPtr);
50 mTreeDigits->SetBranchAddress(mMCLabelsBranchName.c_str(), &mLabels);
52 LOG(info) <<
"Loaded tree from " << mFileName <<
" with " << mTreeDigits->GetEntries() <<
" entries";
57 auto currEntry = mTreeDigits->GetReadEntry() + 1;
58 assert(currEntry < mTreeDigits->GetEntries());
59 mTreeDigits->GetEntry(currEntry);
60 LOGP(info,
"Pushing {} digits for tree entry {}", mDigits.size(), currEntry);
62 if (mUseTriggerRecords) {
63 LOGP(info,
"Pushing {} trigger records for tree entry {}", mTriggerRecords.size(), currEntry);
70 if (mTreeDigits->GetReadEntry() + 1 >= mTreeDigits->GetEntries()) {
78 std::vector<OutputSpec> outputs;
79 outputs.emplace_back(
"TRD",
"DIGITS", dataSubspec, Lifetime::Timeframe);
81 outputs.emplace_back(
"TRD",
"TRKTRGRD", dataSubspec, Lifetime::Timeframe);
84 outputs.emplace_back(
"TRD",
"LABELS", 0, Lifetime::Timeframe);
89 AlgorithmSpec{adaptFromTask<TRDDigitReaderSpec>(useMC, trigRec, dataSubspec)},
91 {
"digitsfile", VariantType::String,
"trddigits.root", {
"Input data file containing TRD digits"}},
92 {
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
A const (ready only) version of MCTruthContainer.
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
decltype(auto) make(const Output &spec, Args... args)
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(o2::framework::InitContext &ic) override
void run(o2::framework::ProcessingContext &pc) override
constexpr o2::header::DataOrigin gDataOriginTRD
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
o2::framework::DataProcessorSpec getTRDDigitReaderSpec(bool useMC, bool trigRec=true, int dataSubspec=1)
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"