source: trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h@ 3614

Last change on this file since 3614 was 3602, checked in by gaug, 21 years ago
*** empty log message ***
File size: 4.9 KB
Line 
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
21class MRawEvtData;
22class MRawRunHeader;
23class MPedestalCam;
24class MPedestalPix;
25class MCalibrationChargePINDiode;
26class MCalibrationChargeBlindPix;
27class MCalibrationChargePix;
28class MCalibrationChargeCam;
29class MCalibrationQECam;
30class MGeomCam;
31class MExtractedSignalCam;
32class MBadPixelsCam;
33class MBadPixelsPix;
34class MTime;
35class MCalibrationChargeCalc : public MTask
36{
37private:
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
89public:
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
Note: See TracBrowser for help on using the repository browser.