1 | #ifndef MARS_MJCalibration
|
---|
2 | #define MARS_MJCalibration
|
---|
3 |
|
---|
4 | #ifndef MARS_MCalibrationChargeCam
|
---|
5 | #include "MCalibrationChargeCam.h"
|
---|
6 | #endif
|
---|
7 | #ifndef MARS_MCalibrationRelTimeCam
|
---|
8 | #include "MCalibrationRelTimeCam.h"
|
---|
9 | #endif
|
---|
10 | #ifndef MARS_MCalibrationQECam
|
---|
11 | #include "MCalibrationQECam.h"
|
---|
12 | #endif
|
---|
13 | #ifndef MARS_MBadPixelsCam
|
---|
14 | #include "MBadPixelsCam.h"
|
---|
15 | #endif
|
---|
16 |
|
---|
17 | class TCanvas;
|
---|
18 | class MHCamera;
|
---|
19 | class MCamEvent;
|
---|
20 | class MRunIter;
|
---|
21 | class MParList;
|
---|
22 | class MPedestalCam;
|
---|
23 | class MJCalibration : public MParContainer
|
---|
24 | {
|
---|
25 | private:
|
---|
26 |
|
---|
27 | static const Int_t gkIFAEBoxInaugurationRun; // Run number of first IFAE box calibration
|
---|
28 |
|
---|
29 | TString fOutputPath; // Path to the output files
|
---|
30 |
|
---|
31 | MRunIter *fRuns; // Calibration files
|
---|
32 |
|
---|
33 | MBadPixelsCam fBadPixels; // Bad Pixels cam, can be set from previous runs
|
---|
34 | MCalibrationChargeCam fCalibrationCam; // Calibration conversion factors FADC2Phe
|
---|
35 | MCalibrationQECam fQECam; // Quantum efficiency, can be set from previous runs
|
---|
36 | MCalibrationRelTimeCam fRelTimeCam; // Calibration constants rel. times
|
---|
37 |
|
---|
38 | MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs
|
---|
39 |
|
---|
40 | enum Display_t { kFullDisplay, kDataCheckDisplay, kNormalDisplay }; // Possible Display types
|
---|
41 |
|
---|
42 | Display_t fDisplayType; // Chosen Display type
|
---|
43 |
|
---|
44 | Bool_t fRelTimes; // Flag if relative times have to be calibrated
|
---|
45 | Bool_t fDataCheck; // Flag if the data check is run on raw data
|
---|
46 | UInt_t fExtractorLevel; // Level signal extractor (e.g. MExtractSignal2)
|
---|
47 | UInt_t fArrivalTimeLevel; // Level arr. time extractor (e.g. MArrivalTimeCalc2)
|
---|
48 |
|
---|
49 | void DrawProjection ( MHCamera *obj, Int_t fit) const; // Draw projection of pixels values
|
---|
50 | void DrawRadialProfile( MHCamera *obj) const; // Draw projection of pixels values onto camera radius
|
---|
51 | void CamDraw(TCanvas &c, const Int_t x, const Int_t y, const MHCamera &cam1,
|
---|
52 | const Int_t fit, const Int_t rad=0); // Draw histograms into the MStatusDisplay
|
---|
53 |
|
---|
54 | void DisplayResult(MParList &plist);
|
---|
55 | Bool_t WriteResult();
|
---|
56 | Bool_t FindColor();
|
---|
57 |
|
---|
58 | public:
|
---|
59 |
|
---|
60 | MJCalibration(const char *name=NULL, const char *title=NULL);
|
---|
61 |
|
---|
62 | void SetInput(MRunIter *iter) { fRuns=iter; }
|
---|
63 | void SetOutputPath(const char *path=".");
|
---|
64 |
|
---|
65 | TString GetOutputFile() const;
|
---|
66 |
|
---|
67 | MCalibrationChargeCam &GetCalibrationCam() { return fCalibrationCam; }
|
---|
68 | MCalibrationRelTimeCam &GetRelTimeCam() { return fRelTimeCam; }
|
---|
69 | MCalibrationQECam &GetQECam() { return fQECam; }
|
---|
70 | const MBadPixelsCam &GetBadPixels() const { return fBadPixels; }
|
---|
71 |
|
---|
72 | void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
|
---|
73 | void SetQECam (const MCalibrationQECam &qe) { qe.Copy(fQECam); }
|
---|
74 | void SetColor (const MCalibrationCam::PulserColor_t color) { fColor = color; }
|
---|
75 |
|
---|
76 | // Displays
|
---|
77 | void SetFullDisplay() { fDisplayType = kFullDisplay; }
|
---|
78 | void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; }
|
---|
79 | void SetNormalDisplay() { fDisplayType = kNormalDisplay; }
|
---|
80 |
|
---|
81 | // Rel. Time
|
---|
82 | void SetRelTimeCalibration(const Bool_t b=kTRUE) { fRelTimes = b; }
|
---|
83 |
|
---|
84 | // Data Check
|
---|
85 | void SetDataCheck (const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); }
|
---|
86 |
|
---|
87 | // Extractors
|
---|
88 | void SetExtractorLevel (const UInt_t i=1 ) { fExtractorLevel = i; }
|
---|
89 | void SetArrivalTimeLevel (const UInt_t i=1 ) { fArrivalTimeLevel = i; }
|
---|
90 |
|
---|
91 |
|
---|
92 | Bool_t ReadCalibrationCam();
|
---|
93 | Bool_t ProcessFile( MPedestalCam &pedcam );
|
---|
94 | Bool_t Process ( MPedestalCam &pedcam );
|
---|
95 |
|
---|
96 | ClassDef(MJCalibration, 0) // Tool to run a calibration per pulser colour and intensity
|
---|
97 | };
|
---|
98 |
|
---|
99 | #endif
|
---|