CbmRoot
Loading...
Searching...
No Matches
CbmTaskTofHitFinder.h
Go to the documentation of this file.
1/* Copyright (C) 2022 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Dominik Smith [committer], Pierre-Alain Loizeau, Norbert Herrmann */
4
10#ifndef CBMTOFHITFINDER_H
11#define CBMTOFHITFINDER_H 1
12
13// TOF Classes and includes
14// Input/Output
15class CbmTofDigi;
16class CbmMatch;
17// Geometry
20class CbmTofDigiPar;
22class CbmTofCell;
23class CbmDigiManager;
24class CbmEvent;
25
26#include "tof/HitFinder.h"
27
28// FAIR classes and includes
29#include "FairTask.h"
30
31// ROOT Classes and includes
32class TClonesArray;
33#include "TStopwatch.h"
34#include "TTimeStamp.h"
35
36// C++ Classes and includes
37#include <vector>
38
39class CbmTaskTofHitFinder : public FairTask {
40 public:
45
49 CbmTaskTofHitFinder(const char* name, int32_t verbose = 1);
53 virtual ~CbmTaskTofHitFinder();
54
58 virtual InitStatus Init();
59
63 virtual void SetParContainers();
64
68 virtual void Exec(Option_t* option);
69
73 virtual void Finish();
74
75 protected:
76 private:
85
86 // Functions common for all clusters approximations
90 bool RegisterInputs();
94 bool RegisterOutputs();
98 bool InitParameters();
102 bool InitCalibParameter();
103
107 bool InitAlgos();
108
112 std::pair<int32_t, int32_t> BuildClusters(CbmEvent* event);
113
117 void GetEventInfo(int32_t& inputNr, int32_t& eventNr, double& eventTime);
118
119 // ToF geometry variables
124
125 // Input variables
127 TClonesArray* fEvents = nullptr;
128
129 // Output variables
130 TClonesArray* fTofHitsColl = nullptr; // TOF hits
131 TClonesArray* fTofDigiMatchColl = nullptr; // TOF Digis
132
133 // Hit finder algo
134 std::map<uint32_t, std::map<uint32_t, cbm::algo::tof::HitFinder>> fAlgo = {}; //[nbType][nbSm*nbRpc]
135
136 // Intermediate storage variables
137 std::vector<std::vector<std::vector<CbmTofDigi>>> fStorDigiExp; //[nbType][nbSm*nbRpc][nbCh][nDigis]
138 std::vector<std::vector<std::vector<int32_t>>> fStorDigiInd; //[nbType][nbSm*nbRpc][nbCh][nDigis]
139
140 //Calibration parameters
141 std::vector<std::vector<double>> fvCPSigPropSpeed; //[nSMT][nRpc]
142 std::vector<std::vector<std::vector<std::vector<double>>>> fvCPTOff; //[nSMT][nRpc][nCh][nbSide]
143 std::vector<std::vector<std::vector<std::vector<double>>>> fvCPTotGain; //[nSMT][nRpc][nCh][nbSide]
144 std::vector<std::vector<std::vector<std::vector<std::vector<double>>>>>
145 fvCPWalk; //[nSMT][nRpc][nCh][nbSide][nbWalkBins]
146
147 // Control
148 TTimeStamp fStart;
149 TTimeStamp fStop;
150
151 // --- Run counters
152 TStopwatch fTimer;
153 int32_t fiNofTs = 0;
154 int32_t fiNofEvents = 0;
155 double fNofDigisAll = 0.;
156 double fNofDigisUsed = 0.;
157 double fdNofHitsTot = 0.;
158 double fdTimeTot = 0.;
159
161};
162
163#endif // CBMTOFHITFINDER_H
CbmDigiManager.
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34
Simple Cluster building and hit producing for CBM ToF using Digis as input.
bool InitCalibParameter()
Initialize other parameters not included in parameter classes.
CbmTofDigiBdfPar * fDigiBdfPar
CbmTaskTofHitFinder(const CbmTaskTofHitFinder &)
Copy constructor.
bool InitAlgos()
Create one algo object for each RPC.
std::vector< std::vector< std::vector< std::vector< double > > > > fvCPTotGain
CbmTaskTofHitFinder & operator=(const CbmTaskTofHitFinder &)
Copy operator.
std::vector< std::vector< std::vector< CbmTofDigi > > > fStorDigiExp
CbmDigiManager * fDigiMan
double fNofDigisAll
Total number of TOF digis in input.
TStopwatch fTimer
ROOT timer.
ClassDef(CbmTaskTofHitFinder, 1)
bool RegisterInputs()
Recover pointer on input TClonesArray: TofPoints, TofDigis...
bool RegisterOutputs()
Create and register output TClonesArray of Tof Hits.
std::vector< std::vector< std::vector< int32_t > > > fStorDigiInd
double fdNofHitsTot
Total number of hits produced.
virtual void Finish()
Inherited from FairTask.
bool InitParameters()
Initialize other parameters not included in parameter classes.
std::vector< std::vector< std::vector< std::vector< std::vector< double > > > > > fvCPWalk
double fNofDigisUsed
Total number of Tof Digis processed.
void GetEventInfo(int32_t &inputNr, int32_t &eventNr, double &eventTime)
Retrieve event info from run manager to properly fill the CbmLink objects.
int32_t fiNofTs
Number of processed timeslices.
int32_t fiNofEvents
Total number of events processed.
CbmTaskTofHitFinder()
Constructor.
virtual InitStatus Init()
Inherited from FairTask.
std::map< uint32_t, std::map< uint32_t, cbm::algo::tof::HitFinder > > fAlgo
TClonesArray * fTofDigiMatchColl
std::vector< std::vector< double > > fvCPSigPropSpeed
std::vector< std::vector< std::vector< std::vector< double > > > > fvCPTOff
double fdTimeTot
Total execution time.
virtual void SetParContainers()
Inherited from FairTask.
std::pair< int32_t, int32_t > BuildClusters(CbmEvent *event)
Build clusters out of ToF Digis and store the resulting info in a TofHit.
virtual ~CbmTaskTofHitFinder()
Destructor.
virtual void Exec(Option_t *option)
Inherited from FairTask.
CbmTofDetectorId * fTofId
CbmTofGeoHandler * fGeoHandler
Parameters class for the CBM ToF digitizer using beam data distributions.
Data class for expanded digital TOF information.
Definition CbmTofDigi.h:47