CbmRoot
Loading...
Searching...
No Matches
CbmRichMCbmHitProducer.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2024 UGiessen/JINR-LIT, Giessen/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Semen Lebedev [committer], Adrian Amatus Weber, Martin Beyer */
4
5#ifndef CBM_RICH_MCBM_HIT_PRODUCER
6#define CBM_RICH_MCBM_HIT_PRODUCER
7
8#include "CbmDigiManager.h" // for ROOTCLING
9#include "CbmRichRecGeoPar.h"
10#include "FairTask.h"
11
12class TClonesArray;
13class TVector3;
14class CbmEvent;
15class CbmRichDigi;
16class CbmRichMCbmDenoiseCnn;
17
19 public:
20 UInt_t fTrbId;
21 UInt_t fChannel;
22 Double_t fX;
23 Double_t fY;
24 Double_t fZ;
25};
26
27class CbmRichMCbmHitProducer : public FairTask {
28 public:
33
38
42 virtual void SetParContainers();
43
47 virtual InitStatus Init();
48
49
53 virtual void Exec(Option_t* option);
54
58 virtual void Finish();
59
60
64 void ProcessData(CbmEvent* event);
65
66
70 void ProcessDigi(CbmEvent* event, Int_t digiIndex);
71
72
76 void SetMappingFile(const std::string& mappingFile) { fMappingFile = mappingFile; }
77
78
82 void SetIcdFilenameBase(const std::string& icdFileBase) { fIcdFilenameBase = icdFileBase; }
83
84
88 void setToTLimits(double low, double high)
89 {
90 fToTLimitLow = low;
91 fToTLimitHigh = high;
92 }
93
94
98 void setToTLimitLow(double low) { fToTLimitLow = low; }
99
100
104 void setToTLimitHigh(double high) { fToTLimitHigh = high; }
105
106
110 void applyToTCut() { fDoToT = true; }
111
112
116 void applyICDCorrection(bool val = true) { fDoICD = val; }
117
118
122 void DoRestrictToAcc(bool val = true) { fRestrictToAcc = val; }
123
127 void DoRestrictToFullAcc(bool val = true) { fRestrictToFullAcc = val; }
128
129#if HAVE_ONNXRUNTIME
130 void applyDenoiseNN(bool val = true) { fUseDenoiseNN = val; }
131 void SetClassifierThreshold(float val) { fDenoiseCnnThreshold = val; }
132#endif
133
134 private:
135#if HAVE_ONNXRUNTIME
136 bool fUseDenoiseNN = true;
137 float fDenoiseCnnThreshold = 0.5;
138 std::unique_ptr<CbmRichMCbmDenoiseCnn> fDenoiseCnn = nullptr;
139 double fDenoiseCnnTime = 0.;
140#endif
141
143 TClonesArray* fRichHits; // RICH hits
144 TClonesArray* fCbmEvents = nullptr; // CbmEvent for time-based simulations
145 bool fDoToT = false;
146 bool fDoICD = false;
147 bool fRestrictToAcc = false;
148 bool fRestrictToFullAcc = false;
150 double fToTLimitLow = 0.;
151 double fToTLimitHigh = 1000.;
152
153 std::map<Int_t, CbmRichMCbmMappingData> fRichMapping;
154
155 double fTotalTime = 0.;
156 double fHitProducerTime = 0.;
157
158 Int_t fNofTs;
159
160 Int_t fNofDigis = 0;
161 Int_t fNofHits = 0;
162
163 Int_t fNofEvents = 0;
164 Int_t fTotalNofDigis = 0;
165 Int_t fTotalNofHits = 0;
166
167 Double_t fHitError;
168
169 std::string fMappingFile;
170
171 std::string fIcdFilenameBase = "";
172 std::array<Double_t, 2304> fICD_offset_read;
173
174 void InitMapping();
175
176 bool isInToT(const double ToT);
177
178 bool RestrictToAcc(TVector3& pos);
179 bool RestrictToAcc(Double_t x, Double_t y);
180
181 bool RestrictToFullAcc(TVector3& pos);
182 bool RestrictToFullAcc(Double_t x, Double_t y);
183
184 bool RestrictToAerogelAccDec2019(TVector3& pos);
185 bool RestrictToAerogelAccDec2019(Double_t x, Double_t y);
186
191 void AddHit(CbmEvent* event, TVector3& posHit, const CbmRichDigi* digi, Int_t index, Int_t PmtId);
192
196 void read_ICD(std::array<Double_t, 2304>& offsets, unsigned int iteration);
197
198
203
208
209 ClassDef(CbmRichMCbmHitProducer, 1)
210};
211
212#endif
RICH geometry parameters for the reconstruction. This class is used for convinient storing of the bas...
CbmDigiManager.
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34
void applyICDCorrection(bool val=true)
CbmRichMCbmHitProducer(const CbmRichMCbmHitProducer &)
Copy constructor.
virtual ~CbmRichMCbmHitProducer()
Destructor.
std::map< Int_t, CbmRichMCbmMappingData > fRichMapping
bool isInToT(const double ToT)
void read_ICD(std::array< Double_t, 2304 > &offsets, unsigned int iteration)
void ProcessDigi(CbmEvent *event, Int_t digiIndex)
void SetMappingFile(const std::string &mappingFile)
bool RestrictToAerogelAccDec2019(TVector3 &pos)
bool RestrictToFullAcc(TVector3 &pos)
void ProcessData(CbmEvent *event)
CbmRichMCbmHitProducer & operator=(const CbmRichMCbmHitProducer &)
Assignment operator.
void AddHit(CbmEvent *event, TVector3 &posHit, const CbmRichDigi *digi, Int_t index, Int_t PmtId)
Add hit to the output array (and) CbmEvent if it is not NULL.
void setToTLimits(double low, double high)
CbmRichMCbmHitProducer()
Default constructor.
virtual void SetParContainers()
Inherited from FairTask.
void SetIcdFilenameBase(const std::string &icdFileBase)
virtual void Finish()
Inherited from FairTask.
virtual InitStatus Init()
Inherited from FairTask.
std::array< Double_t, 2304 > fICD_offset_read
virtual void Exec(Option_t *option)
Inherited from FairTask.
void DoRestrictToAcc(bool val=true)
void DoRestrictToFullAcc(bool val=true)