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

Last change on this file since 3678 was 3678, checked in by gaug, 21 years ago
*** empty log message ***
File size: 6.4 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
21#ifndef MARS_MCalibrationCam
22#include "MCalibrationCam.h"
23#endif
24
25class MRawEvtData;
26class MRawRunHeader;
27class MPedestalCam;
28class MPedestalPix;
29class MCalibrationChargePINDiode;
30class MCalibrationChargeBlindPix;
31class MCalibrationChargePix;
32class MCalibrationChargeCam;
33class MCalibrationQECam;
34class MGeomCam;
35class MExtractedSignalCam;
36class MExtractedSignalBlindPixel;
37class MExtractedSignalPINDiode;
38class MBadPixelsCam;
39class MBadPixelsPix;
40class MTime;
41class MCalibrationChargeCalc : public MTask
42{
43private:
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 static const Float_t fgTimeLowerLimit; //! Default for fTimeLowerLimit (now set to: 1.)
52 static const Float_t fgTimeUpperLimit; //! Default for fTimeUpperLimit (now set to: 2.)
53
54 Float_t fChargeLimit; // Limit (in units of PedRMS) for acceptance of mean charge
55 Float_t fChargeErrLimit; // Limit (in units of PedRMS) for acceptance of charge sigma square
56 Float_t fChargeRelErrLimit; // Limit (in units of Sigma of fitted charge) for acceptance of mean
57 Float_t fLambdaCheckLimit; // Limit for rel. diff. lambda and lambdacheck blind pixel
58 Float_t fLambdaErrLimit; // Limit for acceptance of lambda error blind pixel
59 Float_t fPheErrLimit; // Limit for acceptance number phe's w.r.t area index mean (in sigmas)
60 Float_t fTimeLowerLimit; // Limit (in units of FADC slices) for dist. to first signal slice
61 Float_t fTimeUpperLimit; // Limit (in units of FADC slices) for dist. to last signal slice
62
63 MPedestalCam *fPedestals; //! Pedestals of all pixels in the camera
64 MCalibrationChargeCam *fCam; // Calibration events of all pixels in the camera
65 MCalibrationQECam *fQECam; // Derived Quantum efficiency of all pixels in the camera
66 MRawEvtData *fRawEvt; //! raw event data (time slices)
67 MRawRunHeader *fRunHeader; //! RunHeader information
68 MGeomCam *fGeom; //! Geometry information
69 MBadPixelsCam *fBadPixels; //! Bad Pixels information
70
71 MTime *fEvtTime; //! Time of the event
72
73 MExtractedSignalCam *fSignals; //! Extracted signal of pixels in the camera
74 MExtractedSignalBlindPixel *fSigBlind; //! Extracted signal of Blind Pixel
75 MExtractedSignalPINDiode *fSigPIN; //! Extracted signal of PIN Diode
76
77 MCalibrationChargePINDiode *fPINDiode; // Calibration results of the PIN Diode
78 MCalibrationChargeBlindPix *fBlindPixel; // Calibration results of the Blind Pixel
79
80 Float_t fNumHiGainSamples;
81 Float_t fNumLoGainSamples;
82 Float_t fSqrtHiGainSamples;
83 Float_t fSqrtLoGainSamples;
84
85 Float_t fConversionHiLo;
86 Int_t fFlags; // Flag for the fits used
87
88 enum { kUseQualityChecks, kHiLoGainCalibration };
89
90 MCalibrationCam::PulserColor_t fPulserColor;
91
92 Int_t PreProcess(MParList *pList);
93 Bool_t ReInit(MParList *pList);
94 Int_t Process();
95 Int_t PostProcess();
96
97 void FinalizePedestals ( const MPedestalPix &ped, MCalibrationChargePix &cal,
98 Float_t &avped, Float_t &avrms);
99 void FinalizeAvPedestals ( MCalibrationChargePix &cal, Float_t avped, Float_t avrms, Int_t avnum);
100 Bool_t FinalizeCharges ( MCalibrationChargePix &cal, MBadPixelsPix &bad );
101 Bool_t FinalizePINDiode();
102 Bool_t FinalizeBlindPixel();
103 Bool_t FinalizeFFactorMethod();
104 void FinalizeBadPixels();
105 void FinalizeBlindPixelQECam();
106 void FinalizePINDiodeQECam();
107
108 void PrintUnsuitable(MBadPixelsPix::UnsuitableType_t typ, const char *text) const;
109 void PrintUncalibrated(MBadPixelsPix::UncalibratedType_t typ, const char *text) const;
110
111public:
112
113 MCalibrationChargeCalc(const char *name=NULL, const char *title=NULL);
114
115 void Clear(const Option_t *o="");
116
117 void SetChargeLimit ( const Float_t f=fgChargeLimit ) { fChargeLimit = f; }
118 void SetChargeErrLimit ( const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; }
119 void SetChargeRelErrLimit( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; }
120 void SetPheErrLimit ( const Float_t f=fgPheErrLimit ) { fPheErrLimit = f; }
121 void SetLambdaErrLimit ( const Float_t f=fgLambdaErrLimit ) { fLambdaErrLimit = f; }
122 void SetLambdaCheckLimit ( const Float_t f=fgLambdaCheckLimit ) { fLambdaCheckLimit = f; }
123 void SetPulserColor ( MCalibrationCam::PulserColor_t col ) { fPulserColor = col; }
124 void SetTimeLowerLimit ( const Float_t f=fgTimeLowerLimit ) { fTimeLowerLimit = f; }
125 void SetTimeUpperLimit ( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; }
126
127 void SkipQualityChecks(Bool_t b=kTRUE)
128 {b ? CLRBIT(fFlags, kUseQualityChecks) : SETBIT(fFlags, kUseQualityChecks);}
129 void SkipHiLoGainCalibration(Bool_t b=kTRUE)
130 {b ? CLRBIT(fFlags, kHiLoGainCalibration) : SETBIT(fFlags, kHiLoGainCalibration);}
131
132 ClassDef(MCalibrationChargeCalc, 1) // Task to fill the Calibration Containers from raw data
133};
134
135#endif
Note: See TracBrowser for help on using the repository browser.