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

Last change on this file since 8425 was 8417, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 8.8 KB
Line 
1#ifndef MARS_MJCalibration
2#define MARS_MJCalibration
3
4#ifndef MARS_MJCalib
5#include "MJCalib.h"
6#endif
7#ifndef MARS_MCalibrationChargeCam
8#include "MCalibrationChargeCam.h"
9#endif
10#ifndef MARS_MCalibrationBlindCam
11#include "MCalibrationBlindCam.h"
12#endif
13#ifndef MARS_MCalibrationChargePINDiode
14#include "MCalibrationChargePINDiode.h"
15#endif
16#ifndef MARS_MCalibrationRelTimeCam
17#include "MCalibrationRelTimeCam.h"
18#endif
19#ifndef MARS_MCalibrationQECam
20#include "MCalibrationQECam.h"
21#endif
22#ifndef MARS_MBadPixelsCam
23#include "MBadPixelsCam.h"
24#endif
25#ifndef MARS_MPedestalCam
26#include "MPedestalCam.h"
27#endif
28
29class TH1D;
30
31class MTask;
32class MParList;
33class MPedestalCam;
34class MExtractor;
35class MExtractTime;
36class MEvtLoop;
37class MExtractBlindPixel;
38class MHCalibrationChargeBlindCam;
39class MHCamera;
40
41class MJCalibration : public MJCalib
42{
43private:
44
45 static const Int_t gkIFAEBoxInaugurationRun; //! Run number of first IFAE box calibration
46 static const Int_t gkSecondBlindPixelInstallation; //! Run number upon which second blind pixel was installed
47 static const Int_t gkSpecialPixelsContInstallation; //! Run number upon which third blind pixel was installed
48 static const Int_t gkThirdBlindPixelInstallation; //! Run number upon which third blind pixel was installed
49
50 static const TString fgReferenceFile; //! default for fReferenceFile ("mjobs/calibrationref.rc")
51 static const TString fgHiLoCalibFile; //! default for fHiLoCalibFile ("mjobs/hilocalib.root")
52
53 Double_t fConvFADC2PheMin; //! Histogram minimum for conversion factor to phes
54 Double_t fConvFADC2PheMax; //! Histogram maximum for conversion factor to phes
55 Double_t fConvFADC2PhotMin; //! Histogram minimum for conversion factor to phs
56 Double_t fConvFADC2PhotMax; //! Histogram maixmum for conversion factor to phs
57 Double_t fQEMin; //! Histogram minimum for quantum efficiency
58 Double_t fQEMax; //! Histogram maximum for quantum efficiency
59 Double_t fArrivalTimeMin; //! Histogram minimum for arrival times
60 Double_t fArrivalTimeMax; //! Histogram maximum for arrival times
61 Double_t fTimeOffsetMin; //! Histogram minimum for time offsets
62 Double_t fTimeOffsetMax; //! Histogram maximum for time offsets
63 Double_t fTimeResolutionMin; //! Histogram minimum for time resolutions
64 Double_t fTimeResolutionMax; //! Histogram maximum for time resolutions
65
66 Float_t fRefFADC2PheInner; //! Reference value for the ratio phes/charge - inner
67 Float_t fRefFADC2PheOuter; //! Reference value for the ratio phes/charge - outer
68 Float_t fRefConvFADC2PhotInner; //! Reference value for the conversion factor to phs - inner
69 Float_t fRefConvFADC2PhotOuter; //! Reference value for the conversion factor to phs - outer
70 Float_t fRefConvFADC2PheInner; //! Reference value for the conversion factor to phs - inner
71 Float_t fRefConvFADC2PheOuter; //! Reference value for the conversion factor to phs - outer
72 Float_t fRefQEInner; //! Reference value for the quantum eff. cascades - inner
73 Float_t fRefQEOuter; //! Reference value for the quantum eff. cascades - outer
74 Float_t fRefArrivalTimeInner; //! Reference value for the arrival time - inner
75 Float_t fRefArrivalTimeOuter; //! Reference value for the arrival time - outer
76 Float_t fRefArrivalTimeRmsInner; //! Reference value for the arrival time - inner
77 Float_t fRefArrivalTimeRmsOuter; //! Reference value for the arrival time - outer
78 Float_t fRefTimeOffsetInner; //! Reference value for the time offset - inner
79 Float_t fRefTimeOffsetOuter; //! Reference value for the time offset - outer
80 Float_t fRefTimeResolutionInner; //! Reference value for the time resolution - inner
81 Float_t fRefTimeResolutionOuter; //! Reference value for the time resolution - outer
82
83 TString fReferenceFile; // File name containing the reference values
84 TString fHiLoCalibFile; // File name containing the hi-lo calib. constants
85
86 MExtractor *fExtractor; // Signal extractor
87 MExtractTime *fTimeExtractor; // Arrival Time extractor
88
89 MBadPixelsCam fBadPixels; // Bad Pixels cam, can be set from previous runs
90 MCalibrationChargeCam fCalibrationCam; // Calibration conversion factors FADC2Phe
91 MCalibrationBlindCam fCalibrationBlindCam; // Calibration from Blind Pixel(s)
92 MCalibrationChargePINDiode fCalibrationPINDiode; // Calibration from PIN Diode
93 MCalibrationQECam fQECam; // Quantum efficiency, can be set from previous runs
94 MCalibrationRelTimeCam fRelTimeCam; // Calibration constants rel. times
95
96 MPedestalCam fExtractorCam; // Pedestal Cam with extractor resolution
97
98 MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs
99
100 enum Display_t // Possible Display types
101 {
102 kFullDisplay,
103 kDataCheckDisplay,
104 kNormalDisplay
105 };
106
107 Display_t fDisplayType; // Chosen Display type
108
109 enum { kRelTimes, kDebug }; // Possible flags
110
111 Byte_t fFlags; // Bit-field for the flags
112
113 TString fGeometry; // Class name geometry
114
115 Bool_t IsRelTimes () const { return TESTBIT(fFlags,kRelTimes); }
116 Bool_t IsDebug () const { return TESTBIT(fFlags,kDebug); }
117
118 void DrawTab(MParList &plist, const char *cont, const char *name, Option_t *opt);
119
120 void DisplayResult ( MParList &plist );
121 void DisplayReferenceLines( MHCamera *cam , const Int_t what ) const;
122 void DisplayOutliers ( TH1D *hist, const char* whatsmall, const char* whatbig ) const;
123 void DisplayDoubleProject ( MHCamera *cam , const char* whatsmall, const char* whatbig ) const;
124 const Int_t CountBadPixels ( MHCamera *cam , const Int_t what ) const;
125 void FixDataCheckHist ( TH1D *hist ) const;
126
127 Bool_t WriteResult (MParList &plist);
128 //Bool_t WriteEventloop( MEvtLoop &evtloop ) const;
129 Bool_t WriteTasks ( MTask *t1, MTask *t2) const;
130 Bool_t CheckEnvLocal ();
131
132 // WORKAROUNDS!!!
133 void InitBlindPixel(MExtractBlindPixel &blindext,
134 MHCalibrationChargeBlindCam &blindcam);
135
136 const char* GetOutputFileName() const;
137
138 void ReadReferenceFile();
139 Bool_t ReadHiLoCalibFile();
140
141public:
142 MJCalibration(const char *name=NULL, const char *title=NULL);
143
144 const MCalibrationChargeCam &GetCalibrationCam() const { return fCalibrationCam; }
145 const MCalibrationRelTimeCam &GetRelTimeCam() const { return fRelTimeCam; }
146 const MCalibrationQECam &GetQECam() const { return fQECam; }
147 const MBadPixelsCam &GetBadPixels() const { return fBadPixels; }
148
149 // Containers and pointers
150 void SetBadPixels ( const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
151 void SetColor ( const MCalibrationCam::PulserColor_t color) { fColor = color; }
152 void SetExtractor ( MExtractor* ext) { fExtractor = ext; }
153 void SetExtractorCam ( const MPedestalCam &ped) { ped.Copy(fExtractorCam); fExtractorCam.SetName(ped.GetName()); }
154 void SetQECam ( const MCalibrationQECam &qe) { qe.Copy(fQECam); }
155 void SetTimeExtractor( MExtractTime* ext) { fTimeExtractor = ext; }
156
157 // Displays
158 void SetFullDisplay() { fDisplayType = kFullDisplay; }
159 void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; }
160 void SetNormalDisplay() { fDisplayType = kNormalDisplay; }
161
162 // Camera Geomtry
163 void SetGeometry(const char *geom) { fGeometry = geom; }
164
165 // Flags
166 void SetRelTimeCalibration( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kRelTimes) : CLRBIT(fFlags,kRelTimes); }
167 void SetDebug ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kDebug) : CLRBIT(fFlags,kDebug); }
168 //void SetIntensity ( const Bool_t b=kTRUE ) { b ? SETBIT(fFlags,kIntensity) : CLRBIT(fFlags,kIntensity); }
169
170 // Files
171 void SetReferenceFile( const TString ref=fgReferenceFile ) { fReferenceFile = ref; }
172 void SetHiLoCalibFile( const TString ref=fgHiLoCalibFile ) { fHiLoCalibFile = ref; }
173
174 // Precessing
175 Bool_t Process(MPedestalCam &pedcam);
176
177 ClassDef(MJCalibration, 0) // Tool to run a calibration per pulser colour and intensity
178};
179
180#endif
Note: See TracBrowser for help on using the repository browser.