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

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