CbmRoot
Loading...
Searching...
No Matches
CbmTaskInspectRecoTimeslice.cxx
Go to the documentation of this file.
1/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
11
12#include "FairRootManager.h"
13
14#include <type_traits>
15
16// ---------------------------------------------------------------------------------------------------------------------
17//
18CbmTaskInspectRecoTimeslice::CbmTaskInspectRecoTimeslice() : FairTask("InspectOnlineRecoTimeslice") {}
19
20
21// ---------------------------------------------------------------------------------------------------------------------
22//
24{
25 LOG(info) << GetName() << ": timeslice " << fNumTs << " with " << fBmonHits->NElements() << " BMON hits, "
26 << fStsHits->NElements() << " STS hits, " << fTrdHits->NElements() << " TRD hits, " << fTofHits->NElements()
27 << " TOF hits, " << fTracks->size() << " tracks";
28
29 ++fNumTs;
30}
31
32
33// ---------------------------------------------------------------------------------------------------------------------
34//
36{
37 LOG(info) << "=====================================";
38 LOG(info) << GetName() << ": Run summary";
39 LOG(info) << "Timeslices : " << fNumTs;
40 LOG(info) << "=====================================";
41}
42
43
44// ---------------------------------------------------------------------------------------------------------------------
45//
47{
48 auto* ioman = FairRootManager::Instance();
49 if (!ioman) {
50 LOG(fatal) << "CbmSourceRecoTimeslice::Init(): FairRootManager is not defined";
51 return kFATAL;
52 }
53
54 LOG(info) << "==================================================";
55 LOG(info) << GetName() << ": Initialising...";
56
57 auto InitBranch = [&](const auto*& vec, const char* name) -> bool {
58 using VecPtr_t = std::remove_reference_t<decltype(vec)>;
59 vec = ioman->InitObjectAs<VecPtr_t>(name);
60 if (!vec) {
61 LOG(error) << GetName() << ": branch " << name << " not found";
62 return false;
63 }
64 LOG(info) << GetName() << ": found branch " << name << " at " << vec;
65 return true;
66 };
67
68 InitBranch(fBmonHits, "OnlineBmonHit");
69 InitBranch(fStsHits, "OnlineStsHit");
70 InitBranch(fTrdHits, "OnlineTrdHit");
71 InitBranch(fTofHits, "OnlineTofHit");
72 InitBranch(fTracks, "OnlineTrack");
73 InitBranch(fTrackStsHitIndices, "OnlineTrackStsHitIndex");
74 InitBranch(fTrackTrdHitIndices, "OnlineTrackTrdHitIndex");
75 InitBranch(fTrackTofHitIndices, "OnlineTrackTofHitIndex");
76
77 return kSUCCESS;
78}
A task to store reconstructed data into a ROOT tree.
const cbm::algo::ca::Vector< cbm::algo::ca::Track > * fTracks
const cbm::PartitionedVector< cbm::algo::tof::Hit > * fTofHits
virtual void Exec(Option_t *opt)
Action on the timeslice.
virtual InitStatus Init()
Action in the beginning of the run.
const cbm::PartitionedVector< cbm::algo::sts::Hit > * fStsHits
const cbm::PartitionedVector< cbm::algo::trd::Hit > * fTrdHits
virtual void Finish()
Action in the end of the run.
const cbm::algo::StorableRecoResults::TrackHitIndexContainer_t * fTrackStsHitIndices
const cbm::algo::StorableRecoResults::TrackHitIndexContainer_t * fTrackTofHitIndices
const cbm::algo::StorableRecoResults::TrackHitIndexContainer_t * fTrackTrdHitIndices
const cbm::PartitionedVector< cbm::algo::bmon::Hit > * fBmonHits