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

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