source: trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h@ 3211

Last change on this file since 3211 was 3145, checked in by gaug, 21 years ago
*** empty log message ***
File size: 10.7 KB
Line 
1#ifndef MARS_MCalibrationPix
2#define MARS_MCalibrationPix
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7
8#include "MHCalibrationPixel.h"
9
10class MCalibrationPix : public MParContainer
11{
12private:
13
14 static const Float_t gkAverageQE; // The average quantum efficieny agreed on for the first analysis
15 static const Float_t gkAverageQEErr; // The error of average quantum efficieny
16
17 static const Float_t gkConversionHiLo; // The default conversion factor HI gain - Lo Gain
18 static const Float_t gkConversionHiLoError; // The error of the default conversion factor
19
20 static const Float_t gkElectronicPedRms; // The pure electronic component of the RMS
21 static const Float_t gkErrElectronicPedRms; // The error of the pure electronic component of the RMS
22 static const Float_t gkFFactor; // The laboratory F-factor of the PMTs
23 static const Float_t gkFFactorError; // The laboratory F-factor Error of the PMTs
24 static const Float_t gkChargeLimit; // The limit (in units of PedRMS) for acceptance of the fitted mean charge
25 static const Float_t gkChargeErrLimit; // The limit (in units of PedRMS) for acceptance of the fitted charge sigma
26 static const Float_t gkChargeRelErrLimit; // The limit (in units of Error of fitted charge) for acceptance of the fitted mean
27 static const Float_t gkTimeLimit; // The limit (in units of FADC slices) for acceptance of the fitted time
28 static const Float_t gkTimeErrLimit; // The limit (in units of FADC slices) for acceptance of the fitted time sigma
29 static const Float_t gkConvFFactorRelErrorLimit; // The limit (in units of [1]) for acceptance of the rel. error of the conversion factor with the FFactor method
30
31 Int_t fPixId; // the pixel Id
32
33 UInt_t fFlags; // Flag for the set Bits
34
35 Float_t fAverageQE;
36 Float_t fAverageQEErr;
37
38 Float_t fCharge; // The mean reduced charge after the fit
39 Float_t fErrCharge; // The error of reduced mean charge after the fit
40 Float_t fSigmaCharge; // The sigma of the mean charge after the fit
41 Float_t fErrSigmaCharge; // The error of the sigma of the mean charge after the fit
42 Float_t fRSigmaCharge; // The reduced squares of sigmas after the fit
43 Float_t fErrRSigmaCharge; // The reduced squares of sigmas after the fit
44 Float_t fChargeProb; // The probability of the fit function
45
46 Float_t fPed; // The mean pedestal (from MPedestalPix)
47 Float_t fPedRms; // The pedestal RMS (from MPedestalPix)
48 Float_t fErrPedRms; // The error of the pedestal RMS (from MPedestalPix)
49
50 Float_t fAbsTimeMean;
51 Float_t fAbsTimeMeanErr;
52 Float_t fAbsTimeRms;
53
54 Byte_t fTimeFirstHiGain; // The first used FADC slice
55 Byte_t fTimeLastHiGain; // The last used FADC slice
56
57 Byte_t fTimeFirstLoGain; // The first used FADC slice
58 Byte_t fTimeLastLoGain; // The last used FADC slice
59
60 Float_t fPheFFactorMethod; // The number of Phe's calculated (F-factor method)
61 Float_t fPheFFactorMethodError; // The error on the number of Phe's calculated (F-factor method)
62
63 Float_t fMeanConversionFFactorMethod; // The conversion factor to Phe's (F-factor method)
64 Float_t fMeanConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
65 Float_t fMeanConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method)
66 Float_t fMeanConversionCombinedMethod; // The conversion factor to Ph's (all methods combined)
67
68 Float_t fErrorConversionFFactorMethod; // The error of the conversion factor to Phe's (F-factor method)
69 Float_t fErrorConversionBlindPixelMethod; // The error of the conversion factor to Ph's (Blind Pixel method)
70 Float_t fErrorConversionPINDiodeMethod; // The error of the conversion factor to Ph's (PIN Diode method)
71 Float_t fErrorConversionCombinedMethod; // The error of the conversion factor to Ph's (all methods combined)
72
73 Float_t fSigmaConversionFFactorMethod; // The sigma of conversion factor to Phe's (F-factor method)
74 Float_t fSigmaConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
75 Float_t fSigmaConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method)
76 Float_t fSigmaConversionCombinedMethod; // The conversion factor to Ph's (all methods combined)
77
78 Float_t fTotalFFactor; // The F-Factor of the total readout system (Sigma(out)/mean(out)*Mean(in)/sigma(in)
79 Float_t fTotalFFactorError; // The error on the F-Factor of the total readout system
80
81 Float_t fConversionHiLo; // The conversion factor between Hi Gain and Lo Gain
82 Float_t fConversionHiLoError; // The error of the conversion factor between Hi Gain and Lo Gain
83
84 Float_t fNumHiGainSamples;
85 Float_t fNumLoGainSamples;
86
87 Bool_t fFactorCalculated;
88
89 enum { kHiGainSaturation,
90 kExcluded, kExcludeQualityCheck,
91 kChargeValid, kTimeFitValid,
92 kFitted, kOscillating,
93 kBlindPixelMethodValid, kFFactorMethodValid, kPINDiodeMethodValid, kCombinedMethodValid };
94
95 MHCalibrationPixel *fHist; // Pointer to the histograms performing the fits, etc.
96
97 Bool_t CheckChargeValidity();
98 Bool_t CheckTimeFitValidity();
99 Bool_t CalcFFactorMethod();
100
101public:
102
103 MCalibrationPix(const char *name=NULL, const char *title=NULL);
104 ~MCalibrationPix();
105
106 void Clear(Option_t *o="");
107
108 // Getter
109 MHCalibrationPixel *GetHist() const { return fHist; }
110
111 // Setter
112 void SetPedestal(const Float_t ped, const Float_t pedrms,
113 const Float_t higainsamp, const Float_t logainsamp);
114 void SetConversionHiLo( const Float_t c=gkConversionHiLo) { fConversionHiLo = c; }
115 void SetConversionHiLoError(const Float_t e=gkConversionHiLoError) { fConversionHiLoError = e; }
116 void SetAverageQE(const Float_t qe=gkAverageQE, const Float_t err=gkAverageQEErr)
117 { fAverageQE = qe; fAverageQEErr = err; }
118
119 // Setters for MC
120 void SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig);
121 void SetConversionBlindPixelMethod(Float_t c, Float_t err, Float_t sig);
122 void SetConversionPINDiodeMethod(Float_t c, Float_t err, Float_t sig);
123 void SetConversionCombinedMethod(Float_t c, Float_t err, Float_t sig);
124
125 // Bit Setters
126 void SetHiGainSaturation(Bool_t b = kTRUE);
127 void SetExcluded(Bool_t b = kTRUE);
128 void SetExcludeQualityCheck(Bool_t b = kTRUE);
129 void SetChargeValid(Bool_t b = kTRUE);
130 void SetFitted(Bool_t b = kTRUE);
131 void SetOscillating(Bool_t b = kTRUE);
132 void SetBlindPixelMethodValid(Bool_t b = kTRUE);
133 void SetFFactorMethodValid(Bool_t b = kTRUE);
134 void SetPINDiodeMethodValid(Bool_t b = kTRUE);
135 void SetAbsTimeBordersHiGain(Byte_t f, Byte_t l);
136 void SetAbsTimeBordersLoGain(Byte_t f, Byte_t l);
137
138 // Charges
139 Float_t GetCharge() const { return fCharge; }
140 Float_t GetErrCharge() const { return fErrCharge; }
141 Float_t GetChargeProb() const { return fChargeProb; }
142 Float_t GetSigmaCharge() const { return fSigmaCharge; }
143 Float_t GetErrSigmaCharge() const { return fErrSigmaCharge; }
144 Float_t GetRSigmaCharge() const { return fRSigmaCharge; }
145 Float_t GetErrRSigmaCharge() const { return fErrRSigmaCharge; }
146
147
148 Float_t GetAbsTimeMean() const { return fAbsTimeMean; }
149 Float_t GetAbsTimeMeanErr() const { return fAbsTimeMeanErr; }
150 Float_t GetAbsTimeRms() const { return fAbsTimeRms; }
151
152 // Conversion Factors
153 Float_t GetConversionHiLo() const { return fConversionHiLo; }
154 Float_t GetConversionHiLoError() const { return fConversionHiLoError; }
155
156 Float_t GetMeanConversionBlindPixelMethod() const { return fMeanConversionBlindPixelMethod ; }
157 Float_t GetErrorConversionBlindPixelMethod() const { return fErrorConversionBlindPixelMethod ; }
158 Float_t GetSigmaConversionBlindPixelMethod() const { return fSigmaConversionBlindPixelMethod ; }
159
160 Float_t GetMeanConversionFFactorMethod();
161 Float_t GetErrorConversionFFactorMethod();
162 Float_t GetSigmaConversionFFactorMethod();
163
164 Float_t GetMeanConversionPINDiodeMethod() const { return fMeanConversionPINDiodeMethod ; }
165 Float_t GetErrorConversionPINDiodeMethod() const { return fErrorConversionPINDiodeMethod ; }
166 Float_t GetSigmaConversionPINDiodeMethod() const { return fSigmaConversionPINDiodeMethod ; }
167
168 Float_t GetMeanConversionCombinedMethod() const { return fMeanConversionCombinedMethod ; }
169 Float_t GetErrorConversionCombinedMethod() const { return fErrorConversionCombinedMethod ; }
170 Float_t GetSigmaConversionCombinedMethod() const { return fSigmaConversionCombinedMethod ; }
171
172 Float_t GetPheFFactorMethod();
173 Float_t GetPheFFactorMethodError();
174
175 Int_t GetPixId() const { return fPixId; }
176
177 Float_t GetPed() const { return fPed; }
178 Float_t GetPedRms() const { return fPedRms; }
179
180 Float_t GetTotalFFactorFFactorMethod();
181 Float_t GetTotalFFactorErrorFFactorMethod();
182
183 Float_t GetTotalFFactorBlindPixelMethod();
184 Float_t GetTotalFFactorErrorBlindPixelMethod();
185
186 Float_t GetTotalFFactorPINDiodeMethod();
187 Float_t GetTotalFFactorErrorPINDiodeMethod();
188
189 Float_t GetTotalFFactorCombinedMethod();
190 Float_t GetTotalFFactorErrorCombinedMethod();
191
192 Bool_t IsExcluded() const;
193 Bool_t IsExcludeQualityCheck() const;
194 Bool_t IsHiGainSaturation() const;
195 Bool_t IsChargeValid() const;
196 Bool_t IsFitted() const;
197 Bool_t IsOscillating();
198 Bool_t IsBlindPixelMethodValid() const;
199 Bool_t IsPINDiodeMethodValid() const;
200 Bool_t IsFFactorMethodValid();
201 Bool_t IsCombinedMethodValid();
202
203 // Fill histos
204 Bool_t FillChargeHiGain(Float_t q) const { return fHist->FillChargeHiGain(q); }
205 Bool_t FillAbsTimeHiGain(Float_t t) const { return fHist->FillAbsTimeHiGain(t); }
206
207 Bool_t FillChargeLoGain(Float_t q) const { return fHist->FillChargeLoGain(q); }
208 Bool_t FillAbsTimeLoGain(Float_t t) const { return fHist->FillAbsTimeLoGain(t); }
209
210 Bool_t FillGraphs(Float_t qhi,Float_t qlo) const { return fHist->FillGraphs(qhi,qlo); }
211
212 void DefinePixId(Int_t i);
213
214 // Fits
215 Bool_t FitCharge();
216
217 // Draws
218 void Draw(Option_t *opt="") { fHist->Draw(opt); }
219 TObject *DrawClone(Option_t *opt="") const { return fHist->DrawClone(opt); }
220
221 // Miscellaneous
222 void ApplyLoGainConversion();
223 void CheckOscillations();
224
225 ClassDef(MCalibrationPix, 1) // Container for Calibration of one pixel
226};
227
228#endif
229
Note: See TracBrowser for help on using the repository browser.