source: trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.h@ 3510

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