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

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