source: trunk/MagicSoft/Mars/mjobs/MJCalibration.h@ 4604

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