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

Last change on this file since 3555 was 3555, checked in by gaug, 21 years ago
*** empty log message ***
File size: 15.7 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 fHiGainNumPickup;
112 Float_t fLoGainNumPickup;
113
114 enum { kHiGainSaturation, kLoGainSaturation,
115 kExcluded,
116 kChargeValid, kTimeFitValid,
117 kHiGainFitted, kLoGainFitted,
118 kBlindPixelMethodValid, kFFactorMethodValid,
119 kPINDiodeMethodValid, kCombinedMethodValid };
120
121public:
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 SetPixId( const Int_t i ) { fPixId = i; }
130
131 void SetPedestal(const Float_t ped, const Float_t pedrms, const Float_t pederr);
132
133 void SetConversionHiLo( const Float_t c = gkConversionHiLo) { fConversionHiLo = c; }
134 void SetConversionHiLoErr( const Float_t e = gkConversionHiLoErr) { fConversionHiLoVar = e*e; }
135 void SetChargeLimit ( const Float_t f=fgChargeLimit ) { fChargeLimit = f; }
136 void SetChargeErrLimit ( const Float_t f=fgChargeErrLimit ) { fChargeVarLimit = f*f; }
137 void SetChargeRelErrLimit( const Float_t f=fgChargeRelErrLimit ) { fChargeRelVarLimit = f*f; }
138
139 void SetTimeLimit ( const Float_t f=fgTimeLimit ) { fTimeLimit = f; }
140 void SetTimeErrLimit ( const Float_t f=fgTimeErrLimit ) { fTimeVarLimit = f*f; }
141
142 void SetPheFFactorMethodLimit ( const Float_t f=fgPheFFactorMethodLimit ) { fPheFFactorMethodLimit = f; }
143
144 // Charges
145 void SetHiGainMeanCharge ( const Float_t f ) { fHiGainMeanCharge = f; }
146 void SetHiGainMeanChargeErr ( const Float_t f ) { fHiGainMeanChargeVar = f*f; }
147 void SetHiGainChargeProb ( const Float_t f ) { fHiGainChargeProb = f; }
148 void SetHiGainSigmaCharge ( const Float_t f ) { fHiGainSigmaCharge = f; }
149 void SetHiGainSigmaChargeErr ( const Float_t f ) { fHiGainSigmaChargeVar = f*f; }
150
151 void SetLoGainMeanCharge ( const Float_t f ) { fLoGainMeanCharge = f; }
152 void SetLoGainMeanChargeErr ( const Float_t f ) { fLoGainMeanChargeVar = f*f; }
153 void SetLoGainChargeProb ( const Float_t f ) { fLoGainChargeProb = f; }
154 void SetLoGainSigmaCharge ( const Float_t f ) { fLoGainSigmaCharge = f; }
155 void SetLoGainSigmaChargeErr ( const Float_t f ) { fLoGainSigmaChargeVar = f*f; }
156
157 void SetMeanCharge ( const Float_t f );
158 void SetMeanChargeErr ( const Float_t f );
159 void SetSigmaCharge ( const Float_t f );
160 void SetSigmaChargeErr ( const Float_t f );
161
162 void SetHiGainNumPickup ( const Float_t f ) { fHiGainNumPickup = f; }
163 void SetLoGainNumPickup ( const Float_t f ) { fLoGainNumPickup = f; }
164
165 // Times
166 void SetAbsTimeMean ( const Float_t f ) { fAbsTimeMean = f; }
167 void SetAbsTimeRms ( const Float_t f ) { fAbsTimeRms = f; }
168
169 // Conversion Factors
170 void SetConversionFFactorMethod ( Float_t c, Float_t err, Float_t sig );
171 void SetConversionBlindPixelMethod( Float_t c, Float_t err, Float_t sig );
172 void SetConversionPINDiodeMethod ( Float_t c, Float_t err, Float_t sig );
173 void SetConversionCombinedMethod ( Float_t c, Float_t err, Float_t sig );
174
175 void SetTotalFFactorFFactorMethod ( const Float_t f) { fTotalFFactorFFactorMethod = f; }
176 void SetTotalFFactorBlindPixelMethod ( const Float_t f) { fTotalFFactorBlindPixelMethod = f; }
177 void SetTotalFFactorPINDiodeMethod ( const Float_t f) { fTotalFFactorPINDiodeMethod = f; }
178
179 void SetTotalFFactorFFactorMethodErr ( const Float_t f) { fTotalFFactorFFactorMethodVar = f*f; }
180 void SetTotalFFactorBlindPixelMethodErr ( const Float_t f) { fTotalFFactorBlindPixelMethodVar = f*f; }
181 void SetTotalFFactorPINDiodeMethodErr ( const Float_t f) { fTotalFFactorPINDiodeMethodVar = f*f; }
182
183 // Bit Setters
184 void SetHiGainSaturation ( const Bool_t b = kTRUE );
185 void SetLoGainSaturation ( const Bool_t b = kTRUE );
186 void SetExcluded ( const Bool_t b = kTRUE );
187 void SetHiGainFitted ( const Bool_t b = kTRUE );
188 void SetLoGainFitted ( const Bool_t b = kTRUE );
189 void SetBlindPixelMethodValid( const Bool_t b = kTRUE );
190 void SetFFactorMethodValid ( const Bool_t b = kTRUE );
191 void SetPINDiodeMethodValid ( const Bool_t b = kTRUE );
192 void SetCombinedMethodValid ( const Bool_t b = kTRUE );
193
194 void SetAbsTimeBordersHiGain( Byte_t f, Byte_t l );
195 void SetAbsTimeBordersLoGain( Byte_t f, Byte_t l );
196
197 // Charges
198 Float_t GetHiGainMeanCharge() const { return fHiGainMeanCharge; }
199 Float_t GetHiGainMeanChargeErr() const;
200 Float_t GetHiGainChargeProb() const { return fHiGainChargeProb; }
201 Float_t GetHiGainSigmaCharge() const { return fHiGainSigmaCharge; }
202 Float_t GetHiGainSigmaChargeErr() const;
203
204 Float_t GetLoGainMeanCharge() const;
205 Float_t GetLoGainMeanChargeErr() const;
206 Float_t GetLoGainChargeProb() const { return fLoGainChargeProb; }
207 Float_t GetLoGainSigmaCharge() const;
208 Float_t GetLoGainSigmaChargeErr() const;
209
210 Float_t GetMeanCharge() const;
211 Float_t GetMeanChargeErr() const;
212 Float_t GetChargeProb() const;
213 Float_t GetSigmaCharge() const;
214 Float_t GetSigmaChargeErr() const;
215
216 Float_t GetRSigmaCharge() const;
217 Float_t GetRSigmaChargeErr() const;
218
219 Float_t GetHiGainNumPickup() const { return fHiGainNumPickup; }
220 Float_t GetLoGainNumPickup() const { return fLoGainNumPickup; }
221
222 Float_t GetAbsTimeMean() const { return fAbsTimeMean; }
223 Float_t GetAbsTimeRms() const { return fAbsTimeRms; }
224
225 // Conversion Factors
226 Float_t GetConversionHiLo() const { return fConversionHiLo; }
227 Float_t GetConversionHiLoErr() const;
228
229 Float_t GetMeanConversionBlindPixelMethod() const { return fMeanConversionBlindPixelMethod ; }
230 Float_t GetConversionBlindPixelMethodErr() const;
231 Float_t GetSigmaConversionBlindPixelMethod() const { return fSigmaConversionBlindPixelMethod ; }
232
233 Float_t GetMeanConversionFFactorMethod() const { return fMeanConversionFFactorMethod; }
234 Float_t GetConversionFFactorMethodErr() const;
235 Float_t GetSigmaConversionFFactorMethod() const { return fSigmaConversionFFactorMethod; }
236
237 Float_t GetMeanConversionPINDiodeMethod() const { return fMeanConversionPINDiodeMethod ; }
238 Float_t GetConversionPINDiodeMethodErr() const;
239 Float_t GetSigmaConversionPINDiodeMethod() const { return fSigmaConversionPINDiodeMethod ; }
240
241 Float_t GetMeanConversionCombinedMethod() const { return fMeanConversionCombinedMethod ; }
242 Float_t GetConversionCombinedMethodErr() const;
243 Float_t GetSigmaConversionCombinedMethod() const { return fSigmaConversionCombinedMethod ; }
244
245 Float_t GetPheFFactorMethod() const { return fPheFFactorMethod; }
246 Float_t GetPheFFactorMethodErr() const;
247
248 Int_t GetPixId() const { return fPixId; }
249
250 Float_t GetPed() const { return fPed; }
251 Float_t GetPedErr() const;
252 Float_t GetPedRms() const;
253 Float_t GetPedRmsErr() const;
254
255 Float_t GetTotalFFactorFFactorMethod() const { return fTotalFFactorFFactorMethod; }
256 Float_t GetTotalFFactorFFactorMethodErr() const;
257
258 Float_t GetTotalFFactorBlindPixelMethod() const { return fTotalFFactorBlindPixelMethod; }
259 Float_t GetTotalFFactorBlindPixelMethodErr() const;
260
261 Float_t GetTotalFFactorPINDiodeMethod() const { return fTotalFFactorPINDiodeMethod; }
262 Float_t GetTotalFFactorPINDiodeMethodErr() const;
263
264 Float_t GetTotalFFactorCombinedMethod() const { return fTotalFFactorCombinedMethod; }
265 Float_t GetTotalFFactorCombinedMethodErr() const;
266
267 Bool_t IsExcluded() const;
268 Bool_t IsHiGainSaturation() const;
269 Bool_t IsLoGainSaturation() const;
270 Bool_t IsHiGainFitted() const;
271 Bool_t IsLoGainFitted() const;
272 Bool_t IsFitted() const;
273 Bool_t IsBlindPixelMethodValid() const;
274 Bool_t IsPINDiodeMethodValid() const;
275 Bool_t IsFFactorMethodValid() const;
276 Bool_t IsCombinedMethodValid() const;
277
278 // Miscellaneous
279 void CheckChargeValidity ( MBadPixelsPix *bad );
280 void CheckTimeValidity ( MBadPixelsPix *bad );
281
282 void CalcLoGainPedestal(const Float_t logainsamples);
283 Bool_t CalcReducedSigma();
284 Bool_t CalcFFactorMethod();
285
286 ClassDef(MCalibrationChargePix, 1) // Container for Calibration of one pixel
287};
288
289#endif
290
Note: See TracBrowser for help on using the repository browser.