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

Last change on this file since 4379 was 4334, checked in by gaug, 21 years ago
*** empty log message ***
File size: 4.3 KB
Line 
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
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
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 Bool_t fDebug;
60
61 void DisplayResult(MParList &plist);
62 Bool_t WriteResult();
63 Bool_t FindColor();
64
65public:
66
67 MJCalibration(const char *name=NULL, const char *title=NULL);
68 ~MJCalibration() {}
69
70 const char* GetOutputFile() const;
71
72 MCalibrationChargeCam &GetCalibrationCam() { return fCalibrationCam; }
73 MCalibrationRelTimeCam &GetRelTimeCam() { return fRelTimeCam; }
74 MCalibrationQECam &GetQECam() { return fQECam; }
75 MBadPixelsCam &GetBadPixels() { return fBadPixels; }
76
77 Bool_t IsUseBlindPixel() const;
78 Bool_t IsUsePINDiode() const;
79
80 void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
81 void SetExtractor(MExtractor* ext) { fExtractor = ext; }
82 void SetTimeExtractor(MExtractTime* ext) { fTimeExtractor = ext; }
83 void SetQECam (const MCalibrationQECam &qe) { qe.Copy(fQECam); }
84 void SetColor (const MCalibrationCam::PulserColor_t color) { fColor = color; }
85
86 void SetInput(MRunIter *iter) { fRuns=iter; }
87 void SetOutputPath(const char *path=".");
88
89 // Displays
90 void SetFullDisplay() { fDisplayType = kFullDisplay; }
91 void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; }
92 void SetNormalDisplay() { fDisplayType = kNormalDisplay; }
93
94 // Rel. Time
95 void SetRelTimeCalibration(const Bool_t b=kTRUE) { fRelTimes = b; }
96
97 // Data Check
98 void SetDataCheck (const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); }
99
100 // Debug
101 void SetDebug (const Bool_t b=kTRUE) { fDebug = b; }
102
103 // Devices
104 void SetUseBlindPixel( const Bool_t b=kTRUE );
105 void SetUsePINDiode ( const Bool_t b=kTRUE );
106
107 Bool_t ReadCalibrationCam();
108 Bool_t ProcessFile( MPedestalCam &pedcam );
109 Bool_t Process ( MPedestalCam &pedcam );
110
111 ClassDef(MJCalibration, 0) // Tool to run a calibration per pulser colour and intensity
112};
113
114#endif
Note: See TracBrowser for help on using the repository browser.