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

Last change on this file since 2872 was 2852, checked in by gaug, 21 years ago
*** empty log message ***
File size: 8.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 Int_t fPixId; // the pixel Id
15
16 Float_t fCharge; // The mean reduced charge after the fit
17 Float_t fErrCharge; // The error of reduced mean charge after the fit
18 Float_t fSigmaCharge; // The sigma of the mean charge after the fit
19 Float_t fErrSigmaCharge; // The error of the sigma of the mean charge after the fit
20 Float_t fRSigmaSquare; // The reduced squares of sigmas after the fit
21 Float_t fChargeProb; // The probability of the fit function
22
23 Float_t fPed; // The mean pedestal (from MPedestalPix)
24 Float_t fPedRms; // The pedestal RMS (from MPedestalPix)
25 Float_t fErrPedRms; // The error of the pedestal RMS (from MPedestalPix)
26 Float_t fElectronicPedRms; // The pure electronic component of the RMS
27 Float_t fErrElectronicPedRms; // The error of the pure electronic component of the RMS
28
29 Float_t fTime; // The mean arrival time after the fit
30 Float_t fSigmaTime; // The error of the mean arrival time after the fit
31 Float_t fTimeChiSquare; // The Chi Square of the fit function
32 Float_t fTimeProb; // The probability of the fit function
33
34 Float_t fFactor; // The laboratory F-factor
35 Float_t fFactorError; // The laboratory F-factor Error
36 Float_t fPheFFactorMethod; // The number of Phe's calculated (F-factor method)
37 Float_t fPheFFactorMethodError; // The error on the number of Phe's calculated (F-factor method)
38
39 Float_t fConversionFFactorMethod; // The conversion factor to Phe's (F-factor method)
40 Float_t fConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
41 Float_t fConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method)
42
43 Float_t fConversionErrorFFactorMethod; // The error of the conversion factor to Phe's (F-factor method)
44 Float_t fConversionErrorBlindPixelMethod; // The error of the conversion factor to Ph's (Blind Pixel method)
45 Float_t fConversionErrorPINDiodeMethod; // The error of the conversion factor to Ph's (PIN Diode method)
46
47 Float_t fConversionSigmaFFactorMethod; // The sigma of conversion factor to Ph's (F-factor method)
48 Float_t fConversionSigmaBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
49 Float_t fConversionSigmaPINDiodeMethod; // The conversion factor to Phd's (PIN Diode method)
50
51 Float_t fConversionHiLo; // The conversion factor between Hi Gain and Lo Gain
52 Float_t fConversionHiLoError; // The error of the conversion factor between Hi Gain and Lo Gain
53
54 Bool_t fHiGainSaturation; // Is Lo-Gain used at all?
55
56 Bool_t fExcluded;
57 Bool_t fFitValid;
58 Bool_t fFitted;
59 Bool_t fBlindPixelMethodValid;
60 Bool_t fFFactorMethodValid;
61 Bool_t fPINDiodeMethodValid;
62
63 MHCalibrationPixel *fHist; //! Pointer to the histograms performing the fits, etc.
64
65 Float_t fChargeLimit;
66 Float_t fChargeErrLimit;
67
68 Bool_t CheckChargeFitValidity();
69 Bool_t CheckTimeFitValidity();
70 Bool_t CheckOscillations();
71
72public:
73
74 MCalibrationPix(const char *name=NULL, const char *title=NULL);
75 ~MCalibrationPix();
76
77 void Clear(Option_t *o="");
78
79 // Getter
80 Bool_t IsExcluded() const { return fExcluded; }
81 Bool_t IsFitValid() const { return fFitValid; }
82 Bool_t IsFitted() const { return fFitted; }
83 Bool_t IsBlindPixelMethodValid() const { return fBlindPixelMethodValid; }
84 Bool_t IsFFactorMethodValid() const { return fFFactorMethodValid; }
85 Bool_t IsPINDiodeMethodValid() const { return fPINDiodeMethodValid; }
86
87 // Charges
88 Float_t GetCharge() const { return fCharge; }
89 Float_t GetErrCharge() const { return fErrCharge; }
90 Float_t GetChargeProb() const { return fChargeProb; }
91 Float_t GetSigmaCharge() const { return fSigmaCharge; }
92 Float_t GetErrSigmaCharge() const { return fErrSigmaCharge; }
93 Float_t GetRSigmaSquare() const { return fRSigmaSquare; }
94
95 // Times
96 Float_t GetTime() const { return fTime; }
97 Float_t GetSigmaTime() const { return fSigmaTime; }
98 Float_t GetTimeChiSquare() const { return fTimeChiSquare; }
99 Float_t GetTimeProb() const { return fTimeProb; }
100
101 Float_t GetConversionHiLo() const { return fConversionHiLo; }
102 Float_t GetConversionHiLoError() const { return fConversionHiLoError; }
103
104 Float_t GetMeanConversionBlindPixelMethod() const { return fConversionBlindPixelMethod ; }
105 Float_t GetErrorConversionBlindPixelMethod() const { return fConversionErrorBlindPixelMethod ; }
106 Float_t GetSigmaConversionBlindPixelMethod() const { return fConversionSigmaBlindPixelMethod ; }
107
108 Float_t GetMeanConversionFFactorMethod() const { return fConversionFFactorMethod ; }
109 Float_t GetErrorConversionFFactorMethod() const { return fConversionErrorFFactorMethod ; }
110 Float_t GetSigmaConversionFFactorMethod() const { return fConversionSigmaFFactorMethod ; }
111
112 Float_t GetPheFFactorMethod() const { return fPheFFactorMethod; }
113 Float_t GetPheFFactorMethodError() const { return fPheFFactorMethodError; }
114
115 Float_t GetMeanConversionPINDiodeMethod() const { return fConversionPINDiodeMethod ; }
116 Float_t GetErrorConversionPINDiodeMethod() const { return fConversionErrorPINDiodeMethod ; }
117 Float_t GetSigmaConversionPINDiodeMethod() const { return fConversionSigmaPINDiodeMethod ; }
118
119 // FIXME: Remove this from stored data members
120 Float_t GetPed() const { return fPed; }
121 Float_t GetPedRms() const { return fPedRms; }
122
123 // Setter
124 void SetPedestal(Float_t ped, Float_t pedrms);
125 void SetHiGainSaturation() { fHiGainSaturation = kTRUE; fHist->SetUseLoGain(); }
126
127 void SetConversionHiLo(Float_t c) { fConversionHiLo = c; }
128 void SetConversionHiLoError(Float_t e) { fConversionHiLoError = e; }
129
130 void SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig)
131 {
132 fConversionFFactorMethod = c;
133 fConversionErrorFFactorMethod = err;
134 fConversionSigmaFFactorMethod = sig;
135 }
136 void SetConversionBlindPixelMethod(Float_t c, Float_t err, Float_t sig)
137 {
138 fConversionBlindPixelMethod = c;
139 fConversionErrorBlindPixelMethod = err;
140 fConversionSigmaBlindPixelMethod = sig;
141 }
142
143 void SetConversionPINDiodeMethod(Float_t c, Float_t err, Float_t sig)
144 {
145 fConversionPINDiodeMethod = c ;
146 fConversionErrorPINDiodeMethod = err;
147 fConversionSigmaPINDiodeMethod = sig;
148 }
149
150 void SetExcluded(Bool_t b = kTRUE) { fExcluded = b; }
151 void SetFitValid(Bool_t b = kTRUE) { fFitValid = b; }
152 void SetFitted(Bool_t b = kTRUE) { fFitted = b; }
153 void SetBlindPixelMethodValid(Bool_t b = kTRUE) { fBlindPixelMethodValid = b; }
154 void SetFFactorMethodValid(Bool_t b = kTRUE) { fFFactorMethodValid = b; }
155 void SetPINDiodeMethodValid(Bool_t b = kTRUE) { fPINDiodeMethodValid = b; }
156
157 // Unknown
158 void ApplyLoGainConversion();
159
160 void SetChargesInGraph(Float_t qhi,Float_t qlo) { fHist->SetPointInGraph(qhi,qlo); }
161
162 Bool_t FillChargeHiGain(Float_t q) { return fHist->FillChargeHiGain(q); }
163 Bool_t FillTimeHiGain(Int_t t) { return fHist->FillTimeHiGain(t); }
164 Bool_t FillRChargevsTimeHiGain(Float_t rq, Int_t t) { return fHist->FillChargevsNHiGain(rq,t); }
165
166 Bool_t FillChargeLoGain(Float_t q) { return fHist->FillChargeLoGain(q); }
167 Bool_t FillTimeLoGain(Int_t t) { return fHist->FillTimeLoGain(t); }
168 Bool_t FillRChargevsTimeLoGain(Float_t rq, Int_t t) { return fHist->FillChargevsNLoGain(rq,t); }
169
170 // FIXME: Not necessary -> pixidx (not id anyhow!) == index in array!
171 // Only needed n histograms which have to move to an MH-class anyhow!
172 Int_t GetPixId() const { return fPixId; }
173 void DefinePixId(Int_t i);
174
175 Bool_t FitCharge();
176 Bool_t FitTime();
177
178 MHCalibrationPixel *GetHist() const { return fHist; }
179 void Draw(Option_t *opt="") { fHist->Draw(opt); }
180
181 ClassDef(MCalibrationPix, 1) // Storage Container for Calibration information of one pixel
182};
183
184#endif
185
Note: See TracBrowser for help on using the repository browser.