| 1 | #ifndef MARS_MCalibrationChargePINDiode | 
|---|
| 2 | #define MARS_MCalibrationChargePINDiode | 
|---|
| 3 |  | 
|---|
| 4 | #ifndef MARS_MParContainer | 
|---|
| 5 | #include "MParContainer.h" | 
|---|
| 6 | #endif | 
|---|
| 7 |  | 
|---|
| 8 | class MCalibrationChargePINDiode : public MParContainer | 
|---|
| 9 | { | 
|---|
| 10 | private: | 
|---|
| 11 |  | 
|---|
| 12 | static const Float_t fgChargeLimit;       // The default limit (in units of PedRMS) for acceptance of the fitted mean charge | 
|---|
| 13 | static const Float_t fgChargeErrLimit;    // The default limit (in units of PedRMS) for acceptance of the fitted charge sigma | 
|---|
| 14 | static const Float_t fgChargeRelErrLimit; // The default limit (in units of Error of fitted charge) for acceptance of the fitted mean | 
|---|
| 15 |  | 
|---|
| 16 | static const Float_t fgConversionChargePhotons;    // The default mean conversion from PIN Diode charge to the number of incident photons | 
|---|
| 17 | static const Float_t fgConversionChargePhotonsErr; // The default error of the mean conversion from PIN Diode charge to the number of incident photons | 
|---|
| 18 |  | 
|---|
| 19 | static const Float_t gkPINDiodeArea;         // The Blind Pixel area in mm^2 | 
|---|
| 20 |  | 
|---|
| 21 | static const Float_t gkFluxCameravsPINDiode     ; | 
|---|
| 22 | static const Float_t gkFluxCameravsPINDiodeErr  ; | 
|---|
| 23 |  | 
|---|
| 24 | static const Float_t gkPINDiodeQEGreen; | 
|---|
| 25 | static const Float_t gkPINDiodeQEBlue ; | 
|---|
| 26 | static const Float_t gkPINDiodeQEUV   ; | 
|---|
| 27 | static const Float_t gkPINDiodeQECT1  ; | 
|---|
| 28 |  | 
|---|
| 29 | static const Float_t gkPINDiodeQEGreenErr; | 
|---|
| 30 | static const Float_t gkPINDiodeQEBlueErr ; | 
|---|
| 31 | static const Float_t gkPINDiodeQEUVErr   ; | 
|---|
| 32 | static const Float_t gkPINDiodeQECT1Err  ; | 
|---|
| 33 |  | 
|---|
| 34 | Float_t fChargeLimit;                     // The limit (in units of PedRMS) for acceptance of the fitted mean charge | 
|---|
| 35 | Float_t fChargeErrLimit;                  // The limit (in units of PedRMS) for acceptance of the fitted charge sigma | 
|---|
| 36 | Float_t fChargeRelErrLimit;               // The limit (in units of Error of fitted charge) for acceptance of the fitted mean | 
|---|
| 37 |  | 
|---|
| 38 | Float_t fConversionChargePhotons;         // The mean conversion from PIN Diode charge to the number of incident photons | 
|---|
| 39 | Float_t fConversionChargePhotonsErr;      // The error of the mean conversion from PIN Diode charge to the number of incident photons | 
|---|
| 40 |  | 
|---|
| 41 | Float_t fPed;                   // The mean pedestal (from MPedestalPix) | 
|---|
| 42 | Float_t fPedRms;                // The pedestal  RMS (from MPedestalPix) | 
|---|
| 43 |  | 
|---|
| 44 | Float_t fMeanCharge;            // The mean charge after the fit | 
|---|
| 45 | Float_t fMeanChargeErr;         // The error of mean charge after the fit | 
|---|
| 46 | Float_t fSigmaCharge;           // The sigma of the mean charge after the fit | 
|---|
| 47 | Float_t fSigmaChargeErr;        // The error of the sigma of the mean charge after the fit | 
|---|
| 48 | Float_t fChargeProb;            // The probability of the fit function | 
|---|
| 49 |  | 
|---|
| 50 | Float_t fRmsChargeMean; | 
|---|
| 51 | Float_t fRmsChargeMeanErr; | 
|---|
| 52 | Float_t fRmsChargeSigma; | 
|---|
| 53 | Float_t fRmsChargeSigmaErr; | 
|---|
| 54 |  | 
|---|
| 55 | Byte_t  fFlags;                            // Flag for the set Bits | 
|---|
| 56 |  | 
|---|
| 57 | Float_t fAbsTimeMean; | 
|---|
| 58 | Float_t fAbsTimeRms; | 
|---|
| 59 |  | 
|---|
| 60 | Float_t fTimeLowerEdge; | 
|---|
| 61 | Float_t fTimeUpperEdge; | 
|---|
| 62 |  | 
|---|
| 63 | Float_t fConvertedPhotons; | 
|---|
| 64 | Float_t fConvertedPhotonsErr; | 
|---|
| 65 |  | 
|---|
| 66 | Float_t fMeanFluxOutsidePlexiglass;         //  The mean number of photons in an INNER PIXEL outside the plexiglass | 
|---|
| 67 | Float_t fMeanFluxErrOutsidePlexiglass;      //  The uncertainty about the number of photons in an INNER PIXEL | 
|---|
| 68 |  | 
|---|
| 69 | public: | 
|---|
| 70 |  | 
|---|
| 71 | enum PulserColor_t { kEBlue, kEGreen, kEUV, kECT1 } ; | 
|---|
| 72 |  | 
|---|
| 73 | private: | 
|---|
| 74 |  | 
|---|
| 75 | PulserColor_t fColor; | 
|---|
| 76 |  | 
|---|
| 77 | enum  { kExcluded, kExcludeQualityCheck, | 
|---|
| 78 | kChargeFitValid, kTimeFitValid, | 
|---|
| 79 | kMeanTimeInFirstBin, kMeanTimeInLastBin, | 
|---|
| 80 | kFluxOutsidePlexiglassAvailable  }; | 
|---|
| 81 |  | 
|---|
| 82 | public: | 
|---|
| 83 |  | 
|---|
| 84 | MCalibrationChargePINDiode(const char *name=NULL, const char *title=NULL); | 
|---|
| 85 | ~MCalibrationChargePINDiode() {} | 
|---|
| 86 |  | 
|---|
| 87 | void Clear(Option_t *o=""); | 
|---|
| 88 |  | 
|---|
| 89 | // Setters | 
|---|
| 90 | void SetColor(   const PulserColor_t color )  {  fColor = color;         } | 
|---|
| 91 |  | 
|---|
| 92 | void SetMeanCharge     (   const Float_t f )    { fMeanCharge        = f;  } | 
|---|
| 93 | void SetMeanChargeErr  (   const Float_t f )    { fMeanChargeErr     = f;  } | 
|---|
| 94 | void SetSigmaCharge    (   const Float_t f )    { fSigmaCharge       = f;  } | 
|---|
| 95 | void SetSigmaChargeErr (   const Float_t f )    { fSigmaChargeErr    = f;  } | 
|---|
| 96 |  | 
|---|
| 97 | void SetRmsChargeMean    ( const Float_t f )    { fRmsChargeMean     = f;  } | 
|---|
| 98 | void SetRmsChargeMeanErr ( const Float_t f )    { fRmsChargeMeanErr  = f;  } | 
|---|
| 99 | void SetRmsChargeSigma   ( const Float_t f )    { fRmsChargeSigma    = f;  } | 
|---|
| 100 | void SetRmsChargeSigmaErr( const Float_t f )    { fRmsChargeSigmaErr = f;  } | 
|---|
| 101 |  | 
|---|
| 102 | void SetAbsTimeMean    (   const Float_t f )    { fAbsTimeMean       = f;  } | 
|---|
| 103 | void SetAbsTimeRms     (   const Float_t f )    { fAbsTimeRms        = f;  } | 
|---|
| 104 |  | 
|---|
| 105 | void SetChargeLimit    (   const Float_t f=fgChargeLimit       ) { fChargeLimit       = f; } | 
|---|
| 106 | void SetChargeErrLimit (   const Float_t f=fgChargeErrLimit    ) { fChargeErrLimit    = f; } | 
|---|
| 107 | void SetChargeRelErrLimit( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; } | 
|---|
| 108 |  | 
|---|
| 109 | void SetConversionChargePhotons    ( const Float_t f=fgConversionChargePhotons    ) { fConversionChargePhotons    = f; } | 
|---|
| 110 | void SetConversionChargePhotonsErr ( const Float_t f=fgConversionChargePhotonsErr ) { fConversionChargePhotonsErr = f; } | 
|---|
| 111 |  | 
|---|
| 112 | void SetPedestal(Float_t ped, Float_t pedrms); | 
|---|
| 113 |  | 
|---|
| 114 | void SetExcluded           ( const Bool_t b = kTRUE ); | 
|---|
| 115 | void SetExcludeQualityCheck( const Bool_t b = kTRUE ); | 
|---|
| 116 | void SetChargeFitValid     ( const Bool_t b = kTRUE ); | 
|---|
| 117 | void SetTimeFitValid       ( const Bool_t b = kTRUE ); | 
|---|
| 118 | void SetFluxOutsidePlexiglassAvailable ( const Bool_t b = kTRUE ); | 
|---|
| 119 |  | 
|---|
| 120 | // Setters ONLY for MC: | 
|---|
| 121 | void  SetMeanTimeInFirstBin( const Bool_t b = kTRUE ); | 
|---|
| 122 | void  SetMeanTimeInLastBin ( const Bool_t b = kTRUE ); | 
|---|
| 123 |  | 
|---|
| 124 | // Getters | 
|---|
| 125 | Float_t GetMeanCharge()      const { return fMeanCharge;         } | 
|---|
| 126 | Float_t GetMeanChargeErr()   const { return fMeanChargeErr;      } | 
|---|
| 127 | Float_t GetSigmaCharge()     const { return fSigmaCharge;        } | 
|---|
| 128 | Float_t GetSigmaChargeErr()  const { return fSigmaChargeErr;     } | 
|---|
| 129 | Float_t GetChargeProb()      const { return fChargeProb;         } | 
|---|
| 130 |  | 
|---|
| 131 | Float_t GetMeanFluxOutsidePlexiglass()    const { return fMeanFluxOutsidePlexiglass; } | 
|---|
| 132 | Float_t GetMeanFluxErrOutsidePlexiglass() const { return fMeanFluxErrOutsidePlexiglass; } | 
|---|
| 133 |  | 
|---|
| 134 | // Pedestals | 
|---|
| 135 | Float_t GetPed()             const { return fPed;    } | 
|---|
| 136 | Float_t GetPedRms()          const { return fPedRms; } | 
|---|
| 137 |  | 
|---|
| 138 |  | 
|---|
| 139 | Bool_t  IsExcluded()          const; | 
|---|
| 140 | Bool_t  IsChargeFitValid()    const; | 
|---|
| 141 | Bool_t  IsTimeFitValid()      const; | 
|---|
| 142 |  | 
|---|
| 143 | Bool_t  IsMeanTimeInFirstBin() const; | 
|---|
| 144 | Bool_t  IsMeanTimeInLastBin()  const; | 
|---|
| 145 |  | 
|---|
| 146 | Bool_t  CheckChargeFitValidity(); | 
|---|
| 147 | Bool_t  CheckTimeFitValidity(); | 
|---|
| 148 | Bool_t  CalcFluxOutsidePlexiglass(); | 
|---|
| 149 |  | 
|---|
| 150 | ClassDef(MCalibrationChargePINDiode, 1)       // Container for Calibration PIN Diode | 
|---|
| 151 | }; | 
|---|
| 152 |  | 
|---|
| 153 | #endif   /* MARS_MCalibrationChargePINDiode */ | 
|---|
| 154 |  | 
|---|
| 155 |  | 
|---|
| 156 |  | 
|---|
| 157 |  | 
|---|
| 158 |  | 
|---|
| 159 |  | 
|---|
| 160 |  | 
|---|
| 161 |  | 
|---|
| 162 |  | 
|---|