1 | #ifndef MARS_MCalibrationChargeCalc
|
---|
2 | #define MARS_MCalibrationChargeCalc
|
---|
3 |
|
---|
4 | #ifndef MARS_MTask
|
---|
5 | #include "MTask.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef ROOT_TArrayC
|
---|
9 | #include <TArrayC.h>
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | #ifndef MARS_MBadPixelsPix
|
---|
13 | #include "MBadPixelsPix.h"
|
---|
14 | #endif
|
---|
15 |
|
---|
16 | #ifndef MARS_MCalibrationCam
|
---|
17 | #include "MCalibrationCam.h"
|
---|
18 | #endif
|
---|
19 |
|
---|
20 | class MCalibrationPattern;
|
---|
21 | class MPedestalCam;
|
---|
22 | class MPedestalPix;
|
---|
23 | class MCalibrationChargePINDiode;
|
---|
24 | class MHCalibrationChargeBlindCam;
|
---|
25 | class MCalibrationBlindCam;
|
---|
26 | class MCalibrationChargePix;
|
---|
27 | class MCalibrationChargeCam;
|
---|
28 | class MHCalibrationChargeCam;
|
---|
29 | class MCalibrationQECam;
|
---|
30 | class MGeomCam;
|
---|
31 | class MExtractedSignalCam;
|
---|
32 | class MBadPixelsCam;
|
---|
33 | class MExtractor;
|
---|
34 |
|
---|
35 | class MCalibrationChargeCalc : public MTask
|
---|
36 | {
|
---|
37 | private:
|
---|
38 |
|
---|
39 | static const Float_t fgChargeLimit; //! Default for fChargeLimit (now set to: 2.5)
|
---|
40 | static const Float_t fgChargeErrLimit; //! Default for fChargeErrLimit (now set to: 0.)
|
---|
41 | static const Float_t fgChargeRelErrLimit; //! Default for fChargeRelErrLimit (now set to: 1.)
|
---|
42 | static const Float_t fgLambdaCheckLimit; //! Default for fLambdaCheckLimit (now set to: 0.2)
|
---|
43 | static const Float_t fgLambdaErrLimit; //! Default for fLabmdaErrLimit (now set to: 0.5)
|
---|
44 | static const Float_t fgPheErrLowerLimit; //! Default for fPheErrLowerLimit (now set to: 9.0)
|
---|
45 | static const Float_t fgPheErrUpperLimit; //! Default for fPheErrUpperLimit (now set to: 4.5)
|
---|
46 | static const Float_t fgFFactorErrLimit; //! Default for fFFactorErrLimit (now set to: 4.5)
|
---|
47 | static const Float_t fgArrTimeRmsLimit; //! Default for fArrTimeRmsLimit (now set to: 3.5)
|
---|
48 | static const Float_t fgUnsuitablesLimit; //! Default for fUnsuitableLimit (now set to: 0.1)
|
---|
49 | static const Float_t fgUnreliablesLimit; //! Default for fUnreliableLimit (now set to: 0.3)
|
---|
50 |
|
---|
51 | static const TString fgNamePedestalCam; //! "MPedestalCam"
|
---|
52 |
|
---|
53 | // Variables
|
---|
54 | Float_t fArrTimeRmsLimit; // Limit acceptance RMS of absolute arrival times
|
---|
55 | Float_t fChargeLimit; // Limit acceptance mean charge (in units of PedRMS)
|
---|
56 | Float_t fChargeErrLimit; // Limit acceptance charge error (in abs. numbers)
|
---|
57 | Float_t fChargeRelErrLimit; // Limit acceptance rel. error mean (in abs. numbers)
|
---|
58 | Float_t fFFactorErrLimit; // Limit acceptance F-Factor w.r.t. area idx mean
|
---|
59 | Float_t fLambdaCheckLimit; // Limit rel. diff. lambda and lambdacheck in Blind Pixel
|
---|
60 | Float_t fLambdaErrLimit; // Limit acceptance lambda error in Blind Pixel
|
---|
61 | Float_t fNumHiGainSamples; // Number High-Gain FADC slices used by extractor
|
---|
62 | Float_t fNumLoGainSamples; // Number Low -Gain FADC slices used by extractor
|
---|
63 | Float_t fPheErrLowerLimit; // Lower limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
|
---|
64 | Float_t fPheErrUpperLimit; // Upper limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
|
---|
65 | Float_t fSqrtHiGainSamples; // Square root nr. High-Gain FADC slices used by extractor
|
---|
66 | Float_t fSqrtLoGainSamples; // Square root nr. Low -Gain FADC slices used by extractor
|
---|
67 | Float_t fUnsuitablesLimit; // Limit for relative number of unsuitable pixels
|
---|
68 | Float_t fUnreliablesLimit; // Limit for relative number of unreliable pixels
|
---|
69 |
|
---|
70 | Float_t fExternalNumPhes; // External mean number of photo-electrons set from outside
|
---|
71 | Float_t fExternalNumPhesRelVar; // External rel. var. number of photo-electrons set from outside
|
---|
72 |
|
---|
73 | MCalibrationCam::PulserColor_t fPulserColor; // Calibration LEDs colour
|
---|
74 | Float_t fStrength; // Calibration LEDs strength
|
---|
75 |
|
---|
76 | Int_t fNumInnerFFactorMethodUsed; // Number of inner pixels used for F-Factor Method calibration
|
---|
77 |
|
---|
78 | TString fNamePedestalCam; // Name of the 'MPedestalCam' container
|
---|
79 |
|
---|
80 | Int_t fNumProcessed; // Number of processed events (for Intensity calibration)
|
---|
81 |
|
---|
82 | Bool_t fContinousCalibration;
|
---|
83 |
|
---|
84 | // Pointers
|
---|
85 | // MBadPixelsIntensityCam *fIntensBad; //! Bad Pixels
|
---|
86 | MBadPixelsCam *fBadPixels; //! Bad Pixels
|
---|
87 | MCalibrationChargeCam *fCam; //! Calibrated Charges results of all pixels
|
---|
88 | MHCalibrationChargeCam *fHCam; //! Charges histograms of all pixels
|
---|
89 | MCalibrationBlindCam *fBlindCam; //! Calibrated Charges of the Blind Pixels
|
---|
90 | MHCalibrationChargeBlindCam *fHBlindCam; //! Charges histograms of the Blind Pixels
|
---|
91 | MCalibrationChargePINDiode *fPINDiode; //! Calibrated Charges of the PIN Diode
|
---|
92 | MCalibrationQECam *fQECam; //! Calibrated Quantum Efficiencies of all pixels
|
---|
93 | MGeomCam *fGeom; //! Camera geometry
|
---|
94 | MExtractedSignalCam *fSignal; //! Extracted Signal
|
---|
95 | MCalibrationPattern *fCalibPattern; //! Calibration DM pattern
|
---|
96 | MPedestalCam *fPedestals; //! Pedestals all pixels (calculated previously from ped.file)
|
---|
97 | MExtractor *fExtractor; //! Signal Extractor
|
---|
98 |
|
---|
99 | // enums
|
---|
100 | enum Check_t
|
---|
101 | {
|
---|
102 | kCheckDeadPixels,
|
---|
103 | kCheckExtractionWindow,
|
---|
104 | kCheckHistOverflow,
|
---|
105 | kCheckDeviatingBehavior,
|
---|
106 | kCheckOscillations,
|
---|
107 | kCheckArrivalTimes
|
---|
108 | }; // Possible Checks
|
---|
109 |
|
---|
110 | Byte_t fCheckFlags; // Bit-field to hold the possible check flags
|
---|
111 |
|
---|
112 | enum FitResult_t { kPheFitOK,
|
---|
113 | kFFactorFitOK,
|
---|
114 | kBlindPixelFitOK,
|
---|
115 | kBlindPixelPedFitOK,
|
---|
116 | kPINDiodeFitOK }; // Possible Fit Result flags
|
---|
117 |
|
---|
118 | TArrayC fResultFlags; // Bit-fields for the fitting results (one field per area index)
|
---|
119 | TArrayC fBlindPixelFlags; // Bit-fields for the blind pixel flags (one field per blind pixel)
|
---|
120 | TArrayC fPINDiodeFlags; // Bit-fields for the PIN Diode flags (one field per PIN Diode )
|
---|
121 |
|
---|
122 | enum { kDebug,
|
---|
123 | kUseExtractorRes,
|
---|
124 | kUseUnreliables,
|
---|
125 | kUseExternalNumPhes }; // Possible general flags
|
---|
126 |
|
---|
127 | Byte_t fFlags; // Bit-field to hold the general flags
|
---|
128 |
|
---|
129 | // functions
|
---|
130 | void FinalizeArrivalTimes ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what);
|
---|
131 | void FinalizeBadPixels ();
|
---|
132 | Bool_t FinalizeBlindCam ();
|
---|
133 | void FinalizeBlindPixelQECam ();
|
---|
134 | Bool_t FinalizeCharges ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what);
|
---|
135 | void FinalizeCombinedQECam ();
|
---|
136 | void FinalizeFFactorQECam ();
|
---|
137 | Bool_t FinalizeFFactorMethod ();
|
---|
138 | void FinalizePedestals ( const MPedestalPix &ped, MCalibrationChargePix &cal, const Int_t aidx );
|
---|
139 | Bool_t FinalizePINDiode ();
|
---|
140 | void FinalizePINDiodeQECam ();
|
---|
141 | Bool_t FinalizeUnsuitablePixels();
|
---|
142 |
|
---|
143 | const char* GetOutputFile();
|
---|
144 |
|
---|
145 | // Query checks
|
---|
146 | Bool_t IsCheckDeadPixels () const { return TESTBIT(fCheckFlags,kCheckDeadPixels); }
|
---|
147 | Bool_t IsCheckDeviatingBehavior() const { return TESTBIT(fCheckFlags,kCheckDeviatingBehavior); }
|
---|
148 | Bool_t IsCheckExtractionWindow () const { return TESTBIT(fCheckFlags,kCheckExtractionWindow); }
|
---|
149 | Bool_t IsCheckHistOverflow () const { return TESTBIT(fCheckFlags,kCheckHistOverflow); }
|
---|
150 | Bool_t IsCheckOscillations () const { return TESTBIT(fCheckFlags,kCheckOscillations); }
|
---|
151 | Bool_t IsCheckArrivalTimes () const { return TESTBIT(fCheckFlags,kCheckArrivalTimes); }
|
---|
152 |
|
---|
153 | Bool_t IsDebug () const { return TESTBIT(fFlags,kDebug); }
|
---|
154 | Bool_t IsUseExtractorRes () const { return TESTBIT(fFlags,kUseExtractorRes); }
|
---|
155 | Bool_t IsUseUnreliables () const { return TESTBIT(fFlags,kUseUnreliables); }
|
---|
156 | Bool_t IsUseExternalNumPhes () const { return TESTBIT(fFlags,kUseExternalNumPhes); }
|
---|
157 |
|
---|
158 | void PrintUncalibrated( MBadPixelsPix::UncalibratedType_t typ, const char *text) const;
|
---|
159 |
|
---|
160 | // Global fit results
|
---|
161 | void SetPheFitOK (const Int_t aidx, const Bool_t b=kTRUE) { b ? SETBIT(fResultFlags[aidx], kPheFitOK) : CLRBIT(fResultFlags[aidx], kPheFitOK); }
|
---|
162 | void SetFFactorFitOK (const Int_t aidx, const Bool_t b=kTRUE) { b ? SETBIT(fResultFlags[aidx], kFFactorFitOK) : CLRBIT(fResultFlags[aidx], kFFactorFitOK); }
|
---|
163 | void SetBlindPixelFitOK (const Int_t idx, const Bool_t b=kTRUE) { b ? SETBIT(fBlindPixelFlags[idx], kBlindPixelFitOK) : CLRBIT(fBlindPixelFlags[idx], kBlindPixelFitOK); }
|
---|
164 | void SetBlindPixelPedFitOK(const Int_t idx, const Bool_t b=kTRUE) { b ? SETBIT(fBlindPixelFlags[idx], kBlindPixelPedFitOK): CLRBIT(fBlindPixelFlags[idx], kBlindPixelPedFitOK); }
|
---|
165 | void SetPINDiodeFitOK (const Int_t idx, const Bool_t b=kTRUE) { b ? SETBIT(fPINDiodeFlags[idx], kPINDiodeFitOK): CLRBIT(fPINDiodeFlags[idx], kPINDiodeFitOK); }
|
---|
166 |
|
---|
167 | Int_t PreProcess (MParList *pList);
|
---|
168 | Bool_t ReInit (MParList *pList);
|
---|
169 | Int_t Process ();
|
---|
170 | Int_t PostProcess();
|
---|
171 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
172 |
|
---|
173 | public:
|
---|
174 | MCalibrationChargeCalc(const char *name=NULL, const char *title=NULL);
|
---|
175 |
|
---|
176 | void Clear(const Option_t *o="");
|
---|
177 |
|
---|
178 | void ResetNumProcessed() { fNumProcessed=0; }
|
---|
179 |
|
---|
180 | Int_t Finalize();
|
---|
181 |
|
---|
182 | void SetChargeLimit (const Float_t f=fgChargeLimit ) { fChargeLimit = f; }
|
---|
183 | void SetChargeErrLimit (const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; }
|
---|
184 | void SetChargeRelErrLimit(const Float_t f=fgChargeRelErrLimit) { fChargeRelErrLimit = f; }
|
---|
185 |
|
---|
186 | // Checks
|
---|
187 | void SetCheckArrivalTimes(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckArrivalTimes) : CLRBIT(fCheckFlags,kCheckArrivalTimes); }
|
---|
188 | void SetCheckDeadPixels(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckDeadPixels) : CLRBIT(fCheckFlags,kCheckDeadPixels); }
|
---|
189 | void SetCheckDeviatingBehavior(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckDeviatingBehavior) : CLRBIT(fCheckFlags,kCheckDeviatingBehavior); }
|
---|
190 | void SetCheckExtractionWindow(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckExtractionWindow) : CLRBIT(fCheckFlags,kCheckExtractionWindow); }
|
---|
191 | void SetCheckHistOverflow(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckHistOverflow) : CLRBIT(fCheckFlags,kCheckHistOverflow); }
|
---|
192 | void SetCheckOscillations(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckOscillations) : CLRBIT(fCheckFlags,kCheckOscillations); }
|
---|
193 | void SetDebug(const Bool_t b=kTRUE) { b ? SETBIT(fFlags, kDebug) : CLRBIT(fFlags, kDebug); }
|
---|
194 | void SetUseExtractorRes(const Bool_t b=kTRUE) { b ? SETBIT(fFlags, kUseExtractorRes) : CLRBIT(fFlags, kUseExtractorRes); }
|
---|
195 | void SetUseUnreliables(const Bool_t b=kTRUE) { b ? SETBIT(fFlags, kUseUnreliables) : CLRBIT(fFlags, kUseUnreliables); }
|
---|
196 | void SetUseExternalNumPhes(const Bool_t b=kTRUE) { b ? SETBIT(fFlags, kUseExternalNumPhes) : CLRBIT(fFlags, kUseExternalNumPhes); }
|
---|
197 |
|
---|
198 | void SetContinousCalibration(const Bool_t b=kTRUE) { fContinousCalibration = b; }
|
---|
199 |
|
---|
200 | // pointers
|
---|
201 | void SetPedestals(MPedestalCam *cam) { fPedestals=cam; }
|
---|
202 | void SetExtractor(MExtractor *ext) { fExtractor=ext; }
|
---|
203 |
|
---|
204 | // limits
|
---|
205 | void SetArrTimeRmsLimit (const Float_t f=fgArrTimeRmsLimit ) { fArrTimeRmsLimit = f; }
|
---|
206 | void SetFFactorErrLimit (const Float_t f=fgFFactorErrLimit ) { fFFactorErrLimit = f; }
|
---|
207 | void SetLambdaErrLimit (const Float_t f=fgLambdaErrLimit ) { fLambdaErrLimit = f; }
|
---|
208 | void SetLambdaCheckLimit(const Float_t f=fgLambdaCheckLimit) { fLambdaCheckLimit = f; }
|
---|
209 | void SetUnsuitablesLimit(const Float_t f=fgUnsuitablesLimit) { fUnsuitablesLimit = f; }
|
---|
210 | void SetUnreliablesLimit(const Float_t f=fgUnreliablesLimit) { fUnreliablesLimit = f; }
|
---|
211 |
|
---|
212 | // others
|
---|
213 | void SetExternalNumPhes ( const Float_t f=0. ) { fExternalNumPhes = f; }
|
---|
214 | void SetExternalNumPhesRelVar( const Float_t f=0. ) { fExternalNumPhesRelVar = f; }
|
---|
215 | void SetNamePedestalCam ( const char *name=fgNamePedestalCam.Data()) { fNamePedestalCam = name; }
|
---|
216 | void SetPheErrLowerLimit ( const Float_t f=fgPheErrLowerLimit ) { fPheErrLowerLimit = f; }
|
---|
217 | void SetPheErrUpperLimit ( const Float_t f=fgPheErrUpperLimit ) { fPheErrUpperLimit = f; }
|
---|
218 | void SetPulserColor ( const MCalibrationCam::PulserColor_t col ) { fPulserColor = col; }
|
---|
219 |
|
---|
220 | ClassDef(MCalibrationChargeCalc, 6) // Task calculating Calibration Containers and Quantum Efficiencies
|
---|
221 | };
|
---|
222 |
|
---|
223 | #endif
|
---|