| 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 | class MRawEvtData;
|
|---|
| 22 | class MRawRunHeader;
|
|---|
| 23 | class MPedestalCam;
|
|---|
| 24 | class MPedestalPix;
|
|---|
| 25 | class MCalibrationChargePINDiode;
|
|---|
| 26 | class MCalibrationChargeBlindPix;
|
|---|
| 27 | class MCalibrationChargePix;
|
|---|
| 28 | class MCalibrationChargeCam;
|
|---|
| 29 | class MCalibrationQECam;
|
|---|
| 30 | class MGeomCam;
|
|---|
| 31 | class MExtractedSignalCam;
|
|---|
| 32 | class MExtractedSignalBlindPixel;
|
|---|
| 33 | class MExtractedSignalPINDiode;
|
|---|
| 34 | class MBadPixelsCam;
|
|---|
| 35 | class MBadPixelsPix;
|
|---|
| 36 | class MTime;
|
|---|
| 37 | class MCalibrationChargeCalc : public MTask
|
|---|
| 38 | {
|
|---|
| 39 | private:
|
|---|
| 40 |
|
|---|
| 41 | static const Float_t fgChargeLimit; //! Default for fChargeLimit (now set to: 3.)
|
|---|
| 42 | static const Float_t fgChargeErrLimit; //! Default for fChargeErrLimit (now set to: 0.)
|
|---|
| 43 | static const Float_t fgChargeRelErrLimit; //! Default for fChargeRelErrLimit (now set to: 1.)
|
|---|
| 44 | static const Float_t fgLambdaCheckLimit; //! Default for fLambdaCheckLimit (now set to: 0.2)
|
|---|
| 45 | static const Float_t fgLambdaErrLimit; //! Default for fLabmdaErrLimit (now set to: 0.2)
|
|---|
| 46 | static const Float_t fgTimeLowerLimit; //! Default for fTimeLowerLimit (now set to: 1.)
|
|---|
| 47 | static const Float_t fgTimeUpperLimit; //! Default for fTimeUpperLimit (now set to: 2.)
|
|---|
| 48 |
|
|---|
| 49 | Float_t fChargeLimit; // Limit (in units of PedRMS) for acceptance of mean charge
|
|---|
| 50 | Float_t fChargeErrLimit; // Limit (in units of PedRMS) for acceptance of charge sigma square
|
|---|
| 51 | Float_t fChargeRelErrLimit; // Limit (in units of Sigma of fitted charge) for acceptance of mean
|
|---|
| 52 | Float_t fLambdaCheckLimit; // Limit for rel. diff. lambda and lambdacheck blind pixel
|
|---|
| 53 | Float_t fLambdaErrLimit; // Limit for acceptance of lambda error blind pixel
|
|---|
| 54 | Float_t fTimeLowerLimit; // Limit (in units of FADC slices) for dist. to first signal slice
|
|---|
| 55 | Float_t fTimeUpperLimit; // Limit (in units of FADC slices) for dist. to last signal slice
|
|---|
| 56 |
|
|---|
| 57 | MPedestalCam *fPedestals; //! Pedestals of all pixels in the camera
|
|---|
| 58 | MCalibrationChargeCam *fCam; // Calibration events of all pixels in the camera
|
|---|
| 59 | MCalibrationQECam *fQECam; // Derived Quantum efficiency of all pixels in the camera
|
|---|
| 60 | MRawEvtData *fRawEvt; //! raw event data (time slices)
|
|---|
| 61 | MRawRunHeader *fRunHeader; //! RunHeader information
|
|---|
| 62 | MGeomCam *fGeom; //! Geometry information
|
|---|
| 63 | MBadPixelsCam *fBadPixels; //! Bad Pixels information
|
|---|
| 64 |
|
|---|
| 65 | MTime *fEvtTime; //! Time of the event
|
|---|
| 66 |
|
|---|
| 67 | MExtractedSignalCam *fSignals; //! Extracted signal of pixels in the camera
|
|---|
| 68 | MExtractedSignalBlindPixel *fSigBlind; //! Extracted signal of Blind Pixel
|
|---|
| 69 | MExtractedSignalPINDiode *fSigPIN; //! Extracted signal of PIN Diode
|
|---|
| 70 |
|
|---|
| 71 | MCalibrationChargePINDiode *fPINDiode; // Calibration results of the PIN Diode
|
|---|
| 72 | MCalibrationChargeBlindPix *fBlindPixel; // Calibration results of the Blind Pixel
|
|---|
| 73 |
|
|---|
| 74 | Float_t fNumHiGainSamples;
|
|---|
| 75 | Float_t fNumLoGainSamples;
|
|---|
| 76 | Float_t fSqrtHiGainSamples;
|
|---|
| 77 | Float_t fSqrtLoGainSamples;
|
|---|
| 78 |
|
|---|
| 79 | Float_t fConversionHiLo;
|
|---|
| 80 | Int_t fFlags; // Flag for the fits used
|
|---|
| 81 |
|
|---|
| 82 | enum { kUseQualityChecks,
|
|---|
| 83 | kHiLoGainCalibration };
|
|---|
| 84 |
|
|---|
| 85 | Int_t PreProcess(MParList *pList);
|
|---|
| 86 | Bool_t ReInit(MParList *pList);
|
|---|
| 87 | Int_t Process();
|
|---|
| 88 | Int_t PostProcess();
|
|---|
| 89 |
|
|---|
| 90 | void FinalizePedestals(const MPedestalPix &ped, MCalibrationChargePix &cal,
|
|---|
| 91 | Float_t &avped, Float_t &avrms);
|
|---|
| 92 | void FinalizeAvPedestals(MCalibrationChargePix &cal, Float_t avped, Float_t avrms, Int_t avnum);
|
|---|
| 93 | Bool_t FinalizeCharges(MCalibrationChargePix &cal, MBadPixelsPix &bad);
|
|---|
| 94 | Bool_t FinalizePINDiode();
|
|---|
| 95 | Bool_t FinalizeBlindPixel();
|
|---|
| 96 |
|
|---|
| 97 | void PrintUnsuitable(MBadPixelsPix::UnsuitableType_t typ, const char *text) const;
|
|---|
| 98 | void PrintUncalibrated(MBadPixelsPix::UncalibratedType_t typ, const char *text) const;
|
|---|
| 99 |
|
|---|
| 100 | public:
|
|---|
| 101 |
|
|---|
| 102 | MCalibrationChargeCalc(const char *name=NULL, const char *title=NULL);
|
|---|
| 103 |
|
|---|
| 104 | void Clear(const Option_t *o="");
|
|---|
| 105 |
|
|---|
| 106 | void SetChargeLimit ( const Float_t f=fgChargeLimit ) { fChargeLimit = f; }
|
|---|
| 107 | void SetChargeErrLimit ( const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; }
|
|---|
| 108 | void SetChargeRelErrLimit( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; }
|
|---|
| 109 | void SetLambdaErrLimit ( const Float_t f=fgLambdaErrLimit ) { fLambdaErrLimit = f; }
|
|---|
| 110 | void SetLambdaCheckLimit ( const Float_t f=fgLambdaCheckLimit ) { fLambdaCheckLimit = f; }
|
|---|
| 111 |
|
|---|
| 112 | void SetTimeLowerLimit ( const Float_t f=fgTimeLowerLimit ) { fTimeLowerLimit = f; }
|
|---|
| 113 | void SetTimeUpperLimit ( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; }
|
|---|
| 114 |
|
|---|
| 115 | void SkipQualityChecks(Bool_t b=kTRUE)
|
|---|
| 116 | {b ? CLRBIT(fFlags, kUseQualityChecks) : SETBIT(fFlags, kUseQualityChecks);}
|
|---|
| 117 | void SkipHiLoGainCalibration(Bool_t b=kTRUE)
|
|---|
| 118 | {b ? CLRBIT(fFlags, kHiLoGainCalibration) : SETBIT(fFlags, kHiLoGainCalibration);}
|
|---|
| 119 |
|
|---|
| 120 | ClassDef(MCalibrationChargeCalc, 1) // Task to fill the Calibration Containers from raw data
|
|---|
| 121 | };
|
|---|
| 122 |
|
|---|
| 123 | #endif
|
|---|