1 | #ifndef MARS_MJCalibration
|
---|
2 | #define MARS_MJCalibration
|
---|
3 |
|
---|
4 | #ifndef MARS_MCalibrationChargeCam
|
---|
5 | #include "MCalibrationChargeCam.h"
|
---|
6 | #endif
|
---|
7 | #ifndef MARS_MCalibrationChargeBlindPix
|
---|
8 | #include "MCalibrationChargeBlindPix.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 MRunIter;
|
---|
24 | class MParList;
|
---|
25 | class MPedestalCam;
|
---|
26 | class MExtractor;
|
---|
27 | class MExtractTime;
|
---|
28 | class MJCalibration : public MParContainer
|
---|
29 | {
|
---|
30 | private:
|
---|
31 |
|
---|
32 | static const Int_t gkIFAEBoxInaugurationRun; // Run number of first IFAE box calibration
|
---|
33 |
|
---|
34 | TString fOutputPath; // Path to the output files
|
---|
35 |
|
---|
36 | MRunIter *fRuns; // Calibration files
|
---|
37 | MExtractor *fExtractor; // Signal extractor
|
---|
38 | MExtractTime *fTimeExtractor; // Arrival Time extractor
|
---|
39 |
|
---|
40 | MBadPixelsCam fBadPixels; // Bad Pixels cam, can be set from previous runs
|
---|
41 | MCalibrationChargeCam fCalibrationCam; // Calibration conversion factors FADC2Phe
|
---|
42 | MCalibrationChargeBlindPix fCalibrationBlindPix; // Calibration from Blind Pixel
|
---|
43 | MCalibrationChargePINDiode fCalibrationPINDiode; // Calibration from PIN Diode
|
---|
44 | MCalibrationQECam fQECam; // Quantum efficiency, can be set from previous runs
|
---|
45 | MCalibrationRelTimeCam fRelTimeCam; // Calibration constants rel. times
|
---|
46 |
|
---|
47 | MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs
|
---|
48 |
|
---|
49 | enum Display_t { kFullDisplay, kDataCheckDisplay, kNormalDisplay }; // Possible Display types
|
---|
50 |
|
---|
51 | Display_t fDisplayType; // Chosen Display type
|
---|
52 |
|
---|
53 | enum Device_t { kUseBlindPixel, kUsePINDiode }; // Possible devices for calibration
|
---|
54 |
|
---|
55 | Byte_t fDevices; // Bit-field for used devices for calibration
|
---|
56 |
|
---|
57 | Bool_t fRelTimes; // Flag if relative times have to be calibrated
|
---|
58 | Bool_t fDataCheck; // Flag if the data check is run on raw data
|
---|
59 |
|
---|
60 | void DisplayResult(MParList &plist);
|
---|
61 | Bool_t WriteResult();
|
---|
62 | Bool_t FindColor();
|
---|
63 |
|
---|
64 | public:
|
---|
65 |
|
---|
66 | MJCalibration(const char *name=NULL, const char *title=NULL);
|
---|
67 | ~MJCalibration() {}
|
---|
68 |
|
---|
69 | const char* GetOutputFile() const;
|
---|
70 |
|
---|
71 | MCalibrationChargeCam &GetCalibrationCam() { return fCalibrationCam; }
|
---|
72 | MCalibrationRelTimeCam &GetRelTimeCam() { return fRelTimeCam; }
|
---|
73 | MCalibrationQECam &GetQECam() { return fQECam; }
|
---|
74 | MBadPixelsCam &GetBadPixels() { return fBadPixels; }
|
---|
75 |
|
---|
76 | Bool_t IsUseBlindPixel() const;
|
---|
77 | Bool_t IsUsePINDiode() const;
|
---|
78 |
|
---|
79 | void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
|
---|
80 | void SetExtractor(MExtractor* ext) { fExtractor = ext; }
|
---|
81 | void SetTimeExtractor(MExtractTime* ext) { fTimeExtractor = ext; }
|
---|
82 | void SetQECam (const MCalibrationQECam &qe) { qe.Copy(fQECam); }
|
---|
83 | void SetColor (const MCalibrationCam::PulserColor_t color) { fColor = color; }
|
---|
84 |
|
---|
85 | void SetInput(MRunIter *iter) { fRuns=iter; }
|
---|
86 | void SetOutputPath(const char *path=".");
|
---|
87 |
|
---|
88 | // Displays
|
---|
89 | void SetFullDisplay() { fDisplayType = kFullDisplay; }
|
---|
90 | void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; }
|
---|
91 | void SetNormalDisplay() { fDisplayType = kNormalDisplay; }
|
---|
92 |
|
---|
93 | // Rel. Time
|
---|
94 | void SetRelTimeCalibration(const Bool_t b=kTRUE) { fRelTimes = b; }
|
---|
95 |
|
---|
96 | // Data Check
|
---|
97 | void SetDataCheck (const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); }
|
---|
98 |
|
---|
99 | // Devices
|
---|
100 | void SetUseBlindPixel( const Bool_t b=kTRUE );
|
---|
101 | void SetUsePINDiode ( const Bool_t b=kTRUE );
|
---|
102 |
|
---|
103 | Bool_t ReadCalibrationCam();
|
---|
104 | Bool_t ProcessFile( MPedestalCam &pedcam );
|
---|
105 | Bool_t Process ( MPedestalCam &pedcam );
|
---|
106 |
|
---|
107 | ClassDef(MJCalibration, 0) // Tool to run a calibration per pulser colour and intensity
|
---|
108 | };
|
---|
109 |
|
---|
110 | #endif
|
---|