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