CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2019CheckPulser.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
5#ifndef CBMMCBM2019CHECKPULSER_H
6#define CBMMCBM2019CHECKPULSER_H
7
9#include "CbmDefs.h"
10#include "CbmTofDigi.h"
11
12#include "TimesliceMetaData.h"
13
15#include "FairTask.h"
16
18#include "TString.h"
19
21#include <vector>
22
23class TClonesArray;
24class TH1;
25class TH2;
26class TProfile;
27class CbmDigiManager;
28
29class CbmMcbm2019CheckPulser : public FairTask {
30public:
32
35
37 // CbmMcbm2019CheckPulser(Int_t verbose);
38
39
42
43
45 virtual InitStatus Init();
46
48 virtual InitStatus ReInit();
49
50
52 virtual void Exec(Option_t*);
53
55 virtual void SetParContainers();
56
58 virtual void Finish();
59
60 void SetOffsetSearchRange(Int_t val = 1000) { fOffsetRange = val; }
61
62 void SetStsOffsetSearchRange(Int_t val = 1000) { fStsOffsetRange = val; }
63
64 void SetMuchOffsetSearchRange(Int_t val = 1000) { fMuchOffsetRange = val; }
65
66 void SetTrdOffsetSearchRange(Int_t val = 1000) { fTrdOffsetRange = val; }
67
68 void SetTofOffsetSearchRange(Int_t val = 1000) { fTofOffsetRange = val; }
69
70 void SetRichOffsetSearchRange(Int_t val = 1000) { fRichOffsetRange = val; }
71
72 void SetPsdOffsetSearchRange(Int_t val = 1000) { fPsdOffsetRange = val; }
73
74 inline void SetBmonPulserTotLimits(UInt_t uMin, UInt_t uMax)
75 {
76 fuMinTotPulserBmon = uMin;
77 fuMaxTotPulserBmon = uMax;
78 }
79 inline void SetStsPulserAdcLimits(UInt_t uMin, UInt_t uMax)
80 {
81 fuMinAdcPulserSts = uMin;
82 fuMaxAdcPulserSts = uMax;
83 }
84 inline void SetMuchPulserAdcLimits(UInt_t uMin, UInt_t uMax)
85 {
86 fuMinAdcPulserMuch = uMin;
87 fuMaxAdcPulserMuch = uMax;
88 }
89 inline void SetTrdPulserChargeLimits(UInt_t uMin, UInt_t uMax)
90 {
93 }
94 inline void SetTofPulserTotLimits(UInt_t uMin, UInt_t uMax)
95 {
96 fuMinTotPulserTof = uMin;
97 fuMaxTotPulserTof = uMax;
98 }
99 inline void SetRichPulserTotLimits(UInt_t uMin, UInt_t uMax)
100 {
101 fuMinTotPulserRich = uMin;
102 fuMaxTotPulserRich = uMax;
103 }
104 inline void SetPsdPulserAdcLimits(UInt_t uMin, UInt_t uMax)
105 {
106 fuMinAdcPulserPsd = uMin;
107 fuMaxAdcPulserPsd = uMax;
108 }
109
110 inline void SetOutFilename(TString sNameIn) { fOutFileName = sNameIn; }
111
112 inline void SetStsAddress(UInt_t uAddress) { fuStsAddress = uAddress; }
113 inline void SetMuchAsic(UInt_t uAsic) { fuMuchAsic = uAsic; }
114 inline void SetMuchChanRange(UInt_t uFirstChan, UInt_t uLastChan = kuNbChanSMX)
115 {
116 fuMuchFirstCha = uFirstChan;
117 fuMuchLastChan = uLastChan;
118 }
119 inline void SetTrdAddress(UInt_t uAddress) { fuTrdAddress = uAddress; }
120 inline void SetPsdAddress(UInt_t uAddress) { fuPsdAddress = uAddress; }
121
122private:
124 Int_t CheckIfSorted(TClonesArray*, TH1*, Double_t&, TString);
125
127
128 template<class Digi>
129 Int_t FillSystemOffsetHistos(TH1* histo, TH2* histoEvo, TH2* histoEvoLong, TProfile* profMeanEvo, TH2* histoAFCK,
130 const Double_t T0Time, const Int_t offsetRange, Int_t iStartDigi,
132
133 Int_t CalcNrBins(Int_t);
134 void CreateHistos();
135 void WriteHistos();
136
137
140 const std::vector<CbmTofDigi>* fBmonDigiVector = nullptr;
141 TClonesArray* fBmonDigiArray = nullptr;
142 TClonesArray* fTimeSliceMetaDataArray = nullptr;
144
146 static const UInt_t kuNbChanSMX = 128;
147 static const UInt_t kuMaxNbStsDpbs = 2;
148 static const UInt_t kuMaxNbMuchDpbs = 6;
149 static const UInt_t kuMaxNbMuchAsics = 36;
150 static const UInt_t kuDefaultAddress = 0xFFFFFFFF;
151 static const UInt_t kuMaxChannelSts = 3000;
152
154 Double_t fPrevTimeBmon = 0.;
155 Double_t fPrevTimeSts = 0.;
156 Double_t fPrevTimeMuch = 0.;
157 Double_t fPrevTimeTrd = 0.;
158 Double_t fPrevTimeTof = 0.;
159 Double_t fPrevTimeRich = 0.;
160 Double_t fPrevTimePsd = 0.;
161
170
173 UInt_t fuMinTotPulserBmon = 182;
174 UInt_t fuMaxTotPulserBmon = 190;
175 UInt_t fuMinAdcPulserSts = 90;
176 UInt_t fuMaxAdcPulserSts = 100;
180 UInt_t fuMaxChargePulserTrd = 70000;
181 UInt_t fuMinTotPulserTof = 182;
182 UInt_t fuMaxTotPulserTof = 190;
184 UInt_t fuMaxTotPulserRich = 105;
185 UInt_t fuMinAdcPulserPsd = 90;
186 UInt_t fuMaxAdcPulserPsd = 100;
196
197 //
198 Int_t fNrTs = 0;
199
200 Int_t fOffsetRange = 1000;
201 Int_t fStsOffsetRange = 1000;
202 Int_t fMuchOffsetRange = 1000;
203 Int_t fTrdOffsetRange = 1000;
204 Int_t fTofOffsetRange = 1000;
205 Int_t fRichOffsetRange = 1000;
206 Int_t fPsdOffsetRange = 1000;
207
208 Int_t fBinWidth = 1;
209
210 TH1* fBmonStsDiff = nullptr;
211 TH1* fBmonMuchDiff = nullptr;
212 TH1* fBmonTrdDiff = nullptr;
213 TH1* fBmonTofDiff = nullptr;
214 TH1* fBmonRichDiff = nullptr;
215 TH1* fBmonPsdDiff = nullptr;
216 TH2* fBmonPsdDiffCharge = nullptr;
217
218 TH2* fBmonStsDiffEvo = nullptr;
219 TH2* fBmonMuchDiffEvo = nullptr;
220 TH2* fBmonTrdDiffEvo = nullptr;
221 TH2* fBmonTofDiffEvo = nullptr;
222 TH2* fBmonRichDiffEvo = nullptr;
223 TH2* fBmonPsdDiffEvo = nullptr;
224
225 TH2* fBmonStsDiffEvoLong = nullptr;
226 TH2* fBmonMuchDiffEvoLong = nullptr;
227 TH2* fBmonTrdDiffEvoLong = nullptr;
228 TH2* fBmonTofDiffEvoLong = nullptr;
229 TH2* fBmonRichDiffEvoLong = nullptr;
230 TH2* fBmonPsdDiffEvoLong = nullptr;
231
232 Double_t fdStartTime = -1;
233 TProfile* fBmonStsMeanEvo = nullptr;
234 TProfile* fBmonMuchMeanEvo = nullptr;
235 TProfile* fBmonTrdMeanEvo = nullptr;
236 TProfile* fBmonTofMeanEvo = nullptr;
237 TProfile* fBmonRichMeanEvo = nullptr;
238 TProfile* fBmonPsdMeanEvo = nullptr;
239
240 TH1* fBmonBmonDiff = nullptr;
241 TH1* fStsStsDiff = nullptr;
242 TH1* fMuchMuchDiff = nullptr;
243 TH1* fTrdTrdDiff = nullptr;
244 TH1* fTofTofDiff = nullptr;
245 TH1* fRichRichDiff = nullptr;
246 TH1* fPsdPsdDiff = nullptr;
247
248 TH2* fBmonStsNb = nullptr;
249 TH2* fBmonMuchNb = nullptr;
250 TH2* fBmonTrdNb = nullptr;
251 TH2* fBmonTofNb = nullptr;
252 TH2* fBmonRichNb = nullptr;
253 TH2* fBmonPsdNb = nullptr;
254
255 Int_t fiBmonNb = 0;
256 Int_t fiStsNb = 0;
257 Int_t fiMuchNb = 0;
258 Int_t fiTrdNb = 0;
259 Int_t fiTofNb = 0;
260 Int_t fiRichNb = 0;
261 Int_t fiPsdNb = 0;
262
263 TH1* fBmonAddress = nullptr;
264 TH1* fBmonChannel = nullptr;
265
266 TH2* fBmonStsDpbDiff = nullptr;
269
270 TH2* fBmonMuchRocDiff = nullptr;
271 TH2* fBmonMuchAsicDiff = nullptr;
273
274 TH2* fDigisPerAsicEvo = nullptr;
277 TH2* fSameChanDigisDistEvo = nullptr;
278
280
281 TH2* fDigiTimeEvoBmon = nullptr;
282 TH2* fDigiTimeEvoSts = nullptr;
283 TH2* fDigiTimeEvoMuch = nullptr;
284 TH2* fDigiTimeEvoTof = nullptr;
285
286
287 TString fOutFileName {"data/HistosPulserChecker.root"};
288
290};
291
292#endif // CBMMCBM2019CHECKPULSER_H
ECbmModuleId
Definition CbmDefs.h:39
@ kLastModule
For loops over all modules.
CbmDigiManager.
static const UInt_t kuNbChanSMX
Constants.
const std::vector< CbmTofDigi > * fBmonDigiVector
void SetTrdPulserChargeLimits(UInt_t uMin, UInt_t uMax)
void SetMuchChanRange(UInt_t uFirstChan, UInt_t uLastChan=kuNbChanSMX)
void SetStsOffsetSearchRange(Int_t val=1000)
void SetPsdPulserAdcLimits(UInt_t uMin, UInt_t uMax)
CbmMcbm2019CheckPulser(const CbmMcbm2019CheckPulser &)=delete
const TimesliceMetaData * pTsMetaData
static const UInt_t kuMaxNbMuchDpbs
static const UInt_t kuMaxNbMuchAsics
static const UInt_t kuMaxChannelSts
TH1 * fStsDpbCntsEvo[kuMaxNbStsDpbs]
void SetBmonPulserTotLimits(UInt_t uMin, UInt_t uMax)
TH2 * fBmonStsDpbDiffEvo[kuMaxNbStsDpbs]
void SetTofOffsetSearchRange(Int_t val=1000)
Int_t FillSystemOffsetHistos(TH1 *histo, TH2 *histoEvo, TH2 *histoEvoLong, TProfile *profMeanEvo, TH2 *histoAFCK, const Double_t T0Time, const Int_t offsetRange, Int_t iStartDigi, ECbmModuleId iDetId=ECbmModuleId::kLastModule)
void SetPsdAddress(UInt_t uAddress)
static const UInt_t kuMaxNbStsDpbs
Double_t fdLastMuchDigiPulser[kuMaxNbMuchAsics][kuNbChanSMX]
Int_t CheckIfSorted(TClonesArray *, TH1 *, Double_t &, TString)
void SetMuchPulserAdcLimits(UInt_t uMin, UInt_t uMax)
UInt_t fuStsAddress
Channel selection.
void SetRichPulserTotLimits(UInt_t uMin, UInt_t uMax)
TH2 * fBmonMuchAsicDiffEvo[kuMaxNbMuchAsics]
static const UInt_t kuDefaultAddress
void SetOutFilename(TString sNameIn)
void SetPsdOffsetSearchRange(Int_t val=1000)
void SetRichOffsetSearchRange(Int_t val=1000)
Double_t fPrevTimeBmon
Variables to store the previous digi time.
void SetStsAddress(UInt_t uAddress)
Double_t fdLastMuchDigi[kuMaxNbMuchAsics][kuNbChanSMX]
ClassDef(CbmMcbm2019CheckPulser, 1)
void SetTofPulserTotLimits(UInt_t uMin, UInt_t uMax)
CbmMcbm2019CheckPulser operator=(const CbmMcbm2019CheckPulser &)=delete
virtual void Exec(Option_t *)
void SetStsPulserAdcLimits(UInt_t uMin, UInt_t uMax)
void SetTrdAddress(UInt_t uAddress)
void SetTrdOffsetSearchRange(Int_t val=1000)
void SetMuchOffsetSearchRange(Int_t val=1000)
void SetOffsetSearchRange(Int_t val=1000)