CbmRoot
Loading...
Searching...
No Matches
CbmTaskInspectDigiTimeslice.cxx
Go to the documentation of this file.
1/* Copyright (C) 2022 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
6
7#include <FairRootManager.h>
8#include <Logger.h>
9
10
11// ----- Constructor -----------------------------------------------------
12CbmTaskInspectDigiTimeslice::CbmTaskInspectDigiTimeslice() : FairTask("InspectOnlineRawDigis") {}
13// ---------------------------------------------------------------------------
14
15
16// ----- Destructor ------------------------------------------------------
18// ---------------------------------------------------------------------------
19
20
21// ----- Execution -------------------------------------------------------
23{
24
25 // --- Inspect digi data
26 LOG(info) << GetName() << ": timeslice " << fNumTs << " with " << fBmonDigis->size() << " BMon digis "
27 << fStsDigis->size() << " STS digis " << fMuchDigis->size() << " MUCH digis " << fTrdDigis->size()
28 << " TRD digis " << fTofDigis->size() << " TOF digis " << fRichDigis->size() << " RICH digis ";
29
30 // --- Run statistics
31 fNumTs++;
32}
33// ----------------------------------------------------------------------------
34
35
36// ----- End-of-run action ------------------------------------------------
38{
39 LOG(info) << "=====================================";
40 LOG(info) << GetName() << ": Run summary";
41 LOG(info) << "Timeslices : " << fNumTs;
42 LOG(info) << "=====================================";
43}
44// ----------------------------------------------------------------------------
45
46
47// ----- Initialisation ---------------------------------------------------
48template<typename TVecobj>
49const std::vector<TVecobj>* CbmTaskInspectDigiTimeslice::InitInput(FairRootManager* ioman)
50{
51 const std::vector<TVecobj>* vec = ioman->InitObjectAs<const std::vector<TVecobj>*>(TVecobj::GetBranchName());
52 if (nullptr == vec) {
53 LOG(error) << GetName() << ": No input branch " << TVecobj::GetBranchName() << " !";
54 return nullptr;
55 }
56 LOG(info) << "--- Found branch " << TVecobj::GetBranchName() << " at " << vec;
57 return vec;
58}
59
61{
62 // --- Get FairRootManager instance
63 FairRootManager* ioman = FairRootManager::Instance();
64 assert(ioman);
65
66 LOG(info) << "==================================================";
67 LOG(info) << GetName() << ": Initialising...";
68
69 // --- Input data
70
72 if (!fBmonDigis) {
73 return kFATAL;
74 }
75
77 if (!fStsDigis) {
78 return kFATAL;
79 }
80
82 if (!fMuchDigis) {
83 return kFATAL;
84 }
85
87 if (!fTrdDigis) {
88 return kFATAL;
89 }
90
92 if (!fTofDigis) {
93 return kFATAL;
94 }
95
97 if (!fStsDigis) {
98 return kFATAL;
99 }
100
101 LOG(info) << "==================================================";
102 return kSUCCESS;
103}
104// ----------------------------------------------------------------------------
105
106
ClassImp(CbmConverterManager)
Demonstrator class to save online unpacked digis in an output ROOT tree.
const std::vector< CbmRichDigi > * fRichDigis
Input data (digis)
virtual void Finish()
Finish timeslice.
virtual void Exec(Option_t *opt)
Task execution.
const std::vector< TVecobj > * InitInput(FairRootManager *ioman)
const std::vector< CbmTofDigi > * fTofDigis
Input data (digis)
virtual InitStatus Init()
Task initialisation.
const std::vector< CbmStsDigi > * fStsDigis
Input data (digis)
const std::vector< CbmMuchDigi > * fMuchDigis
Input data (digis)
const std::vector< CbmTrdDigi > * fTrdDigis
Input data (digis)
const std::vector< CbmBmonDigi > * fBmonDigis