| 1 | #ifndef MARS_MCalibrationChargePix
|
|---|
| 2 | #define MARS_MCalibrationChargePix
|
|---|
| 3 |
|
|---|
| 4 | #ifndef MARS_MParContainer
|
|---|
| 5 | #include "MParContainer.h"
|
|---|
| 6 | #endif
|
|---|
| 7 |
|
|---|
| 8 | class MBadPixelsPix;
|
|---|
| 9 | class MCalibrationChargePix : public MParContainer
|
|---|
| 10 | {
|
|---|
| 11 | private:
|
|---|
| 12 |
|
|---|
| 13 | static const Float_t gkAverageQE; // The average quantum efficieny agreed on for the first analysis
|
|---|
| 14 | static const Float_t gkAverageQEErr; // The error of average quantum efficieny
|
|---|
| 15 |
|
|---|
| 16 | static const Float_t gkConversionHiLo; // The default conversion factor HI gain - Lo Gain
|
|---|
| 17 | static const Float_t gkConversionHiLoErr; // The error of the default conversion factor
|
|---|
| 18 |
|
|---|
| 19 | static const Float_t gkElectronicPedRms; // The pure electronic component of the RMS
|
|---|
| 20 | static const Float_t gkElectronicPedRmsErr; // The error of the pure electronic component of the RMS
|
|---|
| 21 | static const Float_t gkFFactor; // The laboratory F-factor of the PMTs
|
|---|
| 22 | static const Float_t gkFFactorErr; // The laboratory F-factor Error of the PMTs
|
|---|
| 23 |
|
|---|
| 24 | static const Float_t fgChargeLimit; // The default limit (in units of PedRMS) for acceptance of the fitted mean charge
|
|---|
| 25 | static const Float_t fgChargeErrLimit; // The default limit (in units of PedRMS) for acceptance of the fitted charge sigma
|
|---|
| 26 | static const Float_t fgChargeRelErrLimit; // The default limit (in units of Error of fitted charge) for acceptance of the fitted mean
|
|---|
| 27 |
|
|---|
| 28 | static const Float_t fgTimeLimit; // The limit (in units of FADC slices) for acceptance of the fitted time
|
|---|
| 29 | static const Float_t fgTimeErrLimit; // The limit (in units of FADC slices) for acceptance of the fitted time sigma
|
|---|
| 30 | static const Float_t fgConvFFactorRelErrLimit; // The limit for acceptance of the rel. error of the conversion factor with the FFactor method
|
|---|
| 31 |
|
|---|
| 32 | Float_t fChargeLimit; // The limit (in units of PedRMS) for acceptance of the fitted mean charge
|
|---|
| 33 | Float_t fChargeErrLimit; // The limit (in units of PedRMS) for acceptance of the fitted charge sigma
|
|---|
| 34 | Float_t fChargeRelErrLimit; // The limit (in units of Error of fitted charge) for acceptance of the fitted mean
|
|---|
| 35 |
|
|---|
| 36 | Float_t fTimeLimit; // The limit (in units of FADC slices) for acceptance of the fitted time
|
|---|
| 37 | Float_t fTimeErrLimit; // The limit (in units of FADC slices) for acceptance of the fitted time sigma
|
|---|
| 38 | Float_t fConvFFactorRelErrLimit; // The limit for acceptance of the rel. error of the conversion factor with the FFactor method
|
|---|
| 39 |
|
|---|
| 40 | Float_t fElectronicPedRms; // The pure electronic component of the RMS
|
|---|
| 41 | Float_t fElectronicPedRmsErr; // The error of the pure electronic component of the RMS
|
|---|
| 42 |
|
|---|
| 43 | Int_t fPixId; // the pixel Id
|
|---|
| 44 |
|
|---|
| 45 | UInt_t fFlags; // Flag for the set bits
|
|---|
| 46 |
|
|---|
| 47 | Float_t fAverageQE; // The average quantum efficieny (see Class description)
|
|---|
| 48 | Float_t fAverageQEErr; // The error of the average quantum efficieny (see Class description)
|
|---|
| 49 |
|
|---|
| 50 | Float_t fHiGainMeanCharge; // The mean reduced charge after the fit
|
|---|
| 51 | Float_t fHiGainMeanChargeErr; // The error of reduced mean charge after the fit
|
|---|
| 52 | Float_t fHiGainSigmaCharge; // The sigma of the mean charge after the fit
|
|---|
| 53 | Float_t fHiGainSigmaChargeErr; // The error of the sigma of the mean charge after the fit
|
|---|
| 54 | Float_t fHiGainChargeProb; // The probability of the fit function
|
|---|
| 55 |
|
|---|
| 56 | Float_t fLoGainMeanCharge; // The mean reduced charge after the fit
|
|---|
| 57 | Float_t fLoGainMeanChargeErr; // The error of reduced mean charge after the fit
|
|---|
| 58 | Float_t fLoGainSigmaCharge; // The sigma of the mean charge after the fit
|
|---|
| 59 | Float_t fLoGainSigmaChargeErr; // The error of the sigma of the mean charge after the fit
|
|---|
| 60 | Float_t fLoGainChargeProb; // The probability of the fit function
|
|---|
| 61 |
|
|---|
| 62 | Float_t fRSigmaCharge; // The reduced squares of sigmas after the fit
|
|---|
| 63 | Float_t fRSigmaChargeErr; // The reduced squares of sigmas after the fit
|
|---|
| 64 |
|
|---|
| 65 | Float_t fPed; // The mean pedestal (from MPedestalPix) times number of FADC slices
|
|---|
| 66 | Float_t fPedErr; // The error of the pedestal
|
|---|
| 67 | Float_t fPedRms; // The pedestal RMS (from MPedestalPix) times sqrt of number of FADC slices
|
|---|
| 68 |
|
|---|
| 69 | Float_t fLoGainPedRms; // The pedestal RMS of the low gain
|
|---|
| 70 | Float_t fLoGainPedRmsErr; // The pedestal RMS Error of the low gain
|
|---|
| 71 |
|
|---|
| 72 | Float_t fAbsTimeMean; // The mean absolute arrival time
|
|---|
| 73 | Float_t fAbsTimeRms; // The rms of the mean absolute arrival time
|
|---|
| 74 |
|
|---|
| 75 | Byte_t fTimeFirstHiGain; // The first used FADC slice
|
|---|
| 76 | Byte_t fTimeLastHiGain; // The last used FADC slice
|
|---|
| 77 |
|
|---|
| 78 | Byte_t fTimeFirstLoGain; // The first used FADC slice
|
|---|
| 79 | Byte_t fTimeLastLoGain; // The last used FADC slice
|
|---|
| 80 |
|
|---|
| 81 | Float_t fPheFFactorMethod; // The number of Phe's calculated (F-factor method)
|
|---|
| 82 | Float_t fPheFFactorMethodErr; // The error on the number of Phe's calculated (F-factor method)
|
|---|
| 83 |
|
|---|
| 84 | Float_t fMeanConversionFFactorMethod; // The conversion factor to Phe's (F-factor method)
|
|---|
| 85 | Float_t fMeanConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
|
|---|
| 86 | Float_t fMeanConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method)
|
|---|
| 87 | Float_t fMeanConversionCombinedMethod; // The conversion factor to Ph's (all methods combined)
|
|---|
| 88 |
|
|---|
| 89 | Float_t fConversionFFactorMethodErr; // The error of the conversion factor to Phe's (F-factor method)
|
|---|
| 90 | Float_t fConversionBlindPixelMethodErr; // The error of the conversion factor to Ph's (Blind Pixel method)
|
|---|
| 91 | Float_t fConversionPINDiodeMethodErr; // The error of the conversion factor to Ph's (PIN Diode method)
|
|---|
| 92 | Float_t fConversionCombinedMethodErr; // The error of the conversion factor to Ph's (all methods combined)
|
|---|
| 93 |
|
|---|
| 94 | Float_t fSigmaConversionFFactorMethod; // The sigma of conversion factor to Phe's (F-factor method)
|
|---|
| 95 | Float_t fSigmaConversionBlindPixelMethod; // The conversion factor to Ph's (Blind Pixel method)
|
|---|
| 96 | Float_t fSigmaConversionPINDiodeMethod; // The conversion factor to Ph's (PIN Diode method)
|
|---|
| 97 | Float_t fSigmaConversionCombinedMethod; // The conversion factor to Ph's (all methods combined)
|
|---|
| 98 |
|
|---|
| 99 | Float_t fTotalFFactorFFactorMethod; // The total F-Factor to Ph's (F-factor method)
|
|---|
| 100 | Float_t fTotalFFactorBlindPixelMethod; // The total F-Factor to Ph's (Blind Pixel method)
|
|---|
| 101 | Float_t fTotalFFactorPINDiodeMethod; // The total F-Factor to Ph's (PIN Diode method)
|
|---|
| 102 | Float_t fTotalFFactorCombinedMethod; // The total F-Factor to Ph's (all methods combined)
|
|---|
| 103 |
|
|---|
| 104 | Float_t fTotalFFactorErrFFactorMethod; // The error of the total F-Factor to Ph's (F-factor method)
|
|---|
| 105 | Float_t fTotalFFactorErrBlindPixelMethod; // The error of the total F-Factor to Ph's (Blind Pixel method)
|
|---|
| 106 | Float_t fTotalFFactorErrPINDiodeMethod; // The error of the total F-Factor to Ph's (PIN Diode method)
|
|---|
| 107 | Float_t fTotalFFactorErrCombinedMethod; // The error of the total F-Factor to Ph's (all methods combined)
|
|---|
| 108 |
|
|---|
| 109 | Float_t fTotalFFactor; // The F-Factor of the total readout system (Sigma(out)/mean(out)*Mean(in)/sigma(in)
|
|---|
| 110 | Float_t fTotalFFactorErr; // The error on the F-Factor of the total readout system
|
|---|
| 111 |
|
|---|
| 112 | Float_t fConversionHiLo; // The conversion factor between Hi Gain and Lo Gain
|
|---|
| 113 | Float_t fConversionHiLoErr; // The error of the conversion factor between Hi Gain and Lo Gain
|
|---|
| 114 |
|
|---|
| 115 | Float_t fNumLoGainSamples;
|
|---|
| 116 |
|
|---|
| 117 | Float_t fHiGainNumPickup;
|
|---|
| 118 | Float_t fLoGainNumPickup;
|
|---|
| 119 |
|
|---|
| 120 | enum { kHiGainSaturation, kLoGainSaturation,
|
|---|
| 121 | kExcluded,
|
|---|
| 122 | kChargeValid, kTimeFitValid,
|
|---|
| 123 | kHiGainFitted, kLoGainFitted,
|
|---|
| 124 | kBlindPixelMethodValid, kFFactorMethodValid,
|
|---|
| 125 | kPINDiodeMethodValid, kCombinedMethodValid };
|
|---|
| 126 |
|
|---|
| 127 | void CalcLoGainPed();
|
|---|
| 128 |
|
|---|
| 129 | public:
|
|---|
| 130 |
|
|---|
| 131 | MCalibrationChargePix(const char *name=NULL, const char *title=NULL);
|
|---|
| 132 | ~MCalibrationChargePix() {}
|
|---|
| 133 |
|
|---|
| 134 | void Clear(Option_t *o="");
|
|---|
| 135 |
|
|---|
| 136 | // Setter
|
|---|
| 137 | void SetPedestal(const Float_t ped, const Float_t pedrms, const Float_t pederr);
|
|---|
| 138 |
|
|---|
| 139 | void SetConversionHiLo( const Float_t c = gkConversionHiLo) { fConversionHiLo = c; }
|
|---|
| 140 | void SetConversionHiLoErr( const Float_t e = gkConversionHiLoErr) { fConversionHiLoErr = e; }
|
|---|
| 141 | void SetAverageQE( const Float_t qe= gkAverageQE,
|
|---|
| 142 | const Float_t err=gkAverageQEErr) { fAverageQE = qe;
|
|---|
| 143 | fAverageQEErr = err; }
|
|---|
| 144 | void SetChargeLimit ( const Float_t f=fgChargeLimit ) { fChargeLimit = f; }
|
|---|
| 145 | void SetChargeErrLimit ( const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; }
|
|---|
| 146 | void SetChargeRelErrLimit( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; }
|
|---|
| 147 |
|
|---|
| 148 | void SetTimeLimit ( const Float_t f=fgTimeLimit ) { fTimeLimit = f; }
|
|---|
| 149 | void SetTimeErrLimit ( const Float_t f=fgTimeErrLimit ) { fTimeErrLimit = f; }
|
|---|
| 150 | void SetConvFFactorRelErrLimit( const Float_t f=fgConvFFactorRelErrLimit ) { fConvFFactorRelErrLimit = f; }
|
|---|
| 151 |
|
|---|
| 152 | // Charges
|
|---|
| 153 | void SetHiGainMeanCharge ( const Float_t f ) { fHiGainMeanCharge = f; }
|
|---|
| 154 | void SetHiGainMeanChargeErr ( const Float_t f ) { fHiGainMeanChargeErr = f; }
|
|---|
| 155 | void SetHiGainChargeProb ( const Float_t f ) { fHiGainChargeProb = f; }
|
|---|
| 156 | void SetHiGainSigmaCharge ( const Float_t f ) { fHiGainSigmaCharge = f; }
|
|---|
| 157 | void SetHiGainSigmaChargeErr ( const Float_t f ) { fHiGainSigmaChargeErr = f; }
|
|---|
| 158 |
|
|---|
| 159 | void SetLoGainMeanCharge ( const Float_t f ) { fLoGainMeanCharge = f; }
|
|---|
| 160 | void SetLoGainMeanChargeErr ( const Float_t f ) { fLoGainMeanChargeErr = f; }
|
|---|
| 161 | void SetLoGainChargeProb ( const Float_t f ) { fLoGainChargeProb = f; }
|
|---|
| 162 | void SetLoGainSigmaCharge ( const Float_t f ) { fLoGainSigmaCharge = f; }
|
|---|
| 163 | void SetLoGainSigmaChargeErr ( const Float_t f ) { fLoGainSigmaChargeErr = f; }
|
|---|
| 164 |
|
|---|
| 165 | void SetMeanCharge ( const Float_t f );
|
|---|
| 166 | void SetMeanChargeErr ( const Float_t f );
|
|---|
| 167 | void SetSigmaCharge ( const Float_t f );
|
|---|
| 168 | void SetSigmaChargeErr ( const Float_t f );
|
|---|
| 169 |
|
|---|
| 170 | void SetHiGainNumPickup ( const Float_t f ) { fHiGainNumPickup = f; }
|
|---|
| 171 | void SetLoGainNumPickup ( const Float_t f ) { fLoGainNumPickup = f; }
|
|---|
| 172 |
|
|---|
| 173 | // Times
|
|---|
| 174 | void SetAbsTimeMean ( const Float_t f ) { fAbsTimeMean = f; }
|
|---|
| 175 | void SetAbsTimeRms ( const Float_t f ) { fAbsTimeRms = f; }
|
|---|
| 176 |
|
|---|
| 177 | void SetNumLoGainSamples ( const Float_t f ) { fNumLoGainSamples = f; }
|
|---|
| 178 |
|
|---|
| 179 | // Setters for MC
|
|---|
| 180 | void SetConversionFFactorMethod ( Float_t c, Float_t err, Float_t sig );
|
|---|
| 181 | void SetConversionBlindPixelMethod( Float_t c, Float_t err, Float_t sig );
|
|---|
| 182 | void SetConversionPINDiodeMethod ( Float_t c, Float_t err, Float_t sig );
|
|---|
| 183 | void SetConversionCombinedMethod ( Float_t c, Float_t err, Float_t sig );
|
|---|
| 184 |
|
|---|
| 185 | // Bit Setters
|
|---|
| 186 | void SetHiGainSaturation ( const Bool_t b = kTRUE );
|
|---|
| 187 | void SetLoGainSaturation ( const Bool_t b = kTRUE );
|
|---|
| 188 | void SetExcluded ( const Bool_t b = kTRUE );
|
|---|
| 189 | void SetHiGainFitted ( const Bool_t b = kTRUE );
|
|---|
| 190 | void SetLoGainFitted ( const Bool_t b = kTRUE );
|
|---|
| 191 | void SetBlindPixelMethodValid( const Bool_t b = kTRUE );
|
|---|
| 192 | void SetFFactorMethodValid ( const Bool_t b = kTRUE );
|
|---|
| 193 | void SetPINDiodeMethodValid ( const Bool_t b = kTRUE );
|
|---|
| 194 | void SetCombinedMethodValid ( const Bool_t b = kTRUE );
|
|---|
| 195 |
|
|---|
| 196 | void SetAbsTimeBordersHiGain( Byte_t f, Byte_t l );
|
|---|
| 197 | void SetAbsTimeBordersLoGain( Byte_t f, Byte_t l );
|
|---|
| 198 |
|
|---|
| 199 | // Charges
|
|---|
| 200 | Float_t GetHiGainMeanCharge() const { return fHiGainMeanCharge; }
|
|---|
| 201 | Float_t GetHiGainMeanChargeErr() const { return fHiGainMeanChargeErr; }
|
|---|
| 202 | Float_t GetHiGainChargeProb() const { return fHiGainChargeProb; }
|
|---|
| 203 | Float_t GetHiGainSigmaCharge() const { return fHiGainSigmaCharge; }
|
|---|
| 204 | Float_t GetHiGainSigmaChargeErr() const { return fHiGainSigmaChargeErr; }
|
|---|
| 205 |
|
|---|
| 206 | Float_t GetLoGainMeanCharge() const { return fLoGainMeanCharge; }
|
|---|
| 207 | Float_t GetLoGainMeanChargeErr() const { return fLoGainMeanChargeErr; }
|
|---|
| 208 | Float_t GetLoGainChargeProb() const { return fLoGainChargeProb; }
|
|---|
| 209 | Float_t GetLoGainSigmaCharge() const { return fLoGainSigmaCharge; }
|
|---|
| 210 | Float_t GetLoGainSigmaChargeErr() const { return fLoGainSigmaChargeErr; }
|
|---|
| 211 |
|
|---|
| 212 | Float_t GetMeanCharge() const;
|
|---|
| 213 | Float_t GetMeanChargeErr() const;
|
|---|
| 214 | Float_t GetChargeProb() const;
|
|---|
| 215 | Float_t GetSigmaCharge() const;
|
|---|
| 216 | Float_t GetSigmaChargeErr() const;
|
|---|
| 217 |
|
|---|
| 218 | Float_t GetRSigmaCharge() const { return fRSigmaCharge; }
|
|---|
| 219 | Float_t GetRSigmaChargeErr() const { return fRSigmaChargeErr; }
|
|---|
| 220 |
|
|---|
| 221 | Float_t GetHiGainNumPickup() const { return fHiGainNumPickup; }
|
|---|
| 222 | Float_t GetLoGainNumPickup() const { return fLoGainNumPickup; }
|
|---|
| 223 |
|
|---|
| 224 | Float_t GetAbsTimeMean() const { return fAbsTimeMean; }
|
|---|
| 225 | Float_t GetAbsTimeRms() const { return fAbsTimeRms; }
|
|---|
| 226 |
|
|---|
| 227 | // Conversion Factors
|
|---|
| 228 | Float_t GetConversionHiLo() const { return fConversionHiLo; }
|
|---|
| 229 | Float_t GetConversionHiLoErr() const { return fConversionHiLoErr; }
|
|---|
| 230 |
|
|---|
| 231 | Float_t GetMeanConversionBlindPixelMethod() const { return fMeanConversionBlindPixelMethod ; }
|
|---|
| 232 | Float_t GetConversionBlindPixelMethodErr() const { return fConversionBlindPixelMethodErr ; }
|
|---|
| 233 | Float_t GetSigmaConversionBlindPixelMethod() const { return fSigmaConversionBlindPixelMethod ; }
|
|---|
| 234 |
|
|---|
| 235 | Float_t GetMeanConversionFFactorMethod() const { return fMeanConversionFFactorMethod; }
|
|---|
| 236 | Float_t GetConversionFFactorMethodErr() const { return fConversionFFactorMethodErr; }
|
|---|
| 237 | Float_t GetSigmaConversionFFactorMethod() const { return fSigmaConversionFFactorMethod; }
|
|---|
| 238 |
|
|---|
| 239 | Float_t GetMeanConversionPINDiodeMethod() const { return fMeanConversionPINDiodeMethod ; }
|
|---|
| 240 | Float_t GetConversionPINDiodeMethodErr() const { return fConversionPINDiodeMethodErr ; }
|
|---|
| 241 | Float_t GetSigmaConversionPINDiodeMethod() const { return fSigmaConversionPINDiodeMethod ; }
|
|---|
| 242 |
|
|---|
| 243 | Float_t GetMeanConversionCombinedMethod() const { return fMeanConversionCombinedMethod ; }
|
|---|
| 244 | Float_t GetConversionCombinedMethodErr() const { return fConversionCombinedMethodErr ; }
|
|---|
| 245 | Float_t GetSigmaConversionCombinedMethod() const { return fSigmaConversionCombinedMethod ; }
|
|---|
| 246 |
|
|---|
| 247 | Float_t GetPheFFactorMethod() const { return fPheFFactorMethod; }
|
|---|
| 248 | Float_t GetPheFFactorMethodErr() const { return fPheFFactorMethodErr; }
|
|---|
| 249 |
|
|---|
| 250 | Int_t GetPixId() const { return fPixId; }
|
|---|
| 251 |
|
|---|
| 252 | Float_t GetPed() const { return fPed; }
|
|---|
| 253 | Float_t GetPedErr() const { return fPedErr; }
|
|---|
| 254 | Float_t GetPedRms() const { return fPedRms; }
|
|---|
| 255 | Float_t GetPedRmsErr() const { return fPedErr / 2.; }
|
|---|
| 256 |
|
|---|
| 257 | Float_t GetTotalFFactorFFactorMethod() const { return fTotalFFactorFFactorMethod; }
|
|---|
| 258 | Float_t GetTotalFFactorErrFFactorMethod() const { return fTotalFFactorErrFFactorMethod; }
|
|---|
| 259 |
|
|---|
| 260 | Float_t GetTotalFFactorBlindPixelMethod() const { return fTotalFFactorBlindPixelMethod; }
|
|---|
| 261 | Float_t GetTotalFFactorErrBlindPixelMethod() const { return fTotalFFactorErrBlindPixelMethod; }
|
|---|
| 262 |
|
|---|
| 263 | Float_t GetTotalFFactorPINDiodeMethod() const { return fTotalFFactorPINDiodeMethod; }
|
|---|
| 264 | Float_t GetTotalFFactorErrPINDiodeMethod() const { return fTotalFFactorErrPINDiodeMethod; }
|
|---|
| 265 |
|
|---|
| 266 | Float_t GetTotalFFactorCombinedMethod() const { return fTotalFFactorCombinedMethod; }
|
|---|
| 267 | Float_t GetTotalFFactorErrCombinedMethod() const { return fTotalFFactorErrCombinedMethod; }
|
|---|
| 268 |
|
|---|
| 269 | Bool_t IsExcluded() const;
|
|---|
| 270 | Bool_t IsHiGainSaturation() const;
|
|---|
| 271 | Bool_t IsLoGainSaturation() const;
|
|---|
| 272 | Bool_t IsHiGainFitted() const;
|
|---|
| 273 | Bool_t IsLoGainFitted() const;
|
|---|
| 274 | Bool_t IsFitted() const;
|
|---|
| 275 | Bool_t IsBlindPixelMethodValid() const;
|
|---|
| 276 | Bool_t IsPINDiodeMethodValid() const;
|
|---|
| 277 | Bool_t IsFFactorMethodValid() const;
|
|---|
| 278 | Bool_t IsCombinedMethodValid() const;
|
|---|
| 279 |
|
|---|
| 280 | void DefinePixId(Int_t i);
|
|---|
| 281 |
|
|---|
| 282 | // Miscellaneous
|
|---|
| 283 | void ApplyLoGainConversion();
|
|---|
| 284 |
|
|---|
| 285 | void CheckChargeValidity ( MBadPixelsPix *bad );
|
|---|
| 286 | void CheckTimeValidity ( MBadPixelsPix *bad );
|
|---|
| 287 | Bool_t CalcReducedSigma();
|
|---|
| 288 | Bool_t CalcFFactorMethod();
|
|---|
| 289 |
|
|---|
| 290 | ClassDef(MCalibrationChargePix, 1) // Container for Calibration of one pixel
|
|---|
| 291 | };
|
|---|
| 292 |
|
|---|
| 293 | #endif
|
|---|
| 294 |
|
|---|