| 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 | #ifndef MARS_MGCamDisplays | 
|---|
| 17 | #include "MGCamDisplays.h" | 
|---|
| 18 | #endif | 
|---|
| 19 |  | 
|---|
| 20 | class MRunIter; | 
|---|
| 21 | class MParList; | 
|---|
| 22 | class MPedestalCam; | 
|---|
| 23 | class MExtractor; | 
|---|
| 24 | class MExtractTime; | 
|---|
| 25 | class MJCalibration : public MParContainer, public MGCamDisplays | 
|---|
| 26 | { | 
|---|
| 27 | private: | 
|---|
| 28 |  | 
|---|
| 29 | static const Int_t gkIFAEBoxInaugurationRun;              // Run number of first IFAE box calibration | 
|---|
| 30 |  | 
|---|
| 31 | TString fOutputPath;                                     // Path to the output files | 
|---|
| 32 |  | 
|---|
| 33 | MRunIter       *fRuns;                                   // Calibration files | 
|---|
| 34 | MExtractor     *fExtractor;                              // Signal extractor | 
|---|
| 35 | MExtractTime   *fTimeExtractor;                          // Arrival Time extractor | 
|---|
| 36 |  | 
|---|
| 37 | MBadPixelsCam          fBadPixels;                       // Bad Pixels cam, can be set from previous runs | 
|---|
| 38 | MCalibrationChargeCam  fCalibrationCam;                  // Calibration conversion factors FADC2Phe | 
|---|
| 39 | MCalibrationQECam      fQECam;                           // Quantum efficiency, can be set from previous runs | 
|---|
| 40 | MCalibrationRelTimeCam fRelTimeCam;                      // Calibration constants rel. times | 
|---|
| 41 |  | 
|---|
| 42 | MCalibrationCam::PulserColor_t fColor;                   // Colour of the pulsed LEDs | 
|---|
| 43 |  | 
|---|
| 44 | enum  Display_t   { kFullDisplay, kDataCheckDisplay, kNormalDisplay }; // Possible Display types | 
|---|
| 45 |  | 
|---|
| 46 | Display_t fDisplayType;                                  // Chosen Display type | 
|---|
| 47 |  | 
|---|
| 48 | Bool_t fRelTimes;                                        // Flag if relative times have to be calibrated | 
|---|
| 49 | Bool_t fDataCheck;                                       // Flag if the data check is run on raw data | 
|---|
| 50 |  | 
|---|
| 51 | void   DisplayResult(MParList &plist); | 
|---|
| 52 | Bool_t WriteResult(); | 
|---|
| 53 | Bool_t FindColor(); | 
|---|
| 54 |  | 
|---|
| 55 | public: | 
|---|
| 56 |  | 
|---|
| 57 | MJCalibration(const char *name=NULL, const char *title=NULL); | 
|---|
| 58 | ~MJCalibration() {} | 
|---|
| 59 |  | 
|---|
| 60 | void SetInput(MRunIter *iter) { fRuns=iter; } | 
|---|
| 61 | void SetOutputPath(const char *path="."); | 
|---|
| 62 |  | 
|---|
| 63 | TString GetOutputFile() const; | 
|---|
| 64 |  | 
|---|
| 65 | MCalibrationChargeCam  &GetCalibrationCam()     { return fCalibrationCam; } | 
|---|
| 66 | MCalibrationRelTimeCam &GetRelTimeCam()         { return fRelTimeCam;     } | 
|---|
| 67 | MCalibrationQECam      &GetQECam()              { return fQECam;          } | 
|---|
| 68 | MBadPixelsCam          &GetBadPixels()          { return fBadPixels;      } | 
|---|
| 69 |  | 
|---|
| 70 | void SetBadPixels(const MBadPixelsCam &bad)     { bad.Copy(fBadPixels);   } | 
|---|
| 71 | void SetExtractor(MExtractor* ext)              { fExtractor = ext; } | 
|---|
| 72 | void SetTimeExtractor(MExtractTime* ext)       { fTimeExtractor = ext; } | 
|---|
| 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 | Bool_t ReadCalibrationCam(); | 
|---|
| 88 | Bool_t ProcessFile( MPedestalCam &pedcam ); | 
|---|
| 89 | Bool_t Process    ( MPedestalCam &pedcam ); | 
|---|
| 90 |  | 
|---|
| 91 | ClassDef(MJCalibration, 0) // Tool to run a calibration per pulser colour and intensity | 
|---|
| 92 | }; | 
|---|
| 93 |  | 
|---|
| 94 | #endif | 
|---|