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

Last change on this file since 3264 was 3264, 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 SetHiGainNumPickup ( const Int_t i ) { fHiGainNumPickup = i; }
170 void SetLoGainNumPickup ( const Int_t i ) { fLoGainNumPickup = i; }
171
172 // Times
173 void SetAbsTimeMean ( const Float_t f ) { fAbsTimeMean = f; }
174 void SetAbsTimeRms ( const Float_t f ) { fAbsTimeRms = f; }
175
176 void SetNumLoGainSamples ( const Float_t f ) { fNumLoGainSamples = f; }
177
178 // Setters for MC
179 void SetConversionFFactorMethod ( Float_t c, Float_t err, Float_t sig );
180 void SetConversionBlindPixelMethod( Float_t c, Float_t err, Float_t sig );
181 void SetConversionPINDiodeMethod ( Float_t c, Float_t err, Float_t sig );
182 void SetConversionCombinedMethod ( Float_t c, Float_t err, Float_t sig );
183
184 // Bit Setters
185 void SetHiGainSaturation ( const Bool_t b = kTRUE );
186 void SetLoGainSaturation ( const Bool_t b = kTRUE );
187 void SetExcluded ( const Bool_t b = kTRUE );
188 void SetChargeValid ( const Bool_t b = kTRUE );
189 void SetHiGainFitted ( const Bool_t b = kTRUE );
190 void SetLoGainFitted ( const Bool_t b = kTRUE );
191 void SetHiGainOscillating ( const Bool_t b = kTRUE );
192 void SetLoGainOscillating ( 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 { return fHiGainMeanChargeErr; }
204 Float_t GetHiGainChargeProb() const { return fHiGainChargeProb; }
205 Float_t GetHiGainSigmaCharge() const { return fHiGainSigmaCharge; }
206 Float_t GetHiGainSigmaChargeErr() const { return fHiGainSigmaChargeErr; }
207
208 Float_t GetLoGainMeanCharge() const { return fLoGainMeanCharge; }
209 Float_t GetLoGainMeanChargeErr() const { return fLoGainMeanChargeErr; }
210 Float_t GetLoGainChargeProb() const { return fLoGainChargeProb; }
211 Float_t GetLoGainSigmaCharge() const { return fLoGainSigmaCharge; }
212 Float_t GetLoGainSigmaChargeErr() const { return fLoGainSigmaChargeErr; }
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 { return fRSigmaCharge; }
221 Float_t GetRSigmaChargeErr() const { return fRSigmaChargeErr; }
222
223 Int_t GetHiGainNumPickup() const { return fHiGainNumPickup; }
224 Int_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 { return fConversionHiLoErr; }
232
233 Float_t GetMeanConversionBlindPixelMethod() const { return fMeanConversionBlindPixelMethod ; }
234 Float_t GetConversionBlindPixelMethodErr() const { return fConversionBlindPixelMethodErr ; }
235 Float_t GetSigmaConversionBlindPixelMethod() const { return fSigmaConversionBlindPixelMethod ; }
236
237 Float_t GetMeanConversionFFactorMethod() const { return fMeanConversionFFactorMethod; }
238 Float_t GetConversionFFactorMethodErr() const { return fConversionFFactorMethodErr; }
239 Float_t GetSigmaConversionFFactorMethod() const { return fSigmaConversionFFactorMethod; }
240
241 Float_t GetMeanConversionPINDiodeMethod() const { return fMeanConversionPINDiodeMethod ; }
242 Float_t GetConversionPINDiodeMethodErr() const { return fConversionPINDiodeMethodErr ; }
243 Float_t GetSigmaConversionPINDiodeMethod() const { return fSigmaConversionPINDiodeMethod ; }
244
245 Float_t GetMeanConversionCombinedMethod() const { return fMeanConversionCombinedMethod ; }
246 Float_t GetConversionCombinedMethodErr() const { return fConversionCombinedMethodErr ; }
247 Float_t GetSigmaConversionCombinedMethod() const { return fSigmaConversionCombinedMethod ; }
248
249 Float_t GetPheFFactorMethod() const { return fPheFFactorMethod; }
250 Float_t GetPheFFactorMethodErr() const { return fPheFFactorMethodErr; }
251
252 Int_t GetPixId() const { return fPixId; }
253
254 Float_t GetPed() const { return fPed; }
255 Float_t GetPedErr() const { return fPedErr; }
256 Float_t GetPedRms() const { return fPedRms; }
257
258 Float_t GetTotalFFactorFFactorMethod() const { return fTotalFFactorFFactorMethod; }
259 Float_t GetTotalFFactorErrFFactorMethod() const { return fTotalFFactorErrFFactorMethod; }
260
261 Float_t GetTotalFFactorBlindPixelMethod() const { return fTotalFFactorBlindPixelMethod; }
262 Float_t GetTotalFFactorErrBlindPixelMethod() const { return fTotalFFactorErrBlindPixelMethod; }
263
264 Float_t GetTotalFFactorPINDiodeMethod() const { return fTotalFFactorPINDiodeMethod; }
265 Float_t GetTotalFFactorErrPINDiodeMethod() const { return fTotalFFactorErrPINDiodeMethod; }
266
267 Float_t GetTotalFFactorCombinedMethod() const { return fTotalFFactorCombinedMethod; }
268 Float_t GetTotalFFactorErrCombinedMethod() const { return fTotalFFactorErrCombinedMethod; }
269
270 Bool_t IsExcluded() const;
271 Bool_t IsHiGainSaturation() const;
272 Bool_t IsLoGainSaturation() const;
273 Bool_t IsChargeValid() const;
274 Bool_t IsHiGainFitted() const;
275 Bool_t IsLoGainFitted() const;
276 Bool_t IsFitted() const;
277 Bool_t IsHiGainOscillating() const;
278 Bool_t IsLoGainOscillating() const;
279 Bool_t IsOscillating() const;
280 Bool_t IsBlindPixelMethodValid() const;
281 Bool_t IsPINDiodeMethodValid() const;
282 Bool_t IsFFactorMethodValid() const;
283 Bool_t IsCombinedMethodValid() const;
284
285 Bool_t IsMeanTimeInFirstBin() const;
286 Bool_t IsMeanTimeInLastBin() const;
287
288 void DefinePixId(Int_t i);
289
290 // Miscellaneous
291 void ApplyLoGainConversion();
292
293 Bool_t CheckChargeValidity();
294 Bool_t CheckTimeValidity();
295 Bool_t CalcReducedSigma();
296 Bool_t CalcFFactorMethod();
297
298 ClassDef(MCalibrationChargePix, 1) // Container for Calibration of one pixel
299};
300
301#endif
302
Note: See TracBrowser for help on using the repository browser.