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

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