1 | #ifndef MARS_MHCalibrationCam
|
---|
2 | #define MARS_MHCalibrationCam
|
---|
3 |
|
---|
4 | #ifndef ROOT_TArrayI
|
---|
5 | #include <TArrayI.h>
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | #ifndef ROOT_TArrayF
|
---|
9 | #include <TArrayF.h>
|
---|
10 | #endif
|
---|
11 |
|
---|
12 | #ifndef MARS_MH
|
---|
13 | #include "MH.h"
|
---|
14 | #endif
|
---|
15 | #ifndef MARS_MCamEvent
|
---|
16 | #include "MCamEvent.h"
|
---|
17 | #endif
|
---|
18 |
|
---|
19 | #ifndef MARS_MBadPixelsPix
|
---|
20 | #include "MBadPixelsPix.h"
|
---|
21 | #endif
|
---|
22 |
|
---|
23 | #ifndef MARS_MCalibrationCam
|
---|
24 | #include "MCalibrationCam.h"
|
---|
25 | #endif
|
---|
26 |
|
---|
27 | class TText;
|
---|
28 | class TObjArray;
|
---|
29 |
|
---|
30 | class MHCalibrationPix;
|
---|
31 | class MGeomCam;
|
---|
32 | class MRawRunHeader;
|
---|
33 | class MCalibrationIntensityCam;
|
---|
34 | class MCalibrationCam;
|
---|
35 | class MCalibrationPix;
|
---|
36 | class MBadPixelsCam;
|
---|
37 | class MBadPixelsPix;
|
---|
38 |
|
---|
39 | class MHCalibrationCam : public MH, public MCamEvent
|
---|
40 | {
|
---|
41 |
|
---|
42 | private:
|
---|
43 |
|
---|
44 | static const Int_t fgAverageNbins; //! The default for fAverageNbins (now set to: 2000)
|
---|
45 | static const Int_t fgPulserFrequency; //! The default for fPulserFrequency (now set to: 500)
|
---|
46 |
|
---|
47 | protected:
|
---|
48 |
|
---|
49 | Float_t fNumHiGainSaturationLimit; // Rel. amount sat. higain FADC slices until pixel is called saturated
|
---|
50 | Float_t fNumLoGainSaturationLimit; // Rel. amount sat. logain FADC slices until pixel is called saturated
|
---|
51 |
|
---|
52 | TArrayI fAverageAreaNum; // Number of pixels in average pixels per area
|
---|
53 | TArrayF fAverageAreaRelSigma; // Re-normalized relative sigmas in average pixels per area
|
---|
54 | TArrayF fAverageAreaRelSigmaVar; // Variance Re-normalized relative sigmas in average pixels per area
|
---|
55 | TArrayI fAverageAreaSat; // Number of saturated slices in average pixels per area
|
---|
56 | TArrayF fAverageAreaSigma; // Re-normalized sigmas in average pixels per area
|
---|
57 | TArrayF fAverageAreaSigmaVar; // Variance Re-normalized sigmas in average pixels per area
|
---|
58 | Int_t fAverageNbins; // Number of bins for the average histograms
|
---|
59 | TObjArray *fAverageHiGainAreas; //-> Array of calibration pixels, one per pixel area
|
---|
60 | TObjArray *fAverageHiGainSectors; //-> Array of calibration pixels, one per camera sector
|
---|
61 | TObjArray *fAverageLoGainAreas; //-> Array of calibration pixels, one per pixel area
|
---|
62 | TObjArray *fAverageLoGainSectors; //-> Array of calibration pixels, one per camera sector
|
---|
63 | TArrayI fAverageSectorNum; // Number of pixels in average pixels per sector
|
---|
64 | TArrayI fRunNumbers; // Numbers of runs used
|
---|
65 |
|
---|
66 | MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs
|
---|
67 |
|
---|
68 | MBadPixelsCam *fBadPixels; //! Bad Pixels storage container
|
---|
69 | MCalibrationIntensityCam *fIntensCam; //! Intensity Calibration Cam with the results
|
---|
70 | MCalibrationCam *fCam; //! Calibration Cam with the results
|
---|
71 | MGeomCam *fGeom; //! Camera geometry
|
---|
72 | MRawRunHeader *fRunHeader; //! Run Header
|
---|
73 |
|
---|
74 | TObjArray *fHiGainArray; //-> Array of calibration pixels, one per pixel
|
---|
75 | TObjArray *fLoGainArray; //-> Array of calibration pixels, one per pixel
|
---|
76 |
|
---|
77 | Int_t fPulserFrequency; // Light pulser frequency
|
---|
78 | Bool_t fDebug; // Debug option is used?
|
---|
79 | Bool_t fLoGain; // Is Low-Gain available
|
---|
80 |
|
---|
81 | virtual Bool_t SetupHists(const MParList *pList);
|
---|
82 | virtual Bool_t ReInitHists(MParList *pList);
|
---|
83 | virtual Bool_t FillHists(const MParContainer *par, const Stat_t w=1);
|
---|
84 | virtual Bool_t FinalizeHists();
|
---|
85 | virtual void FinalizeBadPixels();
|
---|
86 |
|
---|
87 | virtual void CalcAverageSigma();
|
---|
88 |
|
---|
89 | void DrawAverageSigma(Bool_t sat, Bool_t inner,
|
---|
90 | Float_t sigma, Float_t sigmaerr,
|
---|
91 | Float_t relsigma, Float_t relsigmaerr) const;
|
---|
92 |
|
---|
93 | void FitHiGainArrays(MCalibrationCam &calcam, MBadPixelsCam &badcam,
|
---|
94 | MBadPixelsPix::UncalibratedType_t fittyp,
|
---|
95 | MBadPixelsPix::UncalibratedType_t osctyp);
|
---|
96 |
|
---|
97 | void FitHiGainHists(MHCalibrationPix &hist,
|
---|
98 | MCalibrationPix &pix,
|
---|
99 | MBadPixelsPix &bad,
|
---|
100 | MBadPixelsPix::UncalibratedType_t fittyp,
|
---|
101 | MBadPixelsPix::UncalibratedType_t osctyp);
|
---|
102 |
|
---|
103 | void FitLoGainArrays(MCalibrationCam &calcam, MBadPixelsCam &badcam,
|
---|
104 | MBadPixelsPix::UncalibratedType_t fittyp,
|
---|
105 | MBadPixelsPix::UncalibratedType_t osctyp);
|
---|
106 |
|
---|
107 | void FitLoGainHists(MHCalibrationPix &hist,
|
---|
108 | MCalibrationPix &pix,
|
---|
109 | MBadPixelsPix &bad,
|
---|
110 | MBadPixelsPix::UncalibratedType_t fittyp,
|
---|
111 | MBadPixelsPix::UncalibratedType_t osctyp);
|
---|
112 |
|
---|
113 | void InitHists(MHCalibrationPix &hist, MBadPixelsPix &bad, const Int_t i);
|
---|
114 |
|
---|
115 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
|
---|
116 |
|
---|
117 | public:
|
---|
118 |
|
---|
119 | MHCalibrationCam(const char *name=NULL, const char *title=NULL);
|
---|
120 | virtual ~MHCalibrationCam();
|
---|
121 |
|
---|
122 | virtual Bool_t SetupFill(const MParList *pList);
|
---|
123 | virtual Bool_t ReInit ( MParList *pList);
|
---|
124 | virtual Bool_t Fill (const MParContainer *par, const Stat_t w=1);
|
---|
125 | virtual Bool_t Finalize ( );
|
---|
126 |
|
---|
127 | virtual void ResetHists();
|
---|
128 |
|
---|
129 | // Clone
|
---|
130 | virtual TObject *Clone(const char *name="") const;
|
---|
131 |
|
---|
132 | // Draw
|
---|
133 | virtual void Draw(const Option_t *opt);
|
---|
134 |
|
---|
135 | virtual Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
|
---|
136 | virtual void DrawPixelContent( Int_t num ) const;
|
---|
137 |
|
---|
138 | const Int_t GetAverageAreas () const;
|
---|
139 | MHCalibrationPix &GetAverageHiGainArea (UInt_t i);
|
---|
140 | const MHCalibrationPix &GetAverageHiGainArea (UInt_t i) const;
|
---|
141 | MHCalibrationPix &GetAverageLoGainArea (UInt_t i);
|
---|
142 | const MHCalibrationPix &GetAverageLoGainArea (UInt_t i) const;
|
---|
143 | MHCalibrationPix &GetAverageHiGainSector(UInt_t i);
|
---|
144 | const MHCalibrationPix &GetAverageHiGainSector(UInt_t i) const;
|
---|
145 | MHCalibrationPix &GetAverageLoGainSector(UInt_t i);
|
---|
146 | const MHCalibrationPix &GetAverageLoGainSector(UInt_t i) const;
|
---|
147 | const Int_t GetAverageSectors () const;
|
---|
148 | const MCalibrationCam::PulserColor_t GetColor () const { return fColor; }
|
---|
149 | const Float_t GetNumHiGainSaturationLimit() const { return fNumHiGainSaturationLimit; }
|
---|
150 | const Float_t GetNumLoGainSaturationLimit() const { return fNumLoGainSaturationLimit; }
|
---|
151 | const TArrayI &GetRunNumbers () const;
|
---|
152 | const Int_t GetSize () const;
|
---|
153 |
|
---|
154 | const Bool_t IsDebug () const { return fDebug; }
|
---|
155 |
|
---|
156 | MHCalibrationPix &operator[] (UInt_t i);
|
---|
157 | const MHCalibrationPix &operator[] (UInt_t i) const;
|
---|
158 | MHCalibrationPix &operator() (UInt_t i);
|
---|
159 | const MHCalibrationPix &operator() (UInt_t i) const;
|
---|
160 |
|
---|
161 | void SetColor ( const MCalibrationCam::PulserColor_t color ) { fColor = color; }
|
---|
162 | void SetDebug ( const Bool_t b=kTRUE ) { fDebug = b; }
|
---|
163 | void SetLoGain ( const Bool_t b=kTRUE ) { fLoGain = b; }
|
---|
164 | void SetAverageNbins ( const Int_t bins=fgAverageNbins ) { fAverageNbins = bins; }
|
---|
165 | void SetNumLoGainSaturationLimit( const Float_t lim ) { fNumLoGainSaturationLimit = lim; }
|
---|
166 | void SetNumHiGainSaturationLimit( const Float_t lim ) { fNumHiGainSaturationLimit = lim; }
|
---|
167 | void SetPulserFrequency ( const Int_t f=fgPulserFrequency ) { fPulserFrequency = f; }
|
---|
168 |
|
---|
169 | ClassDef(MHCalibrationCam, 1) // Base Histogram class for Calibration Camera
|
---|
170 | };
|
---|
171 |
|
---|
172 | #endif
|
---|
173 |
|
---|
174 |
|
---|
175 |
|
---|
176 |
|
---|
177 |
|
---|
178 |
|
---|
179 |
|
---|
180 |
|
---|
181 |
|
---|