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

Last change on this file since 3029 was 3029, 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;
33class MArrivalTime;
34
35class MTime;
36
37class MCalibrationCalc : public MTask
38{
39private:
40
41 static const Int_t fBlindPixelId; // ID of the blind pixel
42 static const Int_t fPINDiodeId; // ID of the PIN Diode
43 static const Byte_t fgSaturationLimit; // Saturation of Hi Gain
44 static const Byte_t fgBlindPixelFirst; // First FADC slice blind pixel
45 static const Byte_t fgBlindPixelLast; // Last FADC slice blind pixel
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 MArrivalTime *fArrivalTime; // Calculated Arrival Times
55
56 MTime *fEvtTime; // Time of the event
57
58 Int_t fEvents; // Number of events
59 Int_t fCosmics; // Number of events due to supposed cosmics
60
61 Byte_t fNumHiGainSamples;
62 Byte_t fNumLoGainSamples;
63 Float_t fSqrtHiGainSamples;
64
65 Float_t fConversionHiLo;
66 Int_t fFlags; // Flag for the fits used
67
68 TString fExcludedPixelsFile;
69 UInt_t fNumExcludedPixels;
70
71 enum { kUseTimes, kUseBlindPixelFit, kUsePinDiodeFit,
72 kUseCosmicsRejection, kUseQualityChecks,
73 kHiLoGainCalibration,
74 kBlindPixelOverFlow, kPINDiodeOverFlow,
75 kHiGainOverFlow, kLoGainOverFlow };
76
77public:
78
79 enum PulserColor_t { kEGreen, kEBlue, kEUV, kECT1 };
80
81private:
82
83 PulserColor_t fColor;
84
85 Bool_t ReInit(MParList *pList);
86 Int_t PreProcess(MParList *pList);
87 Int_t Process();
88 Int_t PostProcess();
89
90 Bool_t CalcSignalBlindPixel(Byte_t *ptr, Float_t &signal, const Float_t ped) const;
91
92public:
93
94 MCalibrationCalc(const char *name=NULL, const char *title=NULL);
95
96 void Clear(const Option_t *o="");
97
98 // Skipping parts of the work
99 void SkipTime(Bool_t b=kTRUE)
100 {b ? CLRBIT(fFlags, kUseTimes) : SETBIT(fFlags, kUseTimes);}
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 SkipCosmicsRejection(Bool_t b=kTRUE)
106 {b ? CLRBIT(fFlags, kUseCosmicsRejection) : SETBIT(fFlags, kUseCosmicsRejection);}
107 void SkipQualityChecks(Bool_t b=kTRUE)
108 {b ? CLRBIT(fFlags, kUseQualityChecks) : SETBIT(fFlags, kUseQualityChecks);}
109 void SkipHiLoGainCalibration(Bool_t b=kTRUE)
110 {b ? CLRBIT(fFlags, kHiLoGainCalibration) : SETBIT(fFlags, kHiLoGainCalibration);}
111
112
113 // Setters
114 void SetPulserColor(PulserColor_t color) { fColor = color; }
115 void SetConversionHiLo(Float_t conv) { fConversionHiLo = conv; }
116
117 // Getters
118 MCalibrationBlindPix *GetBlindPixel() const;
119 MCalibrationPINDiode *GetPINDiode() const;
120
121 // Exclude pixels from configuration file
122 void ExcludePixelsFromAsciiFile(const char *file) { fExcludedPixelsFile = file; }
123
124 ClassDef(MCalibrationCalc, 1) // Task to fill the Calibration Containers from raw data
125};
126
127#endif
Note: See TracBrowser for help on using the repository browser.