1 | #ifndef MARS_MJCalibration
|
---|
2 | #define MARS_MJCalibration
|
---|
3 |
|
---|
4 | #ifndef MARS_MCalibrationChargeCam
|
---|
5 | #include "MCalibrationChargeCam.h"
|
---|
6 | #endif
|
---|
7 | #ifndef MARS_MCalibrationChargeBlindCam
|
---|
8 | #include "MCalibrationChargeBlindCam.h"
|
---|
9 | #endif
|
---|
10 | #ifndef MARS_MCalibrationChargePINDiode
|
---|
11 | #include "MCalibrationChargePINDiode.h"
|
---|
12 | #endif
|
---|
13 | #ifndef MARS_MCalibrationRelTimeCam
|
---|
14 | #include "MCalibrationRelTimeCam.h"
|
---|
15 | #endif
|
---|
16 | #ifndef MARS_MCalibrationQECam
|
---|
17 | #include "MCalibrationQECam.h"
|
---|
18 | #endif
|
---|
19 | #ifndef MARS_MBadPixelsCam
|
---|
20 | #include "MBadPixelsCam.h"
|
---|
21 | #endif
|
---|
22 |
|
---|
23 | class TEnv;
|
---|
24 | class MRunIter;
|
---|
25 | class MSequence;
|
---|
26 | class MParList;
|
---|
27 | class MPedestalCam;
|
---|
28 | class MExtractor;
|
---|
29 | class MExtractTime;
|
---|
30 |
|
---|
31 | class MExtractBlindPixel;
|
---|
32 | class MHCalibrationChargeBlindCam;
|
---|
33 |
|
---|
34 | class MJCalibration : public MParContainer
|
---|
35 | {
|
---|
36 | private:
|
---|
37 | static const Int_t gkIFAEBoxInaugurationRun; // Run number of first IFAE box calibration
|
---|
38 | static const Int_t gkSecondBlindPixelInstallation; // Run number upon which second blind pixel was installed
|
---|
39 | static const Int_t gkThirdBlindPixelInstallation; // Run number upon which third blind pixel was installed
|
---|
40 |
|
---|
41 | TString fOutputPath; // Path to the output files
|
---|
42 |
|
---|
43 | TEnv *fEnv;
|
---|
44 | MRunIter *fRuns; // Calibration files
|
---|
45 | MSequence *fSequence; // Sequence
|
---|
46 |
|
---|
47 | MExtractor *fExtractor; // Signal extractor
|
---|
48 | MExtractTime *fTimeExtractor; // Arrival Time extractor
|
---|
49 |
|
---|
50 | MBadPixelsCam fBadPixels; // Bad Pixels cam, can be set from previous runs
|
---|
51 | MCalibrationChargeCam fCalibrationCam; // Calibration conversion factors FADC2Phe
|
---|
52 | MCalibrationChargeBlindCam fCalibrationBlindCam; // Calibration from Blind Pixel(s)
|
---|
53 | MCalibrationChargePINDiode fCalibrationPINDiode; // Calibration from PIN Diode
|
---|
54 | MCalibrationQECam fQECam; // Quantum efficiency, can be set from previous runs
|
---|
55 | MCalibrationRelTimeCam fRelTimeCam; // Calibration constants rel. times
|
---|
56 |
|
---|
57 | MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs
|
---|
58 |
|
---|
59 | enum Display_t // Possible Display types
|
---|
60 | {
|
---|
61 | kFullDisplay,
|
---|
62 | kDataCheckDisplay,
|
---|
63 | kNormalDisplay
|
---|
64 | };
|
---|
65 |
|
---|
66 | Display_t fDisplayType; // Chosen Display type
|
---|
67 |
|
---|
68 | enum Device_t // Possible devices for calibration
|
---|
69 | {
|
---|
70 | kUseBlindPixel,
|
---|
71 | kUsePINDiode
|
---|
72 | };
|
---|
73 |
|
---|
74 | Byte_t fDevices; // Bit-field for used devices for calibration
|
---|
75 |
|
---|
76 | Bool_t fRelTimes; // Flag if relative times have to be calibrated
|
---|
77 | Bool_t fDataCheck; // Flag if the data check is run on raw data
|
---|
78 | Bool_t fDebug;
|
---|
79 |
|
---|
80 | void DisplayResult(MParList &plist);
|
---|
81 | Bool_t WriteResult();
|
---|
82 | void CheckEnv();
|
---|
83 |
|
---|
84 | // WORKAROUNDS!!!
|
---|
85 | Bool_t FindColor();
|
---|
86 | void InitBlindPixel(MExtractBlindPixel &blindext,
|
---|
87 | MHCalibrationChargeBlindCam &blindcam);
|
---|
88 |
|
---|
89 | public:
|
---|
90 | MJCalibration(const char *name=NULL, const char *title=NULL);
|
---|
91 | ~MJCalibration();
|
---|
92 |
|
---|
93 | const char* GetOutputFile() const;
|
---|
94 | void SetEnv(const char *env);
|
---|
95 |
|
---|
96 | MCalibrationChargeCam &GetCalibrationCam() { return fCalibrationCam; }
|
---|
97 | MCalibrationRelTimeCam &GetRelTimeCam() { return fRelTimeCam; }
|
---|
98 | MCalibrationQECam &GetQECam() { return fQECam; }
|
---|
99 | MBadPixelsCam &GetBadPixels() { return fBadPixels; }
|
---|
100 |
|
---|
101 | Bool_t IsUseBlindPixel() const;
|
---|
102 | Bool_t IsUsePINDiode() const;
|
---|
103 |
|
---|
104 | void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
|
---|
105 | void SetExtractor(MExtractor* ext) { fExtractor = ext; }
|
---|
106 | void SetTimeExtractor(MExtractTime* ext) { fTimeExtractor = ext; }
|
---|
107 | void SetQECam(const MCalibrationQECam &qe) { qe.Copy(fQECam); }
|
---|
108 | void SetColor(const MCalibrationCam::PulserColor_t color) { fColor = color; }
|
---|
109 |
|
---|
110 | void SetInput(MRunIter *iter) { fRuns=iter; }
|
---|
111 | void SetSequence(MSequence *seq) { fSequence=seq; }
|
---|
112 | void SetOutputPath(const char *path=".");
|
---|
113 |
|
---|
114 | // Displays
|
---|
115 | void SetFullDisplay() { fDisplayType = kFullDisplay; }
|
---|
116 | void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; }
|
---|
117 | void SetNormalDisplay() { fDisplayType = kNormalDisplay; }
|
---|
118 |
|
---|
119 | // Rel. Time
|
---|
120 | void SetRelTimeCalibration(const Bool_t b=kTRUE) { fRelTimes = b; }
|
---|
121 |
|
---|
122 | // Data Check
|
---|
123 | void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); }
|
---|
124 |
|
---|
125 | // Debug
|
---|
126 | void SetDebug(const Bool_t b=kTRUE) { fDebug = b; }
|
---|
127 |
|
---|
128 | // Devices
|
---|
129 | void SetUseBlindPixel(const Bool_t b=kTRUE);
|
---|
130 | void SetUsePINDiode(const Bool_t b=kTRUE);
|
---|
131 |
|
---|
132 | Bool_t ReadCalibrationCam();
|
---|
133 | Bool_t ProcessFile(MPedestalCam &pedcam);
|
---|
134 | Bool_t Process(MPedestalCam &pedcam);
|
---|
135 |
|
---|
136 | ClassDef(MJCalibration, 0) // Tool to run a calibration per pulser colour and intensity
|
---|
137 | };
|
---|
138 |
|
---|
139 | #endif
|
---|