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

Last change on this file since 4850 was 4672, checked in by gaug, 20 years ago
*** empty log message ***
File size: 7.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
21#ifndef MARS_MCalibrationCam
22#include "MCalibrationCam.h"
23#endif
24
25#ifndef ROOT_TArrayC
26#include "TArrayC.h"
27#endif
28
29class MRawEvtData;
30class MRawRunHeader;
31class MPedestalCam;
32class MPedestalPix;
33class MCalibrationChargePINDiode;
34class MCalibrationChargeBlindCam;
35class MCalibrationChargeBlindPix;
36class MCalibrationChargePix;
37class MCalibrationChargeCam;
38class MCalibrationQECam;
39class MGeomCam;
40class MExtractedSignalCam;
41class MExtractedSignalBlindPixel;
42class MExtractedSignalPINDiode;
43class MBadPixelsCam;
44class MBadPixelsPix;
45class MTime;
46class MCalibrationChargeCalc : public MTask
47{
48private:
49
50 static const Float_t fgChargeLimit; //! Default for fChargeLimit (now set to: 2.5)
51 static const Float_t fgChargeErrLimit; //! Default for fChargeErrLimit (now set to: 0.)
52 static const Float_t fgChargeRelErrLimit; //! Default for fChargeRelErrLimit (now set to: 1.)
53 static const Float_t fgLambdaCheckLimit; //! Default for fLambdaCheckLimit (now set to: 0.2)
54 static const Float_t fgLambdaErrLimit; //! Default for fLabmdaErrLimit (now set to: 0.5)
55 static const Float_t fgPheErrLimit; //! Default for fPheErrLimit (now set to: 4.5)
56 static const Float_t fgFFactorErrLimit; //! Default for fFFactorErrLimit (now set to: 4.5)
57
58 // Variables
59 Float_t fChargeLimit; // Limit acceptance mean charge (in units of PedRMS)
60 Float_t fChargeErrLimit; // Limit acceptance charge error (in abs. numbers)
61 Float_t fChargeRelErrLimit; // Limit acceptance rel. error mean (in abs. numbers)
62 Float_t fLambdaCheckLimit; // Limit rel. diff. lambda and lambdacheck in Blind Pixel
63 Float_t fLambdaErrLimit; // Limit acceptance lambda error in Blind Pixel
64 Float_t fNumHiGainSamples; // Number High-Gain FADC slices used by extractor
65 Float_t fNumLoGainSamples; // Number Low -Gain FADC slices used by extractor
66 Float_t fPheErrLimit; // Limit acceptance nr. phe's w.r.t. area idx mean (in sigmas)
67 Float_t fFFactorErrLimit; // Limit acceptance F-Factor w.r.t. area idx mean
68 Float_t fSqrtHiGainSamples; // Square root nr. High-Gain FADC slices used by extractor
69 Float_t fSqrtLoGainSamples; // Square root nr. Low -Gain FADC slices used by extractor
70 MCalibrationCam::PulserColor_t fPulserColor; // Calibration LEDs colour
71 Int_t fNumInnerFFactorMethodUsed; // Number of inner pixels used for F-Factor Method calibration
72
73 Byte_t fFlags; // Bit-field for the general flags
74 TArrayC fResultFlags; // Bit-fields for the fitting results (one field per area index)
75 TArrayC fBlindPixelFlags; // Bit-fields for the blind pixel flags (one field per blind pixel)
76 TArrayC fPINDiodeFlags; // Bit-fields for the PIN Diode flags (one field per PIN Diode )
77
78 TString fOutputPath; // Path to the output file
79 TString fOutputFile; // Name of the output file
80
81 // Pointers
82 MBadPixelsCam *fBadPixels; // Bad Pixels
83 MCalibrationChargeCam *fCam; // Calibrated Charges of all pixels
84 MCalibrationChargeBlindPix *fBlindPixel; // Calibrated Charges of the Blind Pixel
85 MCalibrationChargeBlindCam *fBlindCam; // Calibrated Charges of the Blind Pixels
86 MCalibrationChargePINDiode *fPINDiode; // Calibrated Charges of the PIN Diode
87 MCalibrationQECam *fQECam; // Calibrated Quantum Efficiencies of all pixels
88 MGeomCam *fGeom; //! Camera geometry
89 MPedestalCam *fPedestals; //! Pedestals all pixels (calculated previously from ped.file)
90
91 // enums
92 enum { kDebug, kPheFitOK, kFFactorFitOK, kBlindPixelFitOK, kBlindPixelPedFitOK, kPINDiodeFitOK };
93
94 // functions
95 const char* GetOutputFile();
96 void FinalizePedestals ( const MPedestalPix &ped, MCalibrationChargePix &cal, const Int_t aidx );
97 Bool_t FinalizeCharges ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what);
98 Bool_t FinalizePINDiode ();
99 Bool_t FinalizeBlindPixel ();
100 Bool_t FinalizeBlindCam ();
101 Bool_t FinalizeFFactorMethod ();
102 void FinalizeBadPixels ();
103 void FinalizeFFactorQECam ();
104 void FinalizeBlindPixelQECam ();
105 void FinalizePINDiodeQECam ();
106 void FinalizeUnsuitablePixels();
107
108 void PrintUncalibrated( MBadPixelsPix::UncalibratedType_t typ, const char *text) const;
109
110 void SetPheFitOK ( const Int_t aidx, const Bool_t b=kTRUE ) {
111 b ? SETBIT(fResultFlags[aidx], kPheFitOK)
112 : CLRBIT(fResultFlags[aidx], kPheFitOK); }
113 void SetFFactorFitOK ( const Int_t aidx, const Bool_t b=kTRUE ) {
114 b ? SETBIT(fResultFlags[aidx], kFFactorFitOK)
115 : CLRBIT(fResultFlags[aidx], kFFactorFitOK); }
116 void SetBlindPixelFitOK ( const Int_t idx, const Bool_t b=kTRUE ) {
117 b ? SETBIT(fBlindPixelFlags[idx], kBlindPixelFitOK)
118 : CLRBIT(fBlindPixelFlags[idx], kBlindPixelFitOK); }
119 void SetBlindPixelPedFitOK( const Int_t idx, const Bool_t b=kTRUE ) {
120 b ? SETBIT(fBlindPixelFlags[idx], kBlindPixelPedFitOK)
121 : CLRBIT(fBlindPixelFlags[idx], kBlindPixelPedFitOK); }
122 void SetPINDiodeFitOK ( const Int_t idx, const Bool_t b=kTRUE ) {
123 b ? SETBIT(fPINDiodeFlags[idx], kPINDiodeFitOK)
124 : CLRBIT(fPINDiodeFlags[idx], kPINDiodeFitOK); }
125
126 Int_t PreProcess (MParList *pList);
127 Bool_t ReInit (MParList *pList);
128 Int_t Process ();
129 Int_t PostProcess();
130 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
131
132public:
133
134 MCalibrationChargeCalc(const char *name=NULL, const char *title=NULL);
135
136 void Clear(const Option_t *o="");
137
138 Bool_t IsDebug() const { return TESTBIT(fFlags,kDebug); }
139
140 void SetChargeLimit ( const Float_t f=fgChargeLimit ) { fChargeLimit = f; }
141 void SetChargeErrLimit ( const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; }
142 void SetChargeRelErrLimit ( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; }
143 void SetDebug ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags, kDebug)
144 : CLRBIT(fFlags, kDebug); }
145 void SetFFactorErrLimit ( const Float_t f=fgFFactorErrLimit ) { fFFactorErrLimit = f; }
146 void SetLambdaErrLimit ( const Float_t f=fgLambdaErrLimit ) { fLambdaErrLimit = f; }
147 void SetLambdaCheckLimit ( const Float_t f=fgLambdaCheckLimit ) { fLambdaCheckLimit = f; }
148 void SetOutputPath ( TString path="." );
149 void SetOutputFile ( TString file="ChargeCalibStat.txt" );
150 void SetPheErrLimit ( const Float_t f=fgPheErrLimit ) { fPheErrLimit = f; }
151 void SetPulserColor ( const MCalibrationCam::PulserColor_t col ) { fPulserColor = col; }
152
153
154 ClassDef(MCalibrationChargeCalc, 1) // Task calculating Calibration Containers and Quantum Efficiencies
155};
156
157#endif
Note: See TracBrowser for help on using the repository browser.