CbmRoot
Loading...
Searching...
No Matches
CbmTofSimpClusterizer.h
Go to the documentation of this file.
1/* Copyright (C) 2013-2020 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer], Norbert Herrmann */
4
15#ifndef CBMTOFSIMPCLUSTERIZER_H
16#define CBMTOFSIMPCLUSTERIZER_H 1
17
18// TOF Classes and includes
19// Input/Output
20//class CbmTofPoint;
21class CbmTofDigi;
22class CbmMatch;
23// Geometry
26class CbmTofDigiPar;
28class CbmTofCell;
29class CbmDigiManager;
30class CbmEvent;
31
32// FAIR classes and includes
33#include "FairTask.h"
34
35// ROOT Classes and includes
36class TClonesArray;
37class TFile;
38class TH1;
39class TH2;
40class TString;
41#include "TStopwatch.h"
42#include "TTimeStamp.h"
43
44// C++ Classes and includes
45#include <vector>
46
47class CbmTofSimpClusterizer : public FairTask {
48 public:
53
57 CbmTofSimpClusterizer(const char* name, Int_t verbose = 1);
61 virtual ~CbmTofSimpClusterizer();
62
66 virtual InitStatus Init();
67
71 virtual void SetParContainers();
72
76 virtual void Exec(Option_t* option);
77
81 virtual void Finish();
82
83 inline void SetCalMode(Int_t iMode) { fCalMode = iMode; }
84 inline void SetCalTrg(Int_t iTrg) { fCalTrg = iTrg; }
85 inline void SetCalSmType(Int_t iCalSmType) { fCalSmType = iCalSmType; }
86 inline void SetCaldXdYMax(Double_t dCaldXdYMax) { fdCaldXdYMax = dCaldXdYMax; }
87 inline void SetTRefId(Int_t Id) { fTRefMode = Id; }
88 inline void SetTRefDifMax(Double_t TRefMax) { fTRefDifMax = TRefMax; }
89 inline void SetdTRefMax(Double_t dTRefMax) { fdTRefMax = dTRefMax; }
90 inline void PosYMaxScal(Double_t PosYmaxScal) { fPosYMaxScal = PosYmaxScal; }
91 inline void SetTotMax(Double_t TOTMax) { fTotMax = TOTMax; }
92 inline void SetTotMin(Double_t TOTMin) { fTotMin = TOTMin; }
93 inline void SetOutTimeFactor(Double_t val) { fOutTimeFactor = val; }
94
95 inline void SetCalParFileName(TString CalParFileName) { fCalParFileName = CalParFileName; }
96 Bool_t SetHistoFileName(TString sFilenameIn = "./tofSimpClust.hst.root");
97
98 void UseMcTrackMonitoring(Bool_t bMcTrkMonitor = kTRUE) { fbMcTrkMonitor = bMcTrkMonitor; }
99
100 protected:
101 private:
110
111 // Functions common for all clusters approximations
115 Bool_t RegisterInputs();
119 Bool_t RegisterOutputs();
123 Bool_t InitParameters();
127 Bool_t InitCalibParameter();
131 Bool_t LoadGeometry();
135 Bool_t DeleteGeometry();
136
137 // Histogramming functions
138 Bool_t CreateHistos();
139 Bool_t FillHistos();
140 Bool_t WriteHistos();
141 Bool_t DeleteHistos();
142
146 std::pair<Int_t, Int_t> BuildClusters(CbmEvent* event);
147
151 void GetEventInfo(Int_t& inputNr, Int_t& eventNr, Double_t& eventTime);
152
153 // ToF geometry variables
161
162 // Input variables
163 TClonesArray* fTofPointsColl; // TOF MC points
164 TClonesArray* fMcTracksColl; // MC tracks
166 TClonesArray* fEvents = nullptr;
167
168 // Output variables
169 TClonesArray* fTofHitsColl; // TOF hits
170 TClonesArray* fTofDigiMatchColl; // TOF Digis
171 Int_t fiNbHits; // Index of the CbmTofHit TClonesArray
172
173 // Generic
174 Int_t fVerbose;
175
176 // Intermediate storage variables
177 std::vector<std::vector<std::vector<std::vector<CbmTofDigi*>>>> fStorDigiExp; //[nbType][nbSm*nbRpc][nbCh][nDigis]
178 std::vector<std::vector<std::vector<std::vector<Int_t>>>> fStorDigiInd; //[nbType][nbSm*nbRpc][nbCh][nDigis]
179 /*
180 std::vector< std::vector< std::vector< std::vector< std::vector< CbmTofDigi* > > > > >
181 fStorDigi; //[nbType][nbSm][nbRpc][nbCh][nDigis]
182 std::vector< std::vector< std::vector< std::vector< std::vector< CbmTofDigiExp* > > > > >
183 fStorDigiExp; //[nbType][nbSm][nbRpc][nbCh][nDigis]
184 */
185 std::vector<std::vector<std::vector<Int_t>>> fviClusterMul; //[nbType][nbSm][nbRpc]
186 std::vector<std::vector<std::vector<Int_t>>> fviClusterSize; //[nbType][nbRpc][nClusters]
187 std::vector<std::vector<std::vector<Int_t>>> fviTrkMul; //[nbType][nbRpc][nClusters]
188 std::vector<std::vector<std::vector<Double_t>>> fvdX; //[nbType][nbRpc][nClusters]
189 std::vector<std::vector<std::vector<Double_t>>> fvdY; //[nbType][nbRpc][nClusters]
190 std::vector<std::vector<std::vector<Double_t>>> fvdDifX; //[nbType][nbRpc][nClusters]
191 std::vector<std::vector<std::vector<Double_t>>> fvdDifY; //[nbType][nbRpc][nClusters]
192 std::vector<std::vector<std::vector<Double_t>>> fvdDifCh; //[nbType][nbRpc][nClusters]
193
194 // Output file name and path
196 // Histograms
218
219 std::vector<TH2*> fhRpcDigiCor; //[nbDet]
220 std::vector<TH1*> fhRpcCluMul; //[nbDet]
221 std::vector<TH1*> fhRpcSigPropSpeed; //[nbDet]
222 std::vector<TH2*> fhRpcCluPosition; //[nbDet]
223 std::vector<TH2*> fhRpcCluTOff; //[nbDet]
224 std::vector<TH2*> fhRpcCluTrms; //[nbDet]
225 std::vector<TH2*> fhRpcCluTot; // [nbDet]
226 std::vector<TH2*> fhRpcCluSize; // [nbDet]
227 std::vector<TH2*> fhRpcCluAvWalk; // [nbDet]
228 std::vector<std::vector<std::vector<TH2*>>> fhRpcCluWalk; // [nbDet][nbCh][nSide]
229
230 std::vector<std::vector<TH1*>> fhTRpcCluMul; // [nbDet][nbTrg]
231 std::vector<std::vector<TH2*>> fhTRpcCluPosition; // [nbDet][nbTrg]
232 std::vector<std::vector<TH2*>> fhTRpcCluTOff; // [nbDet][nbTrg]
233 std::vector<std::vector<TH2*>> fhTRpcCluTot; // [nbDet][nbTrg]
234 std::vector<std::vector<TH2*>> fhTRpcCluSize; // [nbDet][nbTrg]
235 std::vector<std::vector<TH2*>> fhTRpcCluAvWalk; // [nbDet][nbTrg]
236 std::vector<std::vector<TH2*>> fhTRpcCluDelTof; // [nbDet][nbTrg]
237 std::vector<std::vector<TH2*>> fhTRpcCludXdY; // [nbDet][nbTrg]
238 std::vector<std::vector<std::vector<std::vector<TH2*>>>> fhTRpcCluWalk; // [nbDet][nbTrg][nbCh][nSide]
239
240 std::vector<TH1*> fhTrgdT; //[nbTrg]
241
242 std::vector<std::vector<Double_t>> fvCPSigPropSpeed; //[nSMT][nRpc]
243 std::vector<std::vector<std::vector<std::vector<Double_t>>>> fvCPDelTof; //[nSMT][nRpc][nbClDelTofBinX][nbTrg]
244 std::vector<std::vector<std::vector<std::vector<Double_t>>>> fvCPTOff; //[nSMT][nRpc][nCh][nbSide]
245 std::vector<std::vector<std::vector<std::vector<Double_t>>>> fvCPTotGain; //[nSMT][nRpc][nCh][nbSide]
246 std::vector<std::vector<std::vector<std::vector<std::vector<Double_t>>>>>
247 fvCPWalk; //[nSMT][nRpc][nCh][nbSide][nbWalkBins]
248
249 // Digis quality
253
254 // Control
255 TTimeStamp fStart;
256 TTimeStamp fStop;
257
258 // --- Run counters
259 TStopwatch fTimer;
260 Int_t fiNofTs = 0;
262 Double_t fNofDigisAll = 0;
263 Double_t fNofDigisUsed = 0;
264 Double_t fdNofHitsTot;
265 Double_t fdTimeTot;
266
267 // Calib
268 Double_t dTRef;
269 Double_t fdTRefMax;
270 Int_t fCalMode;
271 Int_t fCalTrg;
273 Double_t fdCaldXdYMax;
276 Double_t fPosYMaxScal;
277 Double_t fTRefDifMax;
278 Double_t fTotMax;
279 Double_t fTotMin;
281
282 TString fCalParFileName; // name of the file name with Calibration Parameters
283 TFile* fCalParFile; // pointer to Calibration Parameter file
284
286
288};
289
290#endif // CBMTOFSIMPCLUSTERIZER_H
Double_t TOTMax
Double_t TOTMin
CbmDigiManager.
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34
Parameters class for the CBM ToF digitizer using beam data distributions.
Data class for expanded digital TOF information.
Definition CbmTofDigi.h:47
Simple Cluster building and hit producing for CBM ToF using Digis as input.
ClassDef(CbmTofSimpClusterizer, 2)
void GetEventInfo(Int_t &inputNr, Int_t &eventNr, Double_t &eventTime)
Retrieve event info from run manager to properly fill the CbmLink objects.
Bool_t DeleteGeometry()
Delete the geometry related arrays: for now just clearing the Digis temporary vectors.
Bool_t InitCalibParameter()
Initialize other parameters not included in parameter classes.
void SetCalSmType(Int_t iCalSmType)
std::vector< std::vector< std::vector< Int_t > > > fviClusterSize
std::vector< std::vector< TH2 * > > fhTRpcCluDelTof
std::vector< std::vector< std::vector< std::vector< TH2 * > > > > fhTRpcCluWalk
void SetCalParFileName(TString CalParFileName)
Bool_t RegisterOutputs()
Create and register output TClonesArray of Tof Hits.
std::vector< std::vector< std::vector< std::vector< Int_t > > > > fStorDigiInd
std::vector< std::vector< TH2 * > > fhTRpcCludXdY
void PosYMaxScal(Double_t PosYmaxScal)
std::vector< std::vector< std::vector< std::vector< std::vector< Double_t > > > > > fvCPWalk
CbmTofDigiBdfPar * fDigiBdfPar
Double_t fdNofHitsTot
Total number of hits produced.
std::vector< std::vector< TH2 * > > fhTRpcCluPosition
std::vector< std::vector< Double_t > > fvCPSigPropSpeed
CbmTofSimpClusterizer(const CbmTofSimpClusterizer &)
Copy constructor.
std::vector< TH2 * > fhRpcCluPosition
std::vector< std::vector< std::vector< Double_t > > > fvdX
std::vector< TH2 * > fhRpcCluTrms
CbmTofSimpClusterizer & operator=(const CbmTofSimpClusterizer &)
Copy operator.
std::vector< TH2 * > fhRpcDigiCor
std::vector< TH2 * > fhRpcCluTOff
std::vector< std::vector< std::vector< Double_t > > > fvdDifCh
std::vector< TH1 * > fhTrgdT
Double_t fNofDigisUsed
Total number of Tof Digis processed.
Int_t fiNofEvents
Total number of events processed.
std::vector< TH2 * > fhRpcCluTot
std::vector< std::vector< std::vector< std::vector< Double_t > > > > fvCPDelTof
std::vector< std::vector< TH1 * > > fhTRpcCluMul
std::vector< TH2 * > fhRpcCluAvWalk
void SetCaldXdYMax(Double_t dCaldXdYMax)
std::vector< std::vector< std::vector< Double_t > > > fvdY
std::vector< TH1 * > fhRpcSigPropSpeed
std::vector< std::vector< std::vector< TH2 * > > > fhRpcCluWalk
Bool_t SetHistoFileName(TString sFilenameIn="./tofSimpClust.hst.root")
void SetOutTimeFactor(Double_t val)
std::pair< Int_t, Int_t > BuildClusters(CbmEvent *event)
Build clusters out of ToF Digis and store the resulting info in a TofHit.
std::vector< std::vector< std::vector< std::vector< Double_t > > > > fvCPTotGain
std::vector< std::vector< TH2 * > > fhTRpcCluTOff
virtual void SetParContainers()
Inherited from FairTask.
Bool_t RegisterInputs()
Recover pointer on input TClonesArray: TofPoints, TofDigis...
virtual ~CbmTofSimpClusterizer()
Destructor.
std::vector< std::vector< std::vector< std::vector< CbmTofDigi * > > > > fStorDigiExp
void SetdTRefMax(Double_t dTRefMax)
Bool_t LoadGeometry()
Load the geometry: for now just resizing the Digis temporary vectors.
Double_t fdTimeTot
Total execution time.
void SetTotMax(Double_t TOTMax)
Bool_t InitParameters()
Initialize other parameters not included in parameter classes.
std::vector< std::vector< TH2 * > > fhTRpcCluTot
std::vector< TH2 * > fhRpcCluSize
std::vector< std::vector< std::vector< Double_t > > > fvdDifX
CbmTofGeoHandler * fGeoHandler
std::vector< std::vector< std::vector< std::vector< Double_t > > > > fvCPTOff
Int_t fiNofTs
Number of processed timeslices.
virtual void Exec(Option_t *option)
Inherited from FairTask.
void SetTotMin(Double_t TOTMin)
std::vector< std::vector< TH2 * > > fhTRpcCluSize
virtual InitStatus Init()
Inherited from FairTask.
TStopwatch fTimer
ROOT timer.
std::vector< std::vector< std::vector< Int_t > > > fviTrkMul
virtual void Finish()
Inherited from FairTask.
void SetTRefDifMax(Double_t TRefMax)
std::vector< TH1 * > fhRpcCluMul
Double_t fNofDigisAll
Total number of TOF digis in input.
std::vector< std::vector< std::vector< Double_t > > > fvdDifY
std::vector< std::vector< TH2 * > > fhTRpcCluAvWalk
void UseMcTrackMonitoring(Bool_t bMcTrkMonitor=kTRUE)
std::vector< std::vector< std::vector< Int_t > > > fviClusterMul