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

Last change on this file since 2777 was 2764, checked in by gaug, 21 years ago
*** empty log message ***
File size: 8.4 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 fFitValid;
57 Bool_t fFitted;
58 Bool_t fBlindPixelMethodValid;
59 Bool_t fFFactorMethodValid;
60 Bool_t fPINDiodeMethodValid;
61
62 MHCalibrationPixel *fHist; //! Pointer to the histograms performing the fits, etc.
63
64 Bool_t CheckChargeFitValidity();
65 Bool_t CheckTimeFitValidity();
66
67public:
68
69 MCalibrationPix(const char *name=NULL, const char *title=NULL);
70 ~MCalibrationPix();
71
72 void Clear(Option_t *o="");
73
74 // Getter
75 Bool_t IsFitValid() const { return fFitValid; }
76 Bool_t IsFitted() const { return fFitted; }
77 Bool_t IsBlindPixelMethodValid() const { return fBlindPixelMethodValid; }
78 Bool_t IsFFactorMethodValid() const { return fFFactorMethodValid; }
79 Bool_t IsPINDiodeMethodValid() const { return fPINDiodeMethodValid; }
80
81 // Charges
82 Float_t GetCharge() const { return fCharge; }
83 Float_t GetErrCharge() const { return fErrCharge; }
84 Float_t GetChargeProb() const { return fChargeProb; }
85 Float_t GetSigmaCharge() const { return fSigmaCharge; }
86 Float_t GetErrSigmaCharge() const { return fErrSigmaCharge; }
87 Float_t GetRSigmaSquare() const { return fRSigmaSquare; }
88
89 // Times
90 Float_t GetTime() const { return fTime; }
91 Float_t GetSigmaTime() const { return fSigmaTime; }
92 Float_t GetTimeChiSquare() const { return fTimeChiSquare; }
93 Float_t GetTimeProb() const { return fTimeProb; }
94
95 Float_t GetConversionHiLo() const { return fConversionHiLo; }
96 Float_t GetConversionHiLoError() const { return fConversionHiLoError; }
97
98 Float_t GetMeanConversionBlindPixelMethod() const { return fConversionBlindPixelMethod ; }
99 Float_t GetErrorConversionBlindPixelMethod() const { return fConversionErrorBlindPixelMethod ; }
100 Float_t GetSigmaConversionBlindPixelMethod() const { return fConversionSigmaBlindPixelMethod ; }
101
102 Float_t GetMeanConversionFFactorMethod() const { return fConversionFFactorMethod ; }
103 Float_t GetErrorConversionFFactorMethod() const { return fConversionErrorFFactorMethod ; }
104 Float_t GetSigmaConversionFFactorMethod() const { return fConversionSigmaFFactorMethod ; }
105
106 Float_t GetPheFFactorMethod() const { return fPheFFactorMethod; }
107 Float_t GetPheFFactorMethodError() const { return fPheFFactorMethodError; }
108
109 Float_t GetMeanConversionPINDiodeMethod() const { return fConversionPINDiodeMethod ; }
110 Float_t GetErrorConversionPINDiodeMethod() const { return fConversionErrorPINDiodeMethod ; }
111 Float_t GetSigmaConversionPINDiodeMethod() const { return fConversionSigmaPINDiodeMethod ; }
112
113 // FIXME: Remove this from stored data members
114 Float_t GetPed() const { return fPed; }
115 Float_t GetPedRms() const { return fPedRms; }
116
117 // Setter
118 void SetPedestal(Float_t ped, Float_t pedrms);
119 void SetHiGainSaturation() { fHiGainSaturation = kTRUE; fHist->SetUseLoGain(); }
120
121 void SetConversionHiLo(Float_t c) { fConversionHiLo = c; }
122 void SetConversionHiLoError(Float_t e) { fConversionHiLoError = e; }
123
124 void SetConversionFFactorMethod(Float_t c, Float_t err, Float_t sig)
125 {
126 fConversionFFactorMethod = c;
127 fConversionErrorFFactorMethod = err;
128 fConversionSigmaFFactorMethod = sig;
129 }
130 void SetConversionBlindPixelMethod(Float_t c, Float_t err, Float_t sig)
131 {
132 fConversionBlindPixelMethod = c;
133 fConversionErrorBlindPixelMethod = err;
134 fConversionSigmaBlindPixelMethod = sig;
135 }
136
137 void SetConversionPINDiodeMethod(Float_t c, Float_t err, Float_t sig)
138 {
139 fConversionPINDiodeMethod = c ;
140 fConversionErrorPINDiodeMethod = err;
141 fConversionSigmaPINDiodeMethod = sig;
142 }
143
144 void SetFitValid() { fFitValid = kTRUE; }
145 void SetFitted() { fFitted = kTRUE; }
146 void SetBlindPixelMethodValid(Bool_t b=kTRUE) { fBlindPixelMethodValid = b; }
147 void SetFFactorMethodValid(Bool_t b=kTRUE) { fFFactorMethodValid = b; }
148 void SetPINDiodeMethodValid(Bool_t b=kTRUE) { fPINDiodeMethodValid = b; }
149
150 // Unknown
151 void ApplyLoGainConversion();
152
153 void SetChargesInGraph(Float_t qhi,Float_t qlo) { fHist->SetPointInGraph(qhi,qlo); }
154
155 Bool_t FillChargeHiGain(Float_t q) { return fHist->FillChargeHiGain(q); }
156 Bool_t FillTimeHiGain(Int_t t) { return fHist->FillTimeHiGain(t); }
157 Bool_t FillRChargevsTimeHiGain(Float_t rq, Int_t t) { return fHist->FillChargevsNHiGain(rq,t); }
158
159 Bool_t FillChargeLoGain(Float_t q) { return fHist->FillChargeLoGain(q); }
160 Bool_t FillTimeLoGain(Int_t t) { return fHist->FillTimeLoGain(t); }
161 Bool_t FillRChargevsTimeLoGain(Float_t rq, Int_t t) { return fHist->FillChargevsNLoGain(rq,t); }
162
163 // FIXME: Not necessary -> pixidx (not id anyhow!) == index in array!
164 // Only needed n histograms which have to move to an MH-class anyhow!
165 Int_t GetPixId() const { return fPixId; }
166 void DefinePixId(Int_t i);
167
168 Bool_t FitCharge();
169 Bool_t FitTime();
170
171 MHCalibrationPixel *GetHist() const { return fHist; }
172 void Draw(Option_t *opt="") { fHist->Draw(opt); }
173
174 ClassDef(MCalibrationPix, 1) // Storage Container for Calibration information of one pixel
175};
176
177#endif
178
Note: See TracBrowser for help on using the repository browser.