CbmRoot
Loading...
Searching...
No Matches
CbmTaskTofClusterizer.h
Go to the documentation of this file.
1/* Copyright (C) 2023 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
5#ifndef CBMTASKTOFCLUSTERIZER_H
6#define CBMTASKTOFCLUSTERIZER_H 1
7
8// TOF Classes and includes
9// Input/Output
10class CbmEvent;
11class CbmDigiManager;
13
14#include "CbmMatch.h"
15#include "CbmTofDigi.h"
16#include "tof/Calibrate.h"
17#include "tof/Clusterizer.h"
18#include "tof/Hitfind.h"
19
20// ROOT Classes and includes
21#include "Math/Rotation3D.h"
22#include "Math/Vector3Dfwd.h"
23
24// FAIR classes and includes
25#include "FairTask.h"
26
27// ROOT Classes and includes
28class TClonesArray;
29
30// C++ Classes and includes
31#include <vector>
32
33class CbmTaskTofClusterizer : public FairTask {
34
35 public:
40
44 CbmTaskTofClusterizer(const char* name, int32_t verbose = 1, bool writeDataInOut = true);
48 virtual ~CbmTaskTofClusterizer();
49
53 virtual InitStatus Init();
54
58 virtual void SetParContainers(){};
59
63 virtual void Exec(Option_t* option);
64 virtual void ExecEvent(Option_t* option);
65
69 virtual void Finish();
70 virtual void Finish(double calMode);
71
73 void SetCalMode(int32_t /*iMode*/) {}
74 void SetDutId(int32_t /*Id*/) {}
75 void PosYMaxScal(double /*val*/) {}
76 void SetTotMax(double /*val*/) {}
77 void SetTotMin(double /*val*/) {}
78 void SetTotMean(double /*val*/) {}
79 void SetMaxTimeDist(double /*val*/) {}
80 void SetChannelDeadtime(double /*val*/) {}
81 void SetCalParFileName(TString /*CalParFileName*/) {}
82 double GetTotMean() { return 0.0; }
84 int GetNbHits() { return fiNbHits; }
85
86 void SwapChannelSides(bool bSwap) { fbSwapChannelSides = bSwap; }
87 void SetFileIndex(int32_t iIndex) { fiFileIndex = iIndex; }
88 void SetWriteDigisInOut(bool bDigis) { fbWriteDigisInOut = bDigis; }
89 void SetWriteHitsInOut(bool bHits) { fbWriteHitsInOut = bHits; }
90 void SetDeadStrips(int32_t iDet, uint32_t ival);
91
92 protected:
93 private:
94 int32_t iNbTs = 0;
95 int fiHitStart = 0;
97
98 std::vector<CbmTofDigi>* fBmonDigiVec = nullptr;
99
108
109 // Functions common for all clusters approximations
113 bool RegisterInputs();
117 bool RegisterOutputs();
118
122 bool BuildClusters();
123
127 bool InitAlgos();
128
129 // Hit finder algo
130 std::unique_ptr<cbm::algo::tof::Hitfind> fAlgo;
131
132 // Calibrator algo
133 std::unique_ptr<cbm::algo::tof::Calibrate> fCalibrate;
134
136
137 // Input variables
138 std::vector<CbmTofDigi> fTofDigiVec{};
139 CbmDigiManager* fDigiMan; // TOF Input Digis
140 TClonesArray* fEventsColl; // CBMEvents (time based)
141
142 // Output variables
145 std::vector<CbmTofDigi>* fTofCalDigiVec = nullptr;
146 TClonesArray* fTofHitsColl; // TOF hits
147 TClonesArray* fTofDigiMatchColl; // TOF Digi Links
148 std::vector<CbmTofDigi>* fTofCalDigiVecOut = nullptr;
149 TClonesArray* fTofHitsCollOut; // TOF hits
150 TClonesArray* fTofDigiMatchCollOut; // TOF Digi Links
151 int32_t fiNbHits; // Index of the CbmTofHit TClonesArray
152
153 double fdEvent;
154 double fProcessTime = 0.0;
155 uint64_t fuNbDigis = 0;
156 uint64_t fuNbHits = 0;
157
160 int32_t fiFileIndex;
161
163};
164
165#endif // CBMTASKTOFCLUSTERIZER_H
CbmDigiManager.
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34
void SetWriteHitsInOut(bool bHits)
std::unique_ptr< cbm::algo::tof::Calibrate > fCalibrate
CbmTaskTofClusterizer & operator=(const CbmTaskTofClusterizer &)
Copy operator.
virtual void ExecEvent(Option_t *option)
bool RegisterOutputs()
Create and register output TClonesArray of Tof Hits.
std::vector< CbmTofDigi > fTofDigiVec
bool InitAlgos()
Create one algo object for each RPC.
const CbmTsEventHeader * fTsHeader
bool BuildClusters()
Build clusters out of ToF Digis and store the resulting info in a TofHit.
TClonesArray * fTofHitsCollOut
// Calibrated TOF Digis
void SetWriteDigisInOut(bool bDigis)
TClonesArray * fTofHitsColl
// Calibrated TOF Digis
std::vector< CbmTofDigi > * fBmonDigiVec
bool RegisterInputs()
Recover pointer on input TClonesArray: TofPoints, TofDigis...
void SwapChannelSides(bool bSwap)
std::vector< CbmTofDigi > * fTofCalDigiVecOut
virtual void Exec(Option_t *option)
Inherited from FairTask.
virtual InitStatus Init()
Inherited from FairTask.
virtual void Finish()
Inherited from FairTask.
virtual void SetParContainers()
Inherited from FairTask.
void SetFileIndex(int32_t iIndex)
CbmTaskTofClusterizer(const CbmTaskTofClusterizer &)
Bmon Digis.
CbmDigiManager * fDigiMan
TOF Digis.
std::vector< CbmTofDigi > * fTofCalDigiVec
virtual ~CbmTaskTofClusterizer()
Destructor.
ClassDef(CbmTaskTofClusterizer, 1)
void SetDeadStrips(int32_t iDet, uint32_t ival)
std::unique_ptr< cbm::algo::tof::Hitfind > fAlgo