1 | #ifndef MARS_MCalibrationChargePix
|
---|
2 | #define MARS_MCalibrationChargePix
|
---|
3 |
|
---|
4 | #ifndef MARS_MCalibrationPix
|
---|
5 | #include "MCalibrationPix.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class MCalibrationChargePix : public MCalibrationPix
|
---|
9 | {
|
---|
10 | private:
|
---|
11 |
|
---|
12 | static const Float_t gkElectronicPedRms; //! Electronic component of ped. RMS from opt. receiver on (now set to: 1.)
|
---|
13 | static const Float_t gkElectronicPedRmsErr; //! Error Electr. component ped. RMS (now set to: 0.35)
|
---|
14 | static const Float_t gkFFactor; //! Laboratory F-factor PMTs (now set to: 1.15)
|
---|
15 | static const Float_t gkFFactorErr; //! Laboratory F-factor Error PMTs (now set to: 0.02)
|
---|
16 |
|
---|
17 | static const Float_t fgConversionHiLo; //! Default fConversionHiLo (now set to: 10.)
|
---|
18 | static const Float_t fgConversionHiLoErr; //! Default fConversionHiLoVar (now set to: 2.5)
|
---|
19 | static const Float_t fgConversionHiLoSigma; //! Default fConversionHiLoSigma (now set to: 2.5)
|
---|
20 | static const Float_t fgPheFFactorMethodLimit; //! Default fPheFFactorMethodLimit (now set to: 5.)
|
---|
21 | static const Float_t fgConvFFactorRelErrLimit; //! Default fConvFFactorRelErrLimit (now set to: 0.35)
|
---|
22 |
|
---|
23 | Float_t fAbsTimeMean; // Mean Absolute Arrival Time
|
---|
24 | Float_t fAbsTimeRms; // RMS Mean Absolute Arrival Time
|
---|
25 | Byte_t fCalibFlags; // Bit-field for the class-own bits
|
---|
26 | Float_t fConversionHiLo; // Conversion factor betw. Hi Gain and Lo Gain
|
---|
27 | Float_t fConversionHiLoVar; // Variance Conversion factor betw. Hi and Lo Gain
|
---|
28 | Float_t fConversionHiLoSigma; // Sigma of conversion factor betw. Hi and Lo Gain
|
---|
29 | Float_t fConvFFactorRelVarLimit; // Limit for acceptance rel. variance Conversion FADC2Phe
|
---|
30 | Float_t fLoGainPedRmsSquare; // Pedestal RMS square of Low Gain
|
---|
31 | Float_t fLoGainPedRmsSquareVar; // Pedestal RMS square Variance of Low Gain
|
---|
32 | Float_t fMeanConvFADC2Phe; // Conversion factor (F-factor method)
|
---|
33 | Float_t fMeanConvFADC2PheStatVar; // Variance conversion factor, only stat. error
|
---|
34 | Float_t fMeanConvFADC2PheSystVar; // Variance conversion factor, only syst. error
|
---|
35 | Float_t fMeanFFactorFADC2Phot; // Total mean F-Factor to photons (F-factor method)
|
---|
36 | Float_t fMeanFFactorFADC2PhotVar; // Variance mean F-Factor photons, only stat. error
|
---|
37 | Float_t fPed; // Pedestal (from MPedestalPix) times number FADC slices
|
---|
38 | Float_t fPedVar; // Variance of pedestal
|
---|
39 | Float_t fPedRms; // Pedestal RMS (from MPedestalPix) times sqrt nr. FADC slices
|
---|
40 | Float_t fPedRmsVar; // Pedestal RMS (from MPedestalPix) times sqrt nr. FADC slices
|
---|
41 | Float_t fPheFFactorMethod; // Number Phe's calculated with F-factor method)
|
---|
42 | Float_t fPheFFactorMethodStatVar; // Variance number of Phe's, only stat. error
|
---|
43 | Float_t fPheFFactorMethodSystVar; // Variance number of Phe's, only syst. error
|
---|
44 | Float_t fPheFFactorMethodLimit; // Min. number Photo-electrons for pix to be accepted.
|
---|
45 | Float_t fRSigmaSquare; // Square of Reduced sigma
|
---|
46 | Float_t fRSigmaSquareVar; // Variance Reduced sigma
|
---|
47 |
|
---|
48 | Int_t fNumSaturated; // Number of (high-gain) saturated events
|
---|
49 |
|
---|
50 | enum { kFFactorMethodValid }; // Possible bits to be set
|
---|
51 |
|
---|
52 | const Float_t GetElectronicPedRmsRelVar() const;
|
---|
53 | const Float_t GetConversionHiLoRelVar() const;
|
---|
54 | const Float_t GetFFactorRelVar() const;
|
---|
55 |
|
---|
56 | public:
|
---|
57 | MCalibrationChargePix(const char *name=NULL, const char *title=NULL);
|
---|
58 |
|
---|
59 | // TObject
|
---|
60 | void Clear(Option_t *o="");
|
---|
61 | void Copy(TObject& object) const;
|
---|
62 |
|
---|
63 | // Setter
|
---|
64 | /*
|
---|
65 | void SetConvFFactorRelErrLimit ( const Float_t f=fgConvFFactorRelErrLimit) { fConvFFactorRelVarLimit = f*f;}
|
---|
66 | void SetMeanConvFADC2Phe ( const Float_t f) { fMeanConvFADC2Phe = f; }
|
---|
67 | void SetMeanConvFADC2PheVar ( const Float_t f) { fMeanConvFADC2PheVar = f; }
|
---|
68 | void SetMeanFFactorFADC2Phot ( const Float_t f) { fMeanFFactorFADC2Phot = f; }
|
---|
69 | void SetPheFFactorMethod ( const Float_t f) { fPheFFactorMethod = f; }
|
---|
70 | void SetPheFFactorMethodVar ( const Float_t f) { fPheFFactorMethodVar = f; }
|
---|
71 | void SetPheFFactorMethodLimit ( const Float_t f=fgPheFFactorMethodLimit ) { fPheFFactorMethodLimit = f; }
|
---|
72 | void SetNumSaturated ( const Int_t i) { fNumSaturated = i; }
|
---|
73 | */
|
---|
74 | void SetFFactorMethodValid (const Bool_t b = kTRUE );
|
---|
75 | void SetPedestal (const Float_t ped, const Float_t pedrms, const Float_t pederr);
|
---|
76 | void SetPed ( const Float_t ped, const Float_t pederr);
|
---|
77 | void SetPedRMS ( const Float_t pedrms, const Float_t pedrmserr);
|
---|
78 |
|
---|
79 | void SetAbsTimeMean (const Float_t f) { fAbsTimeMean = f; }
|
---|
80 | void SetAbsTimeRms (const Float_t f) { fAbsTimeRms = f; }
|
---|
81 | void SetConversionHiLo (const Float_t c=fgConversionHiLo ) { fConversionHiLo = c; }
|
---|
82 | void SetConversionHiLoErr (const Float_t e=fgConversionHiLoErr ) { fConversionHiLoVar = e*e;}
|
---|
83 | void SetConversionHiLoSigma (const Float_t s=fgConversionHiLoSigma ) { fConversionHiLoSigma = s; }
|
---|
84 | void SetConvFFactorRelErrLimit (const Float_t f=fgConvFFactorRelErrLimit) { fConvFFactorRelVarLimit = f*f;}
|
---|
85 | void SetMeanConvFADC2Phe (const Float_t f) { fMeanConvFADC2Phe = f; }
|
---|
86 | void SetMeanConvFADC2PheVar (const Float_t f) { fMeanConvFADC2PheStatVar= f; }
|
---|
87 | void SetMeanConvFADC2PheSystVar(const Float_t f) { fMeanConvFADC2PheSystVar= f; }
|
---|
88 | void SetMeanFFactorFADC2Phot (const Float_t f) { fMeanFFactorFADC2Phot = f; }
|
---|
89 | void SetNumSaturated (const Int_t i) { fNumSaturated = i; }
|
---|
90 | void SetPheFFactorMethod (const Float_t f) { fPheFFactorMethod = f; }
|
---|
91 | void SetPheFFactorMethodVar (const Float_t f) { fPheFFactorMethodStatVar= f; }
|
---|
92 | void SetPheFFactorMethodSystVar(const Float_t f) { fPheFFactorMethodSystVar= f; }
|
---|
93 | void SetPheFFactorMethodLimit (const Float_t f=fgPheFFactorMethodLimit ) { fPheFFactorMethodLimit = f; }
|
---|
94 |
|
---|
95 | // Getters
|
---|
96 | Float_t GetAbsTimeMean () const { return fAbsTimeMean; }
|
---|
97 | Float_t GetAbsTimeRms () const { return fAbsTimeRms; }
|
---|
98 | Float_t GetConversionHiLo () const { return fConversionHiLo; }
|
---|
99 | Float_t GetConversionHiLoErr () const { return fConversionHiLoVar<0 ? -1 : TMath::Sqrt(fConversionHiLoVar); }
|
---|
100 | Float_t GetConversionHiLoSigma() const { return fConversionHiLoSigma; }
|
---|
101 | Float_t GetConvertedMean () const { return IsHiGainSaturation() ? fLoGainMean * fConversionHiLo : fHiGainMean; }
|
---|
102 | Float_t GetConvertedMeanErr () const
|
---|
103 | {
|
---|
104 | if (!IsHiGainSaturation())
|
---|
105 | return GetMeanErr();
|
---|
106 | const Float_t logainrelvar = GetLoGainMeanRelVar();
|
---|
107 | return logainrelvar<0 ? -1 : TMath::Sqrt(logainrelvar + GetConversionHiLoRelVar()) * GetConvertedMean();
|
---|
108 | }
|
---|
109 | Float_t GetConvertedSigma() const { return IsHiGainSaturation() ? fLoGainSigma * fConversionHiLo : fHiGainSigma; }
|
---|
110 | Float_t GetConvertedSigmaErr() const
|
---|
111 | {
|
---|
112 | if (!IsHiGainSaturation())
|
---|
113 | return GetSigmaErr();
|
---|
114 |
|
---|
115 | if (fLoGainSigmaVar<0 || fLoGainSigma<0)
|
---|
116 | return -1.;
|
---|
117 |
|
---|
118 | const Float_t sigmaRelVar = fLoGainSigmaVar/(fLoGainSigma*fLoGainSigma);
|
---|
119 | return TMath::Sqrt(sigmaRelVar+GetConversionHiLoRelVar()) * GetConvertedSigma();
|
---|
120 | }
|
---|
121 | Float_t GetConvertedRSigma() const
|
---|
122 | {
|
---|
123 | if (fRSigmaSquare < 0)
|
---|
124 | return -1;
|
---|
125 | const Float_t rsigma = TMath::Sqrt(fRSigmaSquare);
|
---|
126 | return IsHiGainSaturation() ? rsigma*fConversionHiLo : rsigma ;
|
---|
127 | }
|
---|
128 | Float_t GetConvertedRSigmaErr() const;
|
---|
129 | Float_t GetConvertedRSigmaSquare() const
|
---|
130 | {
|
---|
131 | if (fRSigmaSquare < 0)
|
---|
132 | return -1;
|
---|
133 | return IsHiGainSaturation() ? fRSigmaSquare*fConversionHiLo*fConversionHiLo : fRSigmaSquare ;
|
---|
134 | }
|
---|
135 | Float_t GetMeanConvFADC2Phe() const { return fMeanConvFADC2Phe; }
|
---|
136 | Float_t GetMeanConvFADC2PheErr () const { return fMeanConvFADC2PheStatVar<0 ? -1 : TMath::Sqrt(fMeanConvFADC2PheStatVar); }
|
---|
137 | Float_t GetMeanConvFADC2PheSystErr() const { return fMeanConvFADC2PheSystVar<0 ? -1 : TMath::Sqrt(fMeanConvFADC2PheSystVar); }
|
---|
138 | Float_t GetMeanConvFADC2PheTotErr() const
|
---|
139 | {
|
---|
140 | if (fMeanConvFADC2PheSystVar<0 || fMeanConvFADC2PheStatVar<0)
|
---|
141 | return -1.;
|
---|
142 | return TMath::Sqrt(fMeanConvFADC2PheSystVar+fMeanConvFADC2PheStatVar);
|
---|
143 | }
|
---|
144 | Float_t GetFFactorFADC2Phe () const { return gkFFactor; }
|
---|
145 | Float_t GetMeanConvFADC2PheVar () const { return fMeanConvFADC2PheStatVar; }
|
---|
146 | Float_t GetMeanConvFADC2PheSystVar() const { return fMeanConvFADC2PheSystVar; }
|
---|
147 |
|
---|
148 | Float_t GetMeanFFactorFADC2Phot () const { return fMeanFFactorFADC2Phot; }
|
---|
149 | Float_t GetMeanFFactorFADC2PhotErr() const { return fMeanFFactorFADC2PhotVar<0 ? -1. : TMath::Sqrt(fMeanFFactorFADC2PhotVar); }
|
---|
150 | Float_t GetMeanFFactorFADC2PhotVar() const { return fMeanFFactorFADC2PhotVar; }
|
---|
151 | Int_t GetNumSaturated () const { return fNumSaturated; }
|
---|
152 | Float_t GetPed () const { return fPed; }
|
---|
153 | Float_t GetPedErr () const { return TMath::Sqrt(fPedVar); }
|
---|
154 | Float_t GetPedRms () const
|
---|
155 | {
|
---|
156 | if (!IsHiGainSaturation())
|
---|
157 | return fPedRms;
|
---|
158 | return fLoGainPedRmsSquare<0 ? -1 : TMath::Sqrt(fLoGainPedRmsSquare);
|
---|
159 | }
|
---|
160 | Float_t GetPedRmsErr () const;
|
---|
161 | Float_t GetPheFFactorMethod () const { return fPheFFactorMethod; }
|
---|
162 | Float_t GetPheFFactorMethodErr () const { return fPheFFactorMethodStatVar<0 ? -1 : TMath::Sqrt(fPheFFactorMethodStatVar); }
|
---|
163 | Float_t GetPheFFactorMethodSystErr() const { return fPheFFactorMethodSystVar<0 ? -1 : TMath::Sqrt(fPheFFactorMethodSystVar); }
|
---|
164 | Float_t GetPheFFactorMethodTotErr () const
|
---|
165 | {
|
---|
166 | if (fPheFFactorMethodStatVar<0 || fPheFFactorMethodSystVar<0)
|
---|
167 | return -1.;
|
---|
168 | return TMath::Sqrt(fPheFFactorMethodStatVar+fPheFFactorMethodSystVar);
|
---|
169 | }
|
---|
170 | Float_t GetPheFFactorMethodVar () const { return fPheFFactorMethodStatVar; }
|
---|
171 | Float_t GetPheFFactorMethodSystVar() const { return fPheFFactorMethodSystVar; }
|
---|
172 | Float_t GetPheFFactorMethodRelVar () const { return fPheFFactorMethodStatVar<=0 ? -1 : fPheFFactorMethodStatVar / (fPheFFactorMethod * fPheFFactorMethod); }
|
---|
173 | Float_t GetPheFFactorMethodRelSystVar() const { return fPheFFactorMethodSystVar<=0 ? -1. : fPheFFactorMethodSystVar / (fPheFFactorMethod * fPheFFactorMethod); }
|
---|
174 | Float_t GetRSigma () const { return fRSigmaSquare<0 ? -1 : TMath::Sqrt(fRSigmaSquare); }
|
---|
175 |
|
---|
176 | Float_t GetRSigmaErr () const;
|
---|
177 | Float_t GetRSigmaRelVar () const;
|
---|
178 | Float_t GetRSigmaPerCharge () const;
|
---|
179 | Float_t GetRSigmaPerChargeErr() const;
|
---|
180 |
|
---|
181 | Bool_t IsFFactorMethodValid() const;
|
---|
182 |
|
---|
183 | // Calculations
|
---|
184 | void CalcLoGainPedestal(const Float_t logainsamples);
|
---|
185 | Bool_t CalcReducedSigma(const Float_t extractorres=0);
|
---|
186 | Bool_t CalcFFactor();
|
---|
187 | Bool_t CalcConvFFactor();
|
---|
188 | Bool_t CalcMeanFFactor(const Float_t nphotons, const Float_t nphotonsrelvar);
|
---|
189 |
|
---|
190 | ClassDef(MCalibrationChargePix, 4) // Container Charge Calibration Results Pixel
|
---|
191 | };
|
---|
192 |
|
---|
193 | #endif
|
---|
194 |
|
---|