source: trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.h@ 3123

Last change on this file since 3123 was 3123, checked in by gaug, 21 years ago
*** empty log message ***
File size: 4.2 KB
Line 
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
27class MRawEvtData;
28class MRawRunHeader;
29
30class MPedestalCam;
31class MCalibrationCam;
32class MExtractedSignalCam;
33
34class MTime;
35
36class MCalibrationCalc : public MTask
37{
38private:
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 Int_t fgBlindPixelFirst; // First FADC slice blind pixel
44 static const Int_t fgBlindPixelLast; // Last FADC slice blind pixel
45 static const Int_t fgBlindPixelSinglePheCut; // FADC sum from which on an event is considered as a S.ph. one.
46
47 MPedestalCam *fPedestals; // Pedestals of all pixels in the camera
48 MCalibrationCam *fCalibrations; // Calibration events of all pixels in the camera
49 MExtractedSignalCam *fSignals; // Calibration events of all pixels in the camera
50
51 MRawEvtData *fRawEvt; // raw event data (time slices)
52 MRawRunHeader *fRunHeader; // RunHeader information
53
54 MTime *fEvtTime; // Time of the event
55
56 Byte_t fNumHiGainSamples;
57 Byte_t fNumLoGainSamples;
58 Float_t fSqrtHiGainSamples;
59
60 Int_t fBlindPixelFirst;
61 Int_t fBlindPixelLast;
62 Int_t fBlindPixelSinglePheCut;
63
64 Int_t fNumBlindPixelSinglePhe;
65 Int_t fNumBlindPixelPedestal;
66
67 Float_t fConversionHiLo;
68 Int_t fFlags; // Flag for the fits used
69
70 TString fExcludedPixelsFile;
71 UInt_t fNumExcludedPixels;
72
73 enum { kUseBlindPixelFit,
74 kUsePinDiodeFit,
75 kUseQualityChecks,
76 kHiLoGainCalibration,
77 kHiGainOverFlow,
78 kLoGainOverFlow };
79
80public:
81
82 enum PulserColor_t { kEGreen, kEBlue, kEUV, kECT1 };
83
84private:
85
86 PulserColor_t fColor;
87
88 Bool_t ReInit(MParList *pList);
89 Int_t PreProcess(MParList *pList);
90 Int_t Process();
91 Int_t PostProcess();
92
93 Bool_t CalcSignalBlindPixel(Byte_t *ptr, Float_t &signal) const;
94
95public:
96
97 MCalibrationCalc(const char *name=NULL, const char *title=NULL);
98
99 void Clear(const Option_t *o="");
100
101 void SkipBlindPixelFit(Bool_t b=kTRUE)
102 {b ? CLRBIT(fFlags, kUseBlindPixelFit) : SETBIT(fFlags, kUseBlindPixelFit);}
103 void SkipPinDiodeFit(Bool_t b=kTRUE)
104 {b ? CLRBIT(fFlags, kUsePinDiodeFit) : SETBIT(fFlags, kUsePinDiodeFit);}
105 void SkipQualityChecks(Bool_t b=kTRUE)
106 {b ? CLRBIT(fFlags, kUseQualityChecks) : SETBIT(fFlags, kUseQualityChecks);}
107 void SkipHiLoGainCalibration(Bool_t b=kTRUE)
108 {b ? CLRBIT(fFlags, kHiLoGainCalibration) : SETBIT(fFlags, kHiLoGainCalibration);}
109
110
111 // Setters
112 void SetPulserColor(PulserColor_t color) { fColor = color; }
113 void SetConversionHiLo(Float_t conv) { fConversionHiLo = conv; }
114
115 void SetBlindPixelRange(Int_t first=fgBlindPixelFirst, Int_t last=fgBlindPixelLast);
116 void SetBlindPixelSinglePheCut(Int_t cut=fgBlindPixelSinglePheCut)
117 { fBlindPixelSinglePheCut = cut; }
118
119 // Getters
120 MCalibrationBlindPix *GetBlindPixel() const;
121 MCalibrationPINDiode *GetPINDiode() const;
122
123 // Exclude pixels from configuration file
124 void ExcludePixelsFromAsciiFile(const char *file) { fExcludedPixelsFile = file; }
125
126 ClassDef(MCalibrationCalc, 1) // Task to fill the Calibration Containers from raw data
127};
128
129#endif
Note: See TracBrowser for help on using the repository browser.