| 1 | #ifndef MARS_MCalibrationChargeCalc
|
|---|
| 2 | #define MARS_MCalibrationChargeCalc
|
|---|
| 3 |
|
|---|
| 4 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 5 | // //
|
|---|
| 6 | // MCalibrationChargeCalc //
|
|---|
| 7 | // //
|
|---|
| 8 | // Integrates the time slices of the all pixels of a calibration event //
|
|---|
| 9 | // and substract the pedestal value //
|
|---|
| 10 | // //
|
|---|
| 11 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 12 |
|
|---|
| 13 | #ifndef MARS_MTask
|
|---|
| 14 | #include "MTask.h"
|
|---|
| 15 | #endif
|
|---|
| 16 |
|
|---|
| 17 | #ifndef MARS_MBadPixelsPix
|
|---|
| 18 | #include "MBadPixelsPix.h"
|
|---|
| 19 | #endif
|
|---|
| 20 |
|
|---|
| 21 | #ifndef MARS_MCalibrationCam
|
|---|
| 22 | #include "MCalibrationCam.h"
|
|---|
| 23 | #endif
|
|---|
| 24 |
|
|---|
| 25 | class MRawEvtData;
|
|---|
| 26 | class MRawRunHeader;
|
|---|
| 27 | class MPedestalCam;
|
|---|
| 28 | class MPedestalPix;
|
|---|
| 29 | class MCalibrationChargePINDiode;
|
|---|
| 30 | class MCalibrationChargeBlindPix;
|
|---|
| 31 | class MCalibrationChargePix;
|
|---|
| 32 | class MCalibrationChargeCam;
|
|---|
| 33 | class MCalibrationQECam;
|
|---|
| 34 | class MGeomCam;
|
|---|
| 35 | class MExtractedSignalCam;
|
|---|
| 36 | class MExtractedSignalBlindPixel;
|
|---|
| 37 | class MExtractedSignalPINDiode;
|
|---|
| 38 | class MBadPixelsCam;
|
|---|
| 39 | class MBadPixelsPix;
|
|---|
| 40 | class MTime;
|
|---|
| 41 | class MCalibrationChargeCalc : public MTask
|
|---|
| 42 | {
|
|---|
| 43 | private:
|
|---|
| 44 |
|
|---|
| 45 | static const Float_t fgChargeLimit; //! Default for fChargeLimit (now set to: 3.)
|
|---|
| 46 | static const Float_t fgChargeErrLimit; //! Default for fChargeErrLimit (now set to: 0.)
|
|---|
| 47 | static const Float_t fgChargeRelErrLimit; //! Default for fChargeRelErrLimit (now set to: 1.)
|
|---|
| 48 | static const Float_t fgLambdaCheckLimit; //! Default for fLambdaCheckLimit (now set to: 0.2)
|
|---|
| 49 | static const Float_t fgLambdaErrLimit; //! Default for fLabmdaErrLimit (now set to: 0.2)
|
|---|
| 50 | static const Float_t fgPheErrLimit; //! Default for fPheErrLimit (now set to: 5.)
|
|---|
| 51 |
|
|---|
| 52 | // Variables
|
|---|
| 53 | Float_t fChargeLimit; // Limit acceptance mean charge (in units of PedRMS)
|
|---|
| 54 | Float_t fChargeErrLimit; // Limit acceptance charge error (in abs. numbers)
|
|---|
| 55 | Float_t fChargeRelErrLimit; // Limit acceptance rel. error mean (in abs. numbers)
|
|---|
| 56 | Byte_t fFlags; // Bit-field for the flags
|
|---|
| 57 | Float_t fLambdaCheckLimit; // Limit rel. diff. lambda and lambdacheck in Blind Pixel
|
|---|
| 58 | Float_t fLambdaErrLimit; // Limit acceptance lambda error in Blind Pixel
|
|---|
| 59 | Float_t fNumHiGainSamples; // Number High-Gain FADC slices used by extractor
|
|---|
| 60 | Float_t fNumLoGainSamples; // Number Low -Gain FADC slices used by extractor
|
|---|
| 61 | Float_t fPheErrLimit; // Limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
|
|---|
| 62 | Float_t fSqrtHiGainSamples; // Square root nr. High-Gain FADC slices used by extractor
|
|---|
| 63 | Float_t fSqrtLoGainSamples; // Square root nr. Low -Gain FADC slices used by extractor
|
|---|
| 64 | MCalibrationCam::PulserColor_t fPulserColor; // Calibration LEDs colour
|
|---|
| 65 |
|
|---|
| 66 | // Pointers
|
|---|
| 67 | MBadPixelsCam *fBadPixels; // Bad Pixels
|
|---|
| 68 | MCalibrationChargeCam *fCam; // Calibrated Charges of all pixels
|
|---|
| 69 | MCalibrationChargeBlindPix *fBlindPixel; // Calibrated Charges of the Blind Pixel
|
|---|
| 70 | MCalibrationChargePINDiode *fPINDiode; // Calibrated Charges of the PIN Diode
|
|---|
| 71 | MCalibrationQECam *fQECam; // Calibrated Quantum Efficiencies of all pixels
|
|---|
| 72 | MGeomCam *fGeom; //! Camera geometry
|
|---|
| 73 | MPedestalCam *fPedestals; //! Pedestals all pixels (calculated previously from ped.file)
|
|---|
| 74 | MTime *fEvtTime; //! Time of the event
|
|---|
| 75 |
|
|---|
| 76 | // enums
|
|---|
| 77 | enum { kHiLoGainCalibration };
|
|---|
| 78 |
|
|---|
| 79 | // functions
|
|---|
| 80 | void FinalizePedestals ( const MPedestalPix &ped, MCalibrationChargePix &cal );
|
|---|
| 81 | Bool_t FinalizeCharges ( MCalibrationChargePix &cal, MBadPixelsPix &bad );
|
|---|
| 82 | Bool_t FinalizePINDiode ();
|
|---|
| 83 | Bool_t FinalizeBlindPixel ();
|
|---|
| 84 | Bool_t FinalizeFFactorMethod ();
|
|---|
| 85 | void FinalizeBadPixels ();
|
|---|
| 86 | void FinalizeFFactorQECam ();
|
|---|
| 87 | void FinalizeBlindPixelQECam();
|
|---|
| 88 | void FinalizePINDiodeQECam ();
|
|---|
| 89 | void FinalizeUnsuitablePixels();
|
|---|
| 90 |
|
|---|
| 91 | void PrintUncalibrated( MBadPixelsPix::UncalibratedType_t typ, const char *text) const;
|
|---|
| 92 |
|
|---|
| 93 | Int_t PreProcess (MParList *pList);
|
|---|
| 94 | Bool_t ReInit (MParList *pList);
|
|---|
| 95 | Int_t Process ();
|
|---|
| 96 | Int_t PostProcess();
|
|---|
| 97 |
|
|---|
| 98 | public:
|
|---|
| 99 |
|
|---|
| 100 | MCalibrationChargeCalc(const char *name=NULL, const char *title=NULL);
|
|---|
| 101 |
|
|---|
| 102 | void Clear(const Option_t *o="");
|
|---|
| 103 |
|
|---|
| 104 | void SetChargeLimit ( const Float_t f=fgChargeLimit ) { fChargeLimit = f; }
|
|---|
| 105 | void SetChargeErrLimit ( const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; }
|
|---|
| 106 | void SetChargeRelErrLimit ( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; }
|
|---|
| 107 | void SetLambdaErrLimit ( const Float_t f=fgLambdaErrLimit ) { fLambdaErrLimit = f; }
|
|---|
| 108 | void SetLambdaCheckLimit ( const Float_t f=fgLambdaCheckLimit ) { fLambdaCheckLimit = f; }
|
|---|
| 109 | void SetPheErrLimit ( const Float_t f=fgPheErrLimit ) { fPheErrLimit = f; }
|
|---|
| 110 | void SetPulserColor ( const MCalibrationCam::PulserColor_t col ) { fPulserColor = col; }
|
|---|
| 111 |
|
|---|
| 112 | void SkipHiLoGainCalibration ( const Bool_t b=kTRUE )
|
|---|
| 113 | { b ? CLRBIT(fFlags, kHiLoGainCalibration) : SETBIT(fFlags, kHiLoGainCalibration); }
|
|---|
| 114 |
|
|---|
| 115 | ClassDef(MCalibrationChargeCalc, 1) // Task calculating Calibration Containers and Quantum Efficiencies
|
|---|
| 116 | };
|
|---|
| 117 |
|
|---|
| 118 | #endif
|
|---|