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 | ~MJCalibration() {}
|
---|
62 |
|
---|
63 |
|
---|
64 | void SetInput(MRunIter *iter) { fRuns=iter; }
|
---|
65 | void SetOutputPath(const char *path=".");
|
---|
66 |
|
---|
67 | TString GetOutputFile() const;
|
---|
68 |
|
---|
69 | MCalibrationChargeCam &GetCalibrationCam() { return fCalibrationCam; }
|
---|
70 | MCalibrationRelTimeCam &GetRelTimeCam() { return fRelTimeCam; }
|
---|
71 | MCalibrationQECam &GetQECam() { return fQECam; }
|
---|
72 | const MBadPixelsCam &GetBadPixels() const { return fBadPixels; }
|
---|
73 |
|
---|
74 | void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
|
---|
75 | void SetQECam (const MCalibrationQECam &qe) { qe.Copy(fQECam); }
|
---|
76 | void SetColor (const MCalibrationCam::PulserColor_t color) { fColor = color; }
|
---|
77 |
|
---|
78 | // Displays
|
---|
79 | void SetFullDisplay() { fDisplayType = kFullDisplay; }
|
---|
80 | void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; }
|
---|
81 | void SetNormalDisplay() { fDisplayType = kNormalDisplay; }
|
---|
82 |
|
---|
83 | // Rel. Time
|
---|
84 | void SetRelTimeCalibration(const Bool_t b=kTRUE) { fRelTimes = b; }
|
---|
85 |
|
---|
86 | // Data Check
|
---|
87 | void SetDataCheck (const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); }
|
---|
88 |
|
---|
89 | // Extractors
|
---|
90 | void SetExtractorLevel (const UInt_t i=1 ) { fExtractorLevel = i; }
|
---|
91 | void SetArrivalTimeLevel (const UInt_t i=1 ) { fArrivalTimeLevel = i; }
|
---|
92 |
|
---|
93 |
|
---|
94 | Bool_t ReadCalibrationCam();
|
---|
95 | Bool_t ProcessFile( MPedestalCam &pedcam );
|
---|
96 | Bool_t Process ( MPedestalCam &pedcam );
|
---|
97 |
|
---|
98 | ClassDef(MJCalibration, 0) // Tool to run a calibration per pulser colour and intensity
|
---|
99 | };
|
---|
100 |
|
---|
101 | #endif
|
---|