1 | #ifndef MARS_MCalibrationCalc
|
---|
2 | #define MARS_MCalibrationCalc
|
---|
3 |
|
---|
4 | /////////////////////////////////////////////////////////////////////////////
|
---|
5 | // //
|
---|
6 | // MCalibrationCalc //
|
---|
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 ROOT_TArrayI
|
---|
18 | #include "TArrayI.h"
|
---|
19 | #endif
|
---|
20 |
|
---|
21 | #ifndef MARS_MCalibrationCam
|
---|
22 | #include "MCalibrationCam.h"
|
---|
23 | #endif
|
---|
24 |
|
---|
25 | #include "TString.h"
|
---|
26 |
|
---|
27 | class MRawEvtData;
|
---|
28 | class MRawRunHeader;
|
---|
29 |
|
---|
30 | class MPedestalCam;
|
---|
31 | class MCalibrationCam;
|
---|
32 | class MExtractedSignalCam;
|
---|
33 |
|
---|
34 | class MTime;
|
---|
35 |
|
---|
36 | class MCalibrationCalc : public MTask
|
---|
37 | {
|
---|
38 | private:
|
---|
39 |
|
---|
40 | static const UInt_t fBlindPixelId; // ID of the blind pixel
|
---|
41 | static const UInt_t fPINDiodeId; // ID of the PIN Diode
|
---|
42 | static const Byte_t fgSaturationLimit; // Saturation of Hi Gain
|
---|
43 | static const Byte_t fgBlindPixelFirst; // First FADC slice blind pixel
|
---|
44 | static const Byte_t fgBlindPixelLast; // Last FADC slice blind pixel
|
---|
45 |
|
---|
46 | MPedestalCam *fPedestals; // Pedestals of all pixels in the camera
|
---|
47 | MCalibrationCam *fCalibrations; // Calibration events of all pixels in the camera
|
---|
48 | MExtractedSignalCam *fSignals; // Calibration events of all pixels in the camera
|
---|
49 |
|
---|
50 | MRawEvtData *fRawEvt; // raw event data (time slices)
|
---|
51 | MRawRunHeader *fRunHeader; // RunHeader information
|
---|
52 |
|
---|
53 | MTime *fEvtTime; // Time of the event
|
---|
54 |
|
---|
55 | Int_t fEvents; // Number of events
|
---|
56 | Int_t fCosmics; // Number of events due to supposed cosmics
|
---|
57 |
|
---|
58 | Byte_t fNumHiGainSamples;
|
---|
59 | Byte_t fNumLoGainSamples;
|
---|
60 | Float_t fSqrtHiGainSamples;
|
---|
61 |
|
---|
62 | Float_t fConversionHiLo;
|
---|
63 | Int_t fFlags; // Flag for the fits used
|
---|
64 |
|
---|
65 | TString fExcludedPixelsFile;
|
---|
66 | UInt_t fNumExcludedPixels;
|
---|
67 |
|
---|
68 | enum { kUseBlindPixelFit, kUsePinDiodeFit,
|
---|
69 | kUseCosmicsRejection, kUseQualityChecks,
|
---|
70 | kHiLoGainCalibration,
|
---|
71 | kHiGainOverFlow, kLoGainOverFlow };
|
---|
72 |
|
---|
73 | public:
|
---|
74 |
|
---|
75 | enum PulserColor_t { kEGreen, kEBlue, kEUV, kECT1 };
|
---|
76 |
|
---|
77 | private:
|
---|
78 |
|
---|
79 | PulserColor_t fColor;
|
---|
80 |
|
---|
81 | Bool_t ReInit(MParList *pList);
|
---|
82 | Int_t PreProcess(MParList *pList);
|
---|
83 | Int_t Process();
|
---|
84 | Int_t PostProcess();
|
---|
85 |
|
---|
86 | Bool_t CalcSignalBlindPixel(Byte_t *ptr, Float_t &signal, const Float_t ped) const;
|
---|
87 |
|
---|
88 | public:
|
---|
89 |
|
---|
90 | MCalibrationCalc(const char *name=NULL, const char *title=NULL);
|
---|
91 |
|
---|
92 | void Clear(const Option_t *o="");
|
---|
93 |
|
---|
94 | void SkipBlindPixelFit(Bool_t b=kTRUE)
|
---|
95 | {b ? CLRBIT(fFlags, kUseBlindPixelFit) : SETBIT(fFlags, kUseBlindPixelFit);}
|
---|
96 | void SkipPinDiodeFit(Bool_t b=kTRUE)
|
---|
97 | {b ? CLRBIT(fFlags, kUsePinDiodeFit) : SETBIT(fFlags, kUsePinDiodeFit);}
|
---|
98 | void SkipCosmicsRejection(Bool_t b=kTRUE)
|
---|
99 | {b ? CLRBIT(fFlags, kUseCosmicsRejection) : SETBIT(fFlags, kUseCosmicsRejection);}
|
---|
100 | void SkipQualityChecks(Bool_t b=kTRUE)
|
---|
101 | {b ? CLRBIT(fFlags, kUseQualityChecks) : SETBIT(fFlags, kUseQualityChecks);}
|
---|
102 | void SkipHiLoGainCalibration(Bool_t b=kTRUE)
|
---|
103 | {b ? CLRBIT(fFlags, kHiLoGainCalibration) : SETBIT(fFlags, kHiLoGainCalibration);}
|
---|
104 |
|
---|
105 |
|
---|
106 | // Setters
|
---|
107 | void SetPulserColor(PulserColor_t color) { fColor = color; }
|
---|
108 | void SetConversionHiLo(Float_t conv) { fConversionHiLo = conv; }
|
---|
109 |
|
---|
110 | // Getters
|
---|
111 | MCalibrationBlindPix *GetBlindPixel() const;
|
---|
112 | MCalibrationPINDiode *GetPINDiode() const;
|
---|
113 |
|
---|
114 | // Exclude pixels from configuration file
|
---|
115 | void ExcludePixelsFromAsciiFile(const char *file) { fExcludedPixelsFile = file; }
|
---|
116 |
|
---|
117 | ClassDef(MCalibrationCalc, 1) // Task to fill the Calibration Containers from raw data
|
---|
118 | };
|
---|
119 |
|
---|
120 | #endif
|
---|