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

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