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

Last change on this file since 3032 was 3027, checked in by gaug, 21 years ago
*** empty log message ***
File size: 10.1 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 gkElectronicPedRms; // The pure electronic component of the RMS
15 static const Float_t gkErrElectronicPedRms; // The error of the pure electronic component of the RMS
16 static const Float_t gkFFactor; // The laboratory F-factor of the PMTs
17 static const Float_t gkFFactorError; // The laboratory F-factor Error of the PMTs
18 static const Float_t gkChargeLimit; // The limit (in units of PedRMS) for acceptance of the fitted mean charge
19 static const Float_t gkChargeErrLimit; // The limit (in units of PedRMS) for acceptance of the fitted charge sigma
20 static const Float_t gkChargeRelErrLimit; // The limit (in units of Error of fitted charge) for acceptance of the fitted mean
21 static const Float_t gkTimeLimit; // The limit (in units of FADC slices) for acceptance of the fitted time
22 static const Float_t gkTimeErrLimit; // The limit (in units of FADC slices) for acceptance of the fitted time sigma
23 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
24
25
26 Int_t fPixId; // the pixel Id
27
28 UInt_t fFlags; // Flag for the set Bits
29
30 Float_t fCharge; // The mean reduced charge after the fit
31 Float_t fErrCharge; // The error of reduced mean charge after the fit
32 Float_t fSigmaCharge; // The sigma of the mean charge after the fit
33 Float_t fErrSigmaCharge; // The error of the sigma of the mean charge after the fit
34 Float_t fRSigmaCharge; // The reduced squares of sigmas after the fit
35 Float_t fErrRSigmaCharge; // The reduced squares of sigmas after the fit
36 Float_t fChargeProb; // The probability of the fit function
37
38 Float_t fPed; // The mean pedestal (from MPedestalPix)
39 Float_t fPedRms; // The pedestal RMS (from MPedestalPix)
40 Float_t fErrPedRms; // The error of the pedestal RMS (from MPedestalPix)
41
42 Float_t fMeanTimeOffset; // The mean relative arrival time offset after the fit
43 Float_t fMeanTimeOffsetError; // The mean relative arrival time offset error after the fit
44 Float_t fTimingPrecision; // The error of the mean arrival time after the fit
45 Float_t fTimeProb; // The probability of the fit function
46
47 Float_t fAbsTimeMean;
48 Float_t fAbsTimeMeanErr;
49 Float_t fAbsTimeRms;
50
51 Byte_t fTimeFirstHiGain; // The first used FADC slice
52 Byte_t fTimeLastHiGain; // The last used FADC slice
53
54 Byte_t fTimeFirstLoGain; // The first used FADC slice
55 Byte_t fTimeLastLoGain; // The last used FADC slice
56
57 Float_t fPheFFactorMethod; // The number of Phe's calculated (F-factor method)
58 Float_t fPheFFactorMethodError; // The error on the number of Phe's calculated (F-factor method)
59
60 Float_t fMeanConversionFFactorMethod; // The conversion factor to Phe's (F-factor method)
61 Float_t fMeanConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
62 Float_t fMeanConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method)
63
64 Float_t fErrorConversionFFactorMethod; // The error of the conversion factor to Phe's (F-factor method)
65 Float_t fErrorConversionBlindPixelMethod; // The error of the conversion factor to Ph's (Blind Pixel method)
66 Float_t fErrorConversionPINDiodeMethod; // The error of the conversion factor to Ph's (PIN Diode method)
67
68 Float_t fSigmaConversionFFactorMethod; // The sigma of conversion factor to Phe's (F-factor method)
69 Float_t fSigmaConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
70 Float_t fSigmaConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method)
71
72 Float_t fTotalFFactor; // The F-Factor of the total readout system (Sigma(out)/mean(out)*Mean(in)/sigma(in)
73 Float_t fTotalFFactorError; // The error on the F-Factor of the total readout system
74
75 Float_t fConversionHiLo; // The conversion factor between Hi Gain and Lo Gain
76 Float_t fConversionHiLoError; // The error of the conversion factor between Hi Gain and Lo Gain
77
78 Float_t fNumHiGainSamples;
79 Float_t fNumLoGainSamples;
80
81 Bool_t fFactorCalculated;
82
83 enum { kHiGainSaturation,
84 kExcluded, kExcludeQualityCheck,
85 kChargeFitValid, kTimeFitValid,
86 kFitted,
87 kBlindPixelMethodValid, kFFactorMethodValid, kPINDiodeMethodValid };
88
89 MHCalibrationPixel *fHist; // Pointer to the histograms performing the fits, etc.
90
91 Bool_t CheckChargeFitValidity();
92 Bool_t CheckTimeFitValidity();
93 Bool_t CheckOscillations();
94
95 Bool_t CalcFFactorMethod();
96
97public:
98
99 MCalibrationPix(const char *name=NULL, const char *title=NULL);
100 ~MCalibrationPix();
101
102 void Clear(Option_t *o="");
103
104 // Getter
105 MHCalibrationPixel *GetHist() const { return fHist; }
106
107 // Charges
108 Float_t GetCharge() const { return fCharge; }
109 Float_t GetErrCharge() const { return fErrCharge; }
110 Float_t GetChargeProb() const { return fChargeProb; }
111 Float_t GetSigmaCharge() const { return fSigmaCharge; }
112 Float_t GetErrSigmaCharge() const { return fErrSigmaCharge; }
113 Float_t GetRSigmaCharge() const { return fRSigmaCharge; }
114 Float_t GetErrRSigmaCharge() const { return fErrRSigmaCharge; }
115
116 // Times
117 Float_t GetMeanTimeOffset() const { return fMeanTimeOffset; }
118 Float_t GetMeanTimeOffsetError() const { return fMeanTimeOffsetError; }
119 Float_t GetTimingPrecision() const { return fTimingPrecision; }
120 Float_t GetTimingPrecisionError() const;
121 Float_t GetTimeProb() const { return fTimeProb; }
122
123 Float_t GetAbsTimeMean() const { return fAbsTimeMean; }
124 Float_t GetAbsTimeMeanErr() const { return fAbsTimeMeanErr; }
125 Float_t GetAbsTimeRms() const { return fAbsTimeRms; }
126
127 // Conversion Factors
128 Float_t GetConversionHiLo() const { return fConversionHiLo; }
129 Float_t GetConversionHiLoError() const { return fConversionHiLoError; }
130
131 Float_t GetMeanConversionBlindPixelMethod() const { return fMeanConversionBlindPixelMethod ; }
132 Float_t GetErrorConversionBlindPixelMethod() const { return fErrorConversionBlindPixelMethod ; }
133 Float_t GetSigmaConversionBlindPixelMethod() const { return fSigmaConversionBlindPixelMethod ; }
134
135 Float_t GetMeanConversionFFactorMethod();
136 Float_t GetErrorConversionFFactorMethod();
137 Float_t GetSigmaConversionFFactorMethod();
138
139 Float_t GetMeanConversionPINDiodeMethod() const { return fMeanConversionPINDiodeMethod ; }
140 Float_t GetErrorConversionPINDiodeMethod() const { return fErrorConversionPINDiodeMethod ; }
141 Float_t GetSigmaConversionPINDiodeMethod() const { return fSigmaConversionPINDiodeMethod ; }
142
143 Float_t GetPheFFactorMethod();
144 Float_t GetPheFFactorMethodError();
145
146 Int_t GetPixId() const { return fPixId; }
147
148 Float_t GetPed() const { return fPed; }
149 Float_t GetPedRms() const { return fPedRms; }
150
151 Float_t GetTotalFFactor();
152 Float_t GetTotalFFactorError();
153
154 Bool_t IsExcluded() const;
155 Bool_t IsChargeFitValid() const;
156 Bool_t IsTimeFitValid() const;
157 Bool_t IsFitted() const;
158 Bool_t IsBlindPixelMethodValid() const;
159 Bool_t IsPINDiodeMethodValid() const;
160 Bool_t IsFFactorMethodValid();
161
162 // Setter
163 void SetPedestal(Float_t ped, Float_t pedrms, Float_t higainsamp, Float_t logainsamp);
164 void SetConversionHiLo(Float_t c) { fConversionHiLo = c; }
165 void SetConversionHiLoError(Float_t e) { fConversionHiLoError = e; }
166
167 // Setters for MC
168 void SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig);
169 void SetConversionBlindPixelMethod(Float_t c, Float_t err, Float_t sig);
170 void SetConversionPINDiodeMethod(Float_t c, Float_t err, Float_t sig);
171
172 // Bit Setters
173 void SetHiGainSaturation(Bool_t b = kTRUE);
174 void SetExcluded(Bool_t b = kTRUE);
175 void SetExcludeQualityCheck(Bool_t b = kTRUE);
176 void SetChargeFitValid(Bool_t b = kTRUE);
177 void SetTimeFitValid(Bool_t b = kTRUE);
178 void SetFitted(Bool_t b = kTRUE);
179 void SetBlindPixelMethodValid(Bool_t b = kTRUE);
180 void SetFFactorMethodValid(Bool_t b = kTRUE);
181 void SetPINDiodeMethodValid(Bool_t b = kTRUE);
182 void SetAbsTimeBordersHiGain(Byte_t f, Byte_t l);
183 void SetAbsTimeBordersLoGain(Byte_t f, Byte_t l);
184
185 // Fill histos
186 Bool_t FillChargeHiGain(Float_t q) const { return fHist->FillChargeHiGain(q); }
187 Bool_t FillAbsTimeHiGain(Float_t t) const { return fHist->FillAbsTimeHiGain(t); }
188 Bool_t FillRelTimeHiGain(Float_t t) const { return fHist->FillRelTimeHiGain(t); }
189 Bool_t FillRChargevsTimeHiGain(Float_t rq, Int_t t) const { return fHist->FillChargevsNHiGain(rq,t); }
190
191 Bool_t FillChargeLoGain(Float_t q) const { return fHist->FillChargeLoGain(q); }
192 Bool_t FillAbsTimeLoGain(Float_t t) const { return fHist->FillAbsTimeLoGain(t); }
193 Bool_t FillRelTimeLoGain(Float_t t) const { return fHist->FillRelTimeLoGain(t); }
194 Bool_t FillRChargevsTimeLoGain(Float_t rq, Int_t t) const { return fHist->FillChargevsNLoGain(rq,t); }
195
196 Bool_t FillChargesInGraph(Float_t qhi,Float_t qlo) const { return fHist->FillPointInGraph(qhi,qlo); }
197
198 void DefinePixId(Int_t i);
199
200 // Fits
201 Bool_t FitCharge();
202 Bool_t FitTime();
203
204 // Draws
205 void Draw(Option_t *opt="") { fHist->Draw(opt); }
206 TObject *DrawClone(Option_t *opt="") const { return fHist->DrawClone(opt); }
207
208 // Miscellaneous
209 void ApplyLoGainConversion();
210
211 ClassDef(MCalibrationPix, 1) // Storage Container for Calibration information of one pixel
212};
213
214#endif
215
Note: See TracBrowser for help on using the repository browser.