1 | #ifndef MARS_MCalibrationChargePix
|
---|
2 | #define MARS_MCalibrationChargePix
|
---|
3 |
|
---|
4 | #ifndef MARS_MParContainer
|
---|
5 | #include "MParContainer.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class MBadPixelsPix;
|
---|
9 | class MCalibrationChargePix : public MParContainer
|
---|
10 | {
|
---|
11 | private:
|
---|
12 |
|
---|
13 | static const Float_t gkConversionHiLo; // The default conversion factor HI gain - Lo Gain
|
---|
14 | static const Float_t gkConversionHiLoErr; // The error of the default conversion factor
|
---|
15 |
|
---|
16 | static const Float_t gkElectronicPedRms; // The pure electronic component of the RMS
|
---|
17 | static const Float_t gkElectronicPedRmsErr; // The error of the pure electronic component of the RMS
|
---|
18 | static const Float_t gkFFactor; // The laboratory F-factor of the PMTs
|
---|
19 | static const Float_t gkFFactorErr; // The laboratory F-factor Error of the PMTs
|
---|
20 |
|
---|
21 | static const Float_t fgChargeLimit; // The default limit (in units of PedRMS) for acceptance of the fitted mean charge
|
---|
22 | static const Float_t fgChargeErrLimit; // The default limit (in units of PedRMS) for acceptance of the fitted charge sigma
|
---|
23 | static const Float_t fgChargeRelErrLimit; // The default limit (in units of Error of fitted charge) for acceptance of the fitted mean
|
---|
24 |
|
---|
25 | static const Float_t fgTimeLimit; // The limit (in units of FADC slices) for acceptance of the fitted time
|
---|
26 | static const Float_t fgTimeErrLimit; // The limit (in units of FADC slices) for acceptance of the fitted time sigma
|
---|
27 |
|
---|
28 | Float_t fChargeLimit; // The limit (in units of PedRMS) for acceptance of the fitted mean charge
|
---|
29 | Float_t fChargeErrLimit; // The limit (in units of PedRMS) for acceptance of the fitted charge sigma
|
---|
30 | Float_t fChargeRelErrLimit; // The limit (in units of Error of fitted charge) for acceptance of the fitted mean
|
---|
31 |
|
---|
32 | Float_t fTimeLimit; // The limit (in units of FADC slices) for acceptance of the fitted time
|
---|
33 | Float_t fTimeErrLimit; // The limit (in units of FADC slices) for acceptance of the fitted time sigma
|
---|
34 |
|
---|
35 | Float_t fElectronicPedRms; // The pure electronic component of the RMS
|
---|
36 | Float_t fElectronicPedRmsErr; // The error of the pure electronic component of the RMS
|
---|
37 |
|
---|
38 | Int_t fPixId; // the pixel Id
|
---|
39 |
|
---|
40 | UInt_t fFlags; // Flag for the set bits
|
---|
41 |
|
---|
42 | Float_t fHiGainMeanCharge; // The mean reduced charge after the fit
|
---|
43 | Float_t fHiGainMeanChargeErr; // The error of reduced mean charge after the fit
|
---|
44 | Float_t fHiGainSigmaCharge; // The sigma of the mean charge after the fit
|
---|
45 | Float_t fHiGainSigmaChargeErr; // The error of the sigma of the mean charge after the fit
|
---|
46 | Float_t fHiGainChargeProb; // The probability of the fit function
|
---|
47 |
|
---|
48 | Float_t fLoGainMeanCharge; // The mean reduced charge after the fit
|
---|
49 | Float_t fLoGainMeanChargeErr; // The error of reduced mean charge after the fit
|
---|
50 | Float_t fLoGainSigmaCharge; // The sigma of the mean charge after the fit
|
---|
51 | Float_t fLoGainSigmaChargeErr; // The error of the sigma of the mean charge after the fit
|
---|
52 | Float_t fLoGainChargeProb; // The probability of the fit function
|
---|
53 |
|
---|
54 | Float_t fRSigmaCharge; // The reduced squares of sigmas after the fit
|
---|
55 | Float_t fRSigmaChargeErr; // The reduced squares of sigmas after the fit
|
---|
56 |
|
---|
57 | Float_t fPed; // The mean pedestal (from MPedestalPix) times number of FADC slices
|
---|
58 | Float_t fPedErr; // The error of the pedestal
|
---|
59 | Float_t fPedRms; // The pedestal RMS (from MPedestalPix) times sqrt of number of FADC slices
|
---|
60 |
|
---|
61 | Float_t fLoGainPedRms; // The pedestal RMS of the low gain
|
---|
62 | Float_t fLoGainPedRmsErr; // The pedestal RMS Error of the low gain
|
---|
63 |
|
---|
64 | Float_t fAbsTimeMean; // The mean absolute arrival time
|
---|
65 | Float_t fAbsTimeRms; // The rms of the mean absolute arrival time
|
---|
66 |
|
---|
67 | Byte_t fTimeFirstHiGain; // The first used FADC slice
|
---|
68 | Byte_t fTimeLastHiGain; // The last used FADC slice
|
---|
69 |
|
---|
70 | Byte_t fTimeFirstLoGain; // The first used FADC slice
|
---|
71 | Byte_t fTimeLastLoGain; // The last used FADC slice
|
---|
72 |
|
---|
73 | Float_t fPheFFactorMethod; // The number of Phe's calculated (F-factor method)
|
---|
74 | Float_t fPheFFactorMethodErr; // The error on the number of Phe's calculated (F-factor method)
|
---|
75 |
|
---|
76 | Float_t fMeanConversionFFactorMethod; // The conversion factor to Phe's (F-factor method)
|
---|
77 | Float_t fMeanConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
|
---|
78 | Float_t fMeanConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method)
|
---|
79 | Float_t fMeanConversionCombinedMethod; // The conversion factor to Ph's (all methods combined)
|
---|
80 |
|
---|
81 | Float_t fConversionFFactorMethodErr; // The error of the conversion factor to Phe's (F-factor method)
|
---|
82 | Float_t fConversionBlindPixelMethodErr; // The error of the conversion factor to Ph's (Blind Pixel method)
|
---|
83 | Float_t fConversionPINDiodeMethodErr; // The error of the conversion factor to Ph's (PIN Diode method)
|
---|
84 | Float_t fConversionCombinedMethodErr; // The error of the conversion factor to Ph's (all methods combined)
|
---|
85 |
|
---|
86 | Float_t fSigmaConversionFFactorMethod; // The sigma of conversion factor to Phe's (F-factor method)
|
---|
87 | Float_t fSigmaConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
|
---|
88 | Float_t fSigmaConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method)
|
---|
89 | Float_t fSigmaConversionCombinedMethod; // The conversion factor to Ph's (all methods combined)
|
---|
90 |
|
---|
91 | Float_t fTotalFFactorFFactorMethod; // The total F-Factor to Ph's (F-factor method)
|
---|
92 | Float_t fTotalFFactorBlindPixelMethod; // The total F-Factor to Ph's (Blind Pixel method)
|
---|
93 | Float_t fTotalFFactorPINDiodeMethod; // The total F-Factor to Ph's (PIN Diode method)
|
---|
94 | Float_t fTotalFFactorCombinedMethod; // The total F-Factor to Ph's (all methods combined)
|
---|
95 |
|
---|
96 | Float_t fTotalFFactorErrFFactorMethod; // The error of the total F-Factor to Ph's (F-factor method)
|
---|
97 | Float_t fTotalFFactorErrBlindPixelMethod; // The error of the total F-Factor to Ph's (Blind Pixel method)
|
---|
98 | Float_t fTotalFFactorErrPINDiodeMethod; // The error of the total F-Factor to Ph's (PIN Diode method)
|
---|
99 | Float_t fTotalFFactorErrCombinedMethod; // The error of the total F-Factor to Ph's (all methods combined)
|
---|
100 |
|
---|
101 | Float_t fTotalFFactor; // The F-Factor of the total readout system (Sigma(out)/mean(out)*Mean(in)/sigma(in)
|
---|
102 | Float_t fTotalFFactorErr; // The error on the F-Factor of the total readout system
|
---|
103 |
|
---|
104 | Float_t fConversionHiLo; // The conversion factor between Hi Gain and Lo Gain
|
---|
105 | Float_t fConversionHiLoErr; // The error of the conversion factor between Hi Gain and Lo Gain
|
---|
106 |
|
---|
107 | Float_t fNumLoGainSamples;
|
---|
108 |
|
---|
109 | Float_t fHiGainNumPickup;
|
---|
110 | Float_t fLoGainNumPickup;
|
---|
111 |
|
---|
112 | enum { kHiGainSaturation, kLoGainSaturation,
|
---|
113 | kExcluded,
|
---|
114 | kChargeValid, kTimeFitValid,
|
---|
115 | kHiGainFitted, kLoGainFitted,
|
---|
116 | kBlindPixelMethodValid, kFFactorMethodValid,
|
---|
117 | kPINDiodeMethodValid, kCombinedMethodValid };
|
---|
118 |
|
---|
119 | void CalcLoGainPed();
|
---|
120 |
|
---|
121 | public:
|
---|
122 |
|
---|
123 | MCalibrationChargePix(const char *name=NULL, const char *title=NULL);
|
---|
124 | ~MCalibrationChargePix() {}
|
---|
125 |
|
---|
126 | void Clear(Option_t *o="");
|
---|
127 |
|
---|
128 | // Setter
|
---|
129 | void SetPedestal(const Float_t ped, const Float_t pedrms, const Float_t pederr);
|
---|
130 |
|
---|
131 | void SetConversionHiLo( const Float_t c = gkConversionHiLo) { fConversionHiLo = c; }
|
---|
132 | void SetConversionHiLoErr( const Float_t e = gkConversionHiLoErr) { fConversionHiLoErr = e; }
|
---|
133 | void SetChargeLimit ( const Float_t f=fgChargeLimit ) { fChargeLimit = f; }
|
---|
134 | void SetChargeErrLimit ( const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; }
|
---|
135 | void SetChargeRelErrLimit( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; }
|
---|
136 |
|
---|
137 | void SetTimeLimit ( const Float_t f=fgTimeLimit ) { fTimeLimit = f; }
|
---|
138 | void SetTimeErrLimit ( const Float_t f=fgTimeErrLimit ) { fTimeErrLimit = f; }
|
---|
139 |
|
---|
140 | // Charges
|
---|
141 | void SetHiGainMeanCharge ( const Float_t f ) { fHiGainMeanCharge = f; }
|
---|
142 | void SetHiGainMeanChargeErr ( const Float_t f ) { fHiGainMeanChargeErr = f; }
|
---|
143 | void SetHiGainChargeProb ( const Float_t f ) { fHiGainChargeProb = f; }
|
---|
144 | void SetHiGainSigmaCharge ( const Float_t f ) { fHiGainSigmaCharge = f; }
|
---|
145 | void SetHiGainSigmaChargeErr ( const Float_t f ) { fHiGainSigmaChargeErr = f; }
|
---|
146 |
|
---|
147 | void SetLoGainMeanCharge ( const Float_t f ) { fLoGainMeanCharge = f; }
|
---|
148 | void SetLoGainMeanChargeErr ( const Float_t f ) { fLoGainMeanChargeErr = f; }
|
---|
149 | void SetLoGainChargeProb ( const Float_t f ) { fLoGainChargeProb = f; }
|
---|
150 | void SetLoGainSigmaCharge ( const Float_t f ) { fLoGainSigmaCharge = f; }
|
---|
151 | void SetLoGainSigmaChargeErr ( const Float_t f ) { fLoGainSigmaChargeErr = f; }
|
---|
152 |
|
---|
153 | void SetMeanCharge ( const Float_t f );
|
---|
154 | void SetMeanChargeErr ( const Float_t f );
|
---|
155 | void SetSigmaCharge ( const Float_t f );
|
---|
156 | void SetSigmaChargeErr ( const Float_t f );
|
---|
157 |
|
---|
158 | void SetHiGainNumPickup ( const Float_t f ) { fHiGainNumPickup = f; }
|
---|
159 | void SetLoGainNumPickup ( const Float_t f ) { fLoGainNumPickup = f; }
|
---|
160 |
|
---|
161 | // Times
|
---|
162 | void SetAbsTimeMean ( const Float_t f ) { fAbsTimeMean = f; }
|
---|
163 | void SetAbsTimeRms ( const Float_t f ) { fAbsTimeRms = f; }
|
---|
164 |
|
---|
165 | void SetNumLoGainSamples ( const Float_t f ) { fNumLoGainSamples = f; }
|
---|
166 |
|
---|
167 | // Conversion Factors
|
---|
168 | void SetConversionFFactorMethod ( Float_t c, Float_t err, Float_t sig );
|
---|
169 | void SetConversionBlindPixelMethod( Float_t c, Float_t err, Float_t sig );
|
---|
170 | void SetConversionPINDiodeMethod ( Float_t c, Float_t err, Float_t sig );
|
---|
171 | void SetConversionCombinedMethod ( Float_t c, Float_t err, Float_t sig );
|
---|
172 |
|
---|
173 | void SetTotalFFactorFFactorMethod ( const Float_t f) { fTotalFFactorFFactorMethod = f; }
|
---|
174 | void SetTotalFFactorBlindPixelMethod ( const Float_t f) { fTotalFFactorBlindPixelMethod = f; }
|
---|
175 | void SetTotalFFactorPINDiodeMethod ( const Float_t f) { fTotalFFactorPINDiodeMethod = f; }
|
---|
176 |
|
---|
177 | void SetTotalFFactorErrFFactorMethod ( const Float_t f) { fTotalFFactorErrFFactorMethod = f; }
|
---|
178 | void SetTotalFFactorErrBlindPixelMethod ( const Float_t f) { fTotalFFactorErrBlindPixelMethod = f; }
|
---|
179 | void SetTotalFFactorErrPINDiodeMethod ( const Float_t f) { fTotalFFactorErrPINDiodeMethod = f; }
|
---|
180 |
|
---|
181 | // Bit Setters
|
---|
182 | void SetHiGainSaturation ( const Bool_t b = kTRUE );
|
---|
183 | void SetLoGainSaturation ( const Bool_t b = kTRUE );
|
---|
184 | void SetExcluded ( const Bool_t b = kTRUE );
|
---|
185 | void SetHiGainFitted ( const Bool_t b = kTRUE );
|
---|
186 | void SetLoGainFitted ( const Bool_t b = kTRUE );
|
---|
187 | void SetBlindPixelMethodValid( const Bool_t b = kTRUE );
|
---|
188 | void SetFFactorMethodValid ( const Bool_t b = kTRUE );
|
---|
189 | void SetPINDiodeMethodValid ( const Bool_t b = kTRUE );
|
---|
190 | void SetCombinedMethodValid ( const Bool_t b = kTRUE );
|
---|
191 |
|
---|
192 | void SetAbsTimeBordersHiGain( Byte_t f, Byte_t l );
|
---|
193 | void SetAbsTimeBordersLoGain( Byte_t f, Byte_t l );
|
---|
194 |
|
---|
195 | // Charges
|
---|
196 | Float_t GetHiGainMeanCharge() const { return fHiGainMeanCharge; }
|
---|
197 | Float_t GetHiGainMeanChargeErr() const { return fHiGainMeanChargeErr; }
|
---|
198 | Float_t GetHiGainChargeProb() const { return fHiGainChargeProb; }
|
---|
199 | Float_t GetHiGainSigmaCharge() const { return fHiGainSigmaCharge; }
|
---|
200 | Float_t GetHiGainSigmaChargeErr() const { return fHiGainSigmaChargeErr; }
|
---|
201 |
|
---|
202 | Float_t GetLoGainMeanCharge() const { return fLoGainMeanCharge; }
|
---|
203 | Float_t GetLoGainMeanChargeErr() const { return fLoGainMeanChargeErr; }
|
---|
204 | Float_t GetLoGainChargeProb() const { return fLoGainChargeProb; }
|
---|
205 | Float_t GetLoGainSigmaCharge() const { return fLoGainSigmaCharge; }
|
---|
206 | Float_t GetLoGainSigmaChargeErr() const { return fLoGainSigmaChargeErr; }
|
---|
207 |
|
---|
208 | Float_t GetMeanCharge() const;
|
---|
209 | Float_t GetMeanChargeErr() const;
|
---|
210 | Float_t GetChargeProb() const;
|
---|
211 | Float_t GetSigmaCharge() const;
|
---|
212 | Float_t GetSigmaChargeErr() const;
|
---|
213 |
|
---|
214 | Float_t GetRSigmaCharge() const { return fRSigmaCharge; }
|
---|
215 | Float_t GetRSigmaChargeErr() const { return fRSigmaChargeErr; }
|
---|
216 |
|
---|
217 | Float_t GetHiGainNumPickup() const { return fHiGainNumPickup; }
|
---|
218 | Float_t GetLoGainNumPickup() const { return fLoGainNumPickup; }
|
---|
219 |
|
---|
220 | Float_t GetAbsTimeMean() const { return fAbsTimeMean; }
|
---|
221 | Float_t GetAbsTimeRms() const { return fAbsTimeRms; }
|
---|
222 |
|
---|
223 | // Conversion Factors
|
---|
224 | Float_t GetConversionHiLo() const { return fConversionHiLo; }
|
---|
225 | Float_t GetConversionHiLoErr() const { return fConversionHiLoErr; }
|
---|
226 |
|
---|
227 | Float_t GetMeanConversionBlindPixelMethod() const { return fMeanConversionBlindPixelMethod ; }
|
---|
228 | Float_t GetConversionBlindPixelMethodErr() const { return fConversionBlindPixelMethodErr ; }
|
---|
229 | Float_t GetSigmaConversionBlindPixelMethod() const { return fSigmaConversionBlindPixelMethod ; }
|
---|
230 |
|
---|
231 | Float_t GetMeanConversionFFactorMethod() const { return fMeanConversionFFactorMethod; }
|
---|
232 | Float_t GetConversionFFactorMethodErr() const { return fConversionFFactorMethodErr; }
|
---|
233 | Float_t GetSigmaConversionFFactorMethod() const { return fSigmaConversionFFactorMethod; }
|
---|
234 |
|
---|
235 | Float_t GetMeanConversionPINDiodeMethod() const { return fMeanConversionPINDiodeMethod ; }
|
---|
236 | Float_t GetConversionPINDiodeMethodErr() const { return fConversionPINDiodeMethodErr ; }
|
---|
237 | Float_t GetSigmaConversionPINDiodeMethod() const { return fSigmaConversionPINDiodeMethod ; }
|
---|
238 |
|
---|
239 | Float_t GetMeanConversionCombinedMethod() const { return fMeanConversionCombinedMethod ; }
|
---|
240 | Float_t GetConversionCombinedMethodErr() const { return fConversionCombinedMethodErr ; }
|
---|
241 | Float_t GetSigmaConversionCombinedMethod() const { return fSigmaConversionCombinedMethod ; }
|
---|
242 |
|
---|
243 | Float_t GetPheFFactorMethod() const { return fPheFFactorMethod; }
|
---|
244 | Float_t GetPheFFactorMethodErr() const { return fPheFFactorMethodErr; }
|
---|
245 |
|
---|
246 | Int_t GetPixId() const { return fPixId; }
|
---|
247 |
|
---|
248 | Float_t GetPed() const { return fPed; }
|
---|
249 | Float_t GetPedErr() const { return fPedErr; }
|
---|
250 | Float_t GetPedRms() const { return fPedRms; }
|
---|
251 | Float_t GetPedRmsErr() const { return fPedErr / 2.; }
|
---|
252 |
|
---|
253 | Float_t GetTotalFFactorFFactorMethod() const { return fTotalFFactorFFactorMethod; }
|
---|
254 | Float_t GetTotalFFactorErrFFactorMethod() const { return fTotalFFactorErrFFactorMethod; }
|
---|
255 |
|
---|
256 | Float_t GetTotalFFactorBlindPixelMethod() const { return fTotalFFactorBlindPixelMethod; }
|
---|
257 | Float_t GetTotalFFactorErrBlindPixelMethod() const { return fTotalFFactorErrBlindPixelMethod; }
|
---|
258 |
|
---|
259 | Float_t GetTotalFFactorPINDiodeMethod() const { return fTotalFFactorPINDiodeMethod; }
|
---|
260 | Float_t GetTotalFFactorErrPINDiodeMethod() const { return fTotalFFactorErrPINDiodeMethod; }
|
---|
261 |
|
---|
262 | Float_t GetTotalFFactorCombinedMethod() const { return fTotalFFactorCombinedMethod; }
|
---|
263 | Float_t GetTotalFFactorErrCombinedMethod() const { return fTotalFFactorErrCombinedMethod; }
|
---|
264 |
|
---|
265 | Bool_t IsExcluded() const;
|
---|
266 | Bool_t IsHiGainSaturation() const;
|
---|
267 | Bool_t IsLoGainSaturation() const;
|
---|
268 | Bool_t IsHiGainFitted() const;
|
---|
269 | Bool_t IsLoGainFitted() const;
|
---|
270 | Bool_t IsFitted() const;
|
---|
271 | Bool_t IsBlindPixelMethodValid() const;
|
---|
272 | Bool_t IsPINDiodeMethodValid() const;
|
---|
273 | Bool_t IsFFactorMethodValid() const;
|
---|
274 | Bool_t IsCombinedMethodValid() const;
|
---|
275 |
|
---|
276 | void DefinePixId(Int_t i);
|
---|
277 |
|
---|
278 | // Miscellaneous
|
---|
279 | void ApplyLoGainConversion();
|
---|
280 |
|
---|
281 | void CheckChargeValidity ( MBadPixelsPix *bad );
|
---|
282 | void CheckTimeValidity ( MBadPixelsPix *bad );
|
---|
283 | Bool_t CalcReducedSigma();
|
---|
284 | Bool_t CalcFFactorMethod();
|
---|
285 |
|
---|
286 | ClassDef(MCalibrationChargePix, 1) // Container for Calibration of one pixel
|
---|
287 | };
|
---|
288 |
|
---|
289 | #endif
|
---|
290 |
|
---|