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 |
|
---|
10 | class MCalibrationPix : public MParContainer
|
---|
11 | {
|
---|
12 | private:
|
---|
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 fAbsTimeMean;
|
---|
43 | Float_t fAbsTimeMeanErr;
|
---|
44 | Float_t fAbsTimeRms;
|
---|
45 |
|
---|
46 | Byte_t fTimeFirstHiGain; // The first used FADC slice
|
---|
47 | Byte_t fTimeLastHiGain; // The last used FADC slice
|
---|
48 |
|
---|
49 | Byte_t fTimeFirstLoGain; // The first used FADC slice
|
---|
50 | Byte_t fTimeLastLoGain; // The last used FADC slice
|
---|
51 |
|
---|
52 | Float_t fPheFFactorMethod; // The number of Phe's calculated (F-factor method)
|
---|
53 | Float_t fPheFFactorMethodError; // The error on the number of Phe's calculated (F-factor method)
|
---|
54 |
|
---|
55 | Float_t fMeanConversionFFactorMethod; // The conversion factor to Phe's (F-factor method)
|
---|
56 | Float_t fMeanConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
|
---|
57 | Float_t fMeanConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method)
|
---|
58 |
|
---|
59 | Float_t fErrorConversionFFactorMethod; // The error of the conversion factor to Phe's (F-factor method)
|
---|
60 | Float_t fErrorConversionBlindPixelMethod; // The error of the conversion factor to Ph's (Blind Pixel method)
|
---|
61 | Float_t fErrorConversionPINDiodeMethod; // The error of the conversion factor to Ph's (PIN Diode method)
|
---|
62 |
|
---|
63 | Float_t fSigmaConversionFFactorMethod; // The sigma of conversion factor to Phe's (F-factor method)
|
---|
64 | Float_t fSigmaConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
|
---|
65 | Float_t fSigmaConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method)
|
---|
66 |
|
---|
67 | Float_t fTotalFFactor; // The F-Factor of the total readout system (Sigma(out)/mean(out)*Mean(in)/sigma(in)
|
---|
68 | Float_t fTotalFFactorError; // The error on the F-Factor of the total readout system
|
---|
69 |
|
---|
70 | Float_t fConversionHiLo; // The conversion factor between Hi Gain and Lo Gain
|
---|
71 | Float_t fConversionHiLoError; // The error of the conversion factor between Hi Gain and Lo Gain
|
---|
72 |
|
---|
73 | Float_t fNumHiGainSamples;
|
---|
74 | Float_t fNumLoGainSamples;
|
---|
75 |
|
---|
76 | Bool_t fFactorCalculated;
|
---|
77 |
|
---|
78 | enum { kHiGainSaturation,
|
---|
79 | kExcluded, kExcludeQualityCheck,
|
---|
80 | kChargeFitValid, kTimeFitValid,
|
---|
81 | kFitted, kOscillating,
|
---|
82 | kBlindPixelMethodValid, kFFactorMethodValid, kPINDiodeMethodValid };
|
---|
83 |
|
---|
84 | MHCalibrationPixel *fHist; // Pointer to the histograms performing the fits, etc.
|
---|
85 |
|
---|
86 | Bool_t CheckChargeFitValidity();
|
---|
87 | Bool_t CheckTimeFitValidity();
|
---|
88 | Bool_t CalcFFactorMethod();
|
---|
89 |
|
---|
90 | public:
|
---|
91 |
|
---|
92 | MCalibrationPix(const char *name=NULL, const char *title=NULL);
|
---|
93 | ~MCalibrationPix();
|
---|
94 |
|
---|
95 | void Clear(Option_t *o="");
|
---|
96 |
|
---|
97 | // Getter
|
---|
98 | MHCalibrationPixel *GetHist() const { return fHist; }
|
---|
99 |
|
---|
100 | // Charges
|
---|
101 | Float_t GetCharge() const { return fCharge; }
|
---|
102 | Float_t GetErrCharge() const { return fErrCharge; }
|
---|
103 | Float_t GetChargeProb() const { return fChargeProb; }
|
---|
104 | Float_t GetSigmaCharge() const { return fSigmaCharge; }
|
---|
105 | Float_t GetErrSigmaCharge() const { return fErrSigmaCharge; }
|
---|
106 | Float_t GetRSigmaCharge() const { return fRSigmaCharge; }
|
---|
107 | Float_t GetErrRSigmaCharge() const { return fErrRSigmaCharge; }
|
---|
108 |
|
---|
109 |
|
---|
110 | Float_t GetAbsTimeMean() const { return fAbsTimeMean; }
|
---|
111 | Float_t GetAbsTimeMeanErr() const { return fAbsTimeMeanErr; }
|
---|
112 | Float_t GetAbsTimeRms() const { return fAbsTimeRms; }
|
---|
113 |
|
---|
114 | // Conversion Factors
|
---|
115 | Float_t GetConversionHiLo() const { return fConversionHiLo; }
|
---|
116 | Float_t GetConversionHiLoError() const { return fConversionHiLoError; }
|
---|
117 |
|
---|
118 | Float_t GetMeanConversionBlindPixelMethod() const { return fMeanConversionBlindPixelMethod ; }
|
---|
119 | Float_t GetErrorConversionBlindPixelMethod() const { return fErrorConversionBlindPixelMethod ; }
|
---|
120 | Float_t GetSigmaConversionBlindPixelMethod() const { return fSigmaConversionBlindPixelMethod ; }
|
---|
121 |
|
---|
122 | Float_t GetMeanConversionFFactorMethod();
|
---|
123 | Float_t GetErrorConversionFFactorMethod();
|
---|
124 | Float_t GetSigmaConversionFFactorMethod();
|
---|
125 |
|
---|
126 | Float_t GetMeanConversionPINDiodeMethod() const { return fMeanConversionPINDiodeMethod ; }
|
---|
127 | Float_t GetErrorConversionPINDiodeMethod() const { return fErrorConversionPINDiodeMethod ; }
|
---|
128 | Float_t GetSigmaConversionPINDiodeMethod() const { return fSigmaConversionPINDiodeMethod ; }
|
---|
129 |
|
---|
130 | Float_t GetPheFFactorMethod();
|
---|
131 | Float_t GetPheFFactorMethodError();
|
---|
132 |
|
---|
133 | Int_t GetPixId() const { return fPixId; }
|
---|
134 |
|
---|
135 | Float_t GetPed() const { return fPed; }
|
---|
136 | Float_t GetPedRms() const { return fPedRms; }
|
---|
137 |
|
---|
138 | Float_t GetTotalFFactorFFactorMethod();
|
---|
139 | Float_t GetTotalFFactorErrorFFactorMethod();
|
---|
140 |
|
---|
141 | Float_t GetTotalFFactorBlindPixelMethod();
|
---|
142 | Float_t GetTotalFFactorErrorBlindPixelMethod();
|
---|
143 |
|
---|
144 | Float_t GetTotalFFactorPINDiodeMethod();
|
---|
145 | Float_t GetTotalFFactorErrorPINDiodeMethod();
|
---|
146 |
|
---|
147 | Bool_t IsExcluded() const;
|
---|
148 | Bool_t IsExcludeQualityCheck() const;
|
---|
149 | Bool_t IsHiGainSaturation() const;
|
---|
150 | Bool_t IsChargeFitValid() const;
|
---|
151 | Bool_t IsFitted() const;
|
---|
152 | Bool_t IsOscillating();
|
---|
153 | Bool_t IsBlindPixelMethodValid() const;
|
---|
154 | Bool_t IsPINDiodeMethodValid() const;
|
---|
155 | Bool_t IsFFactorMethodValid();
|
---|
156 |
|
---|
157 | // Setter
|
---|
158 | void SetPedestal(Float_t ped, Float_t pedrms, Float_t higainsamp, Float_t logainsamp);
|
---|
159 | void SetConversionHiLo(Float_t c) { fConversionHiLo = c; }
|
---|
160 | void SetConversionHiLoError(Float_t e) { fConversionHiLoError = e; }
|
---|
161 |
|
---|
162 | // Setters for MC
|
---|
163 | void SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig);
|
---|
164 | void SetConversionBlindPixelMethod(Float_t c, Float_t err, Float_t sig);
|
---|
165 | void SetConversionPINDiodeMethod(Float_t c, Float_t err, Float_t sig);
|
---|
166 |
|
---|
167 | // Bit Setters
|
---|
168 | void SetHiGainSaturation(Bool_t b = kTRUE);
|
---|
169 | void SetExcluded(Bool_t b = kTRUE);
|
---|
170 | void SetExcludeQualityCheck(Bool_t b = kTRUE);
|
---|
171 | void SetChargeFitValid(Bool_t b = kTRUE);
|
---|
172 | void SetFitted(Bool_t b = kTRUE);
|
---|
173 | void SetOscillating(Bool_t b = kTRUE);
|
---|
174 | void SetBlindPixelMethodValid(Bool_t b = kTRUE);
|
---|
175 | void SetFFactorMethodValid(Bool_t b = kTRUE);
|
---|
176 | void SetPINDiodeMethodValid(Bool_t b = kTRUE);
|
---|
177 | void SetAbsTimeBordersHiGain(Byte_t f, Byte_t l);
|
---|
178 | void SetAbsTimeBordersLoGain(Byte_t f, Byte_t l);
|
---|
179 |
|
---|
180 | // Fill histos
|
---|
181 | Bool_t FillChargeHiGain(Float_t q) const { return fHist->FillChargeHiGain(q); }
|
---|
182 | Bool_t FillAbsTimeHiGain(Float_t t) const { return fHist->FillAbsTimeHiGain(t); }
|
---|
183 |
|
---|
184 | Bool_t FillChargeLoGain(Float_t q) const { return fHist->FillChargeLoGain(q); }
|
---|
185 | Bool_t FillAbsTimeLoGain(Float_t t) const { return fHist->FillAbsTimeLoGain(t); }
|
---|
186 |
|
---|
187 | Bool_t FillGraphs(Float_t qhi,Float_t qlo) const { return fHist->FillGraphs(qhi,qlo); }
|
---|
188 |
|
---|
189 | void DefinePixId(Int_t i);
|
---|
190 |
|
---|
191 | // Fits
|
---|
192 | Bool_t FitCharge();
|
---|
193 |
|
---|
194 | // Draws
|
---|
195 | void Draw(Option_t *opt="") { fHist->Draw(opt); }
|
---|
196 | TObject *DrawClone(Option_t *opt="") const { return fHist->DrawClone(opt); }
|
---|
197 |
|
---|
198 | // Miscellaneous
|
---|
199 | void ApplyLoGainConversion();
|
---|
200 | void CheckOscillations();
|
---|
201 |
|
---|
202 | ClassDef(MCalibrationPix, 1) // Container for Calibration of one pixel
|
---|
203 | };
|
---|
204 |
|
---|
205 | #endif
|
---|
206 |
|
---|