33 ic.
options().
get<std::string>(
"track-infile"));
35 connectTree(mFileName);
40 auto ent = mTree->GetReadEntry() + 1;
41 assert(ent < mTree->GetEntries());
43 LOG(info) <<
"Pushing " << mTracks.size() <<
" tracks and " << mTrigRec.size() <<
" trigger records at entry " << ent;
45 if (mLabelsTrd.size() != mLabelsMatch.size()) {
46 LOG(error) <<
"The number of labels for matches and for TRD tracks is different. " << mLabelsTrd.size() <<
" TRD labels vs. " << mLabelsMatch.size() <<
" match labels";
48 LOG(info) <<
"Pushing " << mLabelsTrd.size() <<
" MC labels at entry " << ent;
68 if (mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
74void TRDTrackReader::connectTree(
const std::string&
filename)
77 mFile.reset(TFile::Open(
filename.c_str()));
78 assert(mFile && !mFile->IsZombie());
79 mTree.reset((TTree*)mFile->Get(
"tracksTRD"));
81 mTree->SetBranchAddress(
"tracks", &mTracksPtr);
82 mTree->SetBranchAddress(
"trgrec", &mTrigRecPtr);
84 mTree->SetBranchAddress(
"labels", &mLabelsMatchPtr);
85 mTree->SetBranchAddress(
"labelsTRD", &mLabelsTrdPtr);
87 LOG(info) <<
"Loaded tree from " <<
filename <<
" with " << mTree->GetEntries() <<
" entries";
92 std::vector<OutputSpec> outputs;
102 "tpctrd-track-reader",
107 {
"track-infile", VariantType::String,
"trdmatches_tpc.root", {
"Name of the input file for TPC-TRD matches"}},
108 {
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
113 std::vector<OutputSpec> outputs;
122 "itstpctrd-track-reader",
127 {
"track-infile", VariantType::String,
"trdmatches_itstpc.root", {
"Name of the input file for ITS-TPC-TRD matches"}},
128 {
"input-dir", VariantType::String,
"none", {
"Input directory"}}}};
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Defintions for the inter-detector matching type.
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.
void run(ProcessingContext &pc) final
void init(InitContext &ic) final
constexpr o2::header::DataOrigin gDataOriginTRD
std::vector< ConfigParamSpec > Options
std::vector< InputSpec > Inputs
framework::DataProcessorSpec getTRDTPCTrackReaderSpec(bool useMC, bool subSpecStrict=false)
read TPC-TRD matched tracks from a root file
framework::DataProcessorSpec getTRDGlobalTrackReaderSpec(bool useMC)
read ITS-TPC-TRD matched tracks from a root file
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"