source: trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.h@ 5807

Last change on this file since 5807 was 5802, checked in by gaug, 20 years ago
*** empty log message ***
File size: 10.2 KB
Line 
1#ifndef MARS_MHCalibrationCam
2#define MARS_MHCalibrationCam
3
4#ifndef MARS_MArrayI
5#include "MArrayI.h"
6#endif
7#ifndef MARS_MArrayF
8#include "MArrayF.h"
9#endif
10#ifndef MARS_MH
11#include "MH.h"
12#endif
13#ifndef MARS_MCamEvent
14#include "MCamEvent.h"
15#endif
16
17#ifndef MARS_MBadPixelsPix
18#include "MBadPixelsPix.h"
19#endif
20
21#ifndef MARS_MCalibrationCam
22#include "MCalibrationCam.h"
23#endif
24
25class TText;
26class TOrdCollection;
27
28class MHCalibrationPix;
29class MGeomCam;
30class MRawRunHeader;
31class MRawEvtHeader;
32class MCalibrationIntensityCam;
33class MCalibrationCam;
34class MCalibrationPix;
35class MBadPixelsIntensityCam;
36class MBadPixelsCam;
37class MBadPixelsPix;
38
39class MHCalibrationCam : public MH, public MCamEvent
40{
41
42private:
43
44 static const Int_t fgPulserFrequency; //! The default for fPulserFrequency (now set to: 500)
45 static const Float_t fgProbLimit; //! The default for fProbLimit (now set to: 0.0001)
46
47 static const TString gsHistName; //! Default Histogram names
48 static const TString gsHistTitle; //! Default Histogram titles
49 static const TString gsHistXTitle; //! Default Histogram x-axis titles
50 static const TString gsHistYTitle; //! Default Histogram y-axis titles
51
52protected:
53
54 Int_t fNbins; // Number of bins
55 Axis_t fFirst; // Lower histogram limit
56 Axis_t fLast; // Upper histogram limit
57
58 Float_t fProbLimit; // Limit for acceptance of probability of Gauss-Fit
59
60 TString fHistName; //! Histogram names
61 TString fHistTitle; //! Histogram titles
62 TString fHistXTitle; //! Histogram x-axis titles
63 TString fHistYTitle; //! Histogram y-axis titles
64
65 Float_t fNumHiGainSaturationLimit; // Rel. amount sat. higain FADC slices until pixel is called saturated
66 Float_t fNumLoGainSaturationLimit; // Rel. amount sat. logain FADC slices until pixel is called saturated
67
68 MArrayI fRunNumbers; // Numbers of runs used
69
70 MArrayF fAverageAreaRelSigma; // Re-normalized relative sigmas in average pixels per area
71 MArrayF fAverageAreaRelSigmaVar; // Variance Re-normalized relative sigmas in average pixels per area
72 MArrayI fAverageAreaSat; // Number of saturated slices in average pixels per area
73 MArrayF fAverageAreaSigma; // Re-normalized sigmas in average pixels per area
74 MArrayF fAverageAreaSigmaVar; // Variance Re-normalized sigmas in average pixels per area
75 MArrayI fAverageAreaNum; // Number of pixels in average pixels per area
76 MArrayI fAverageSectorNum; // Number of pixels in average pixels per sector
77
78 TOrdCollection *fAverageHiGainAreas; // Array of calibration pixels, one per pixel area
79 TOrdCollection *fAverageHiGainSectors; // Array of calibration pixels, one per camera sector
80 TOrdCollection *fAverageLoGainAreas; // Array of calibration pixels, one per pixel area
81 TOrdCollection *fAverageLoGainSectors; // Array of calibration pixels, one per camera sector
82
83 MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs
84
85 MBadPixelsIntensityCam *fIntensBad; //! Bad Pixels intensity calibration storage container
86 MBadPixelsCam *fBadPixels; //! Bad Pixels storage container
87 MCalibrationIntensityCam *fIntensCam; //! Intensity Calibration Cam with the results
88 MCalibrationCam *fCam; //! Calibration Cam with the results
89 MGeomCam *fGeom; //! Camera geometry
90 MRawRunHeader *fRunHeader; //! Run Header
91 MRawEvtHeader *fEvtHeader; //! Evt Header
92
93 TOrdCollection *fHiGainArray; // Array of calibration pixels, one per pixel
94 TOrdCollection *fLoGainArray; // Array of calibration pixels, one per pixel
95
96 Int_t fPulserFrequency; // Light pulser frequency
97
98 enum { kDebug, kLoGain, kAverageing,
99 kOscillations, kSizeCheck,
100 kInterlaced }; // Possible flags
101
102 Byte_t fFlags; // Bit-field to hold the flags
103
104 virtual Bool_t SetupHists ( const MParList *pList ) { return kTRUE; }
105 virtual Bool_t ReInitHists( MParList *pList ) { return kTRUE; }
106 virtual Bool_t FillHists ( const MParContainer *par, const Stat_t w=1) { return kTRUE; }
107 virtual Bool_t FinalizeHists() { return kTRUE; }
108
109 virtual void FinalizeBadPixels() { }
110
111 virtual void CalcAverageSigma();
112
113 virtual void InitHiGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors );
114 virtual void InitLoGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors );
115
116 virtual void ResetHistTitles();
117
118 void DrawAverageSigma( Bool_t sat, Bool_t inner,
119 Float_t sigma, Float_t sigmaerr,
120 Float_t relsigma, Float_t relsigmaerr) const;
121
122 void FitHiGainArrays ( MCalibrationCam &calcam, MBadPixelsCam &badcam,
123 MBadPixelsPix::UncalibratedType_t fittyp,
124 MBadPixelsPix::UncalibratedType_t osctyp);
125
126 void FitHiGainHists ( MHCalibrationPix &hist,
127 MCalibrationPix &pix,
128 MBadPixelsPix &bad,
129 MBadPixelsPix::UncalibratedType_t fittyp,
130 MBadPixelsPix::UncalibratedType_t osctyp);
131
132 void FitLoGainArrays ( MCalibrationCam &calcam, MBadPixelsCam &badcam,
133 MBadPixelsPix::UncalibratedType_t fittyp,
134 MBadPixelsPix::UncalibratedType_t osctyp);
135
136 void FitLoGainHists ( MHCalibrationPix &hist,
137 MCalibrationPix &pix,
138 MBadPixelsPix &bad,
139 MBadPixelsPix::UncalibratedType_t fittyp,
140 MBadPixelsPix::UncalibratedType_t osctyp);
141
142 void InitHists ( MHCalibrationPix &hist, MBadPixelsPix &bad, const Int_t i);
143
144 Bool_t IsAverageing () const { return TESTBIT(fFlags,kAverageing); }
145 Bool_t IsDebug () const { return TESTBIT(fFlags,kDebug); }
146 Bool_t IsLoGain () const { return TESTBIT(fFlags,kLoGain); }
147 Bool_t IsOscillations() const { return TESTBIT(fFlags,kOscillations); }
148 Bool_t IsSizeCheck () const { return TESTBIT(fFlags,kSizeCheck); }
149 Bool_t IsInterlaced () const { return TESTBIT(fFlags,kInterlaced); }
150
151 void Remove(TOrdCollection *col);
152
153 Int_t ReadEnv ( const TEnv &env, TString prefix, Bool_t print);
154
155public:
156
157 MHCalibrationCam(const char *name=NULL, const char *title=NULL);
158 virtual ~MHCalibrationCam();
159
160 Bool_t SetupFill(const MParList *pList);
161 Bool_t ReInit ( MParList *pList);
162 Bool_t Fill (const MParContainer *par, const Stat_t w=1);
163 Bool_t Finalize ( );
164
165 virtual void ResetHists();
166
167 // Draw
168 void Draw(const Option_t *opt);
169
170 Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const { return kTRUE; }
171 void DrawPixelContent( Int_t num ) const {}
172
173 const Int_t GetAverageAreas () const;
174 MHCalibrationPix &GetAverageHiGainArea (UInt_t i);
175 const MHCalibrationPix &GetAverageHiGainArea (UInt_t i) const;
176 MHCalibrationPix &GetAverageLoGainArea (UInt_t i);
177 const MHCalibrationPix &GetAverageLoGainArea (UInt_t i) const;
178 MHCalibrationPix &GetAverageHiGainSector(UInt_t i);
179 const MHCalibrationPix &GetAverageHiGainSector(UInt_t i) const;
180 MHCalibrationPix &GetAverageLoGainSector(UInt_t i);
181 const MHCalibrationPix &GetAverageLoGainSector(UInt_t i) const;
182 const Int_t GetAverageSectors () const;
183 const MCalibrationCam::PulserColor_t GetColor () const { return fColor; }
184 const Float_t GetNumHiGainSaturationLimit() const { return fNumHiGainSaturationLimit; }
185 const Float_t GetNumLoGainSaturationLimit() const { return fNumLoGainSaturationLimit; }
186 const MArrayI &GetRunNumbers () const { return fRunNumbers; }
187 const Int_t GetSize () const;
188
189 MHCalibrationPix &operator[] (UInt_t i);
190 const MHCalibrationPix &operator[] (UInt_t i) const;
191 MHCalibrationPix &operator() (UInt_t i);
192 const MHCalibrationPix &operator() (UInt_t i) const;
193
194 void SetColor ( const MCalibrationCam::PulserColor_t color) { fColor = color; }
195 void SetAverageing ( const Bool_t b=kTRUE ) { b
196 ? SETBIT(fFlags,kAverageing)
197 : CLRBIT(fFlags,kAverageing); }
198 void SetDebug ( const Bool_t b=kTRUE ) { b
199 ? SETBIT(fFlags,kDebug)
200 : CLRBIT(fFlags,kDebug); }
201 void SetLoGain ( const Bool_t b=kTRUE ) { b
202 ? SETBIT(fFlags,kLoGain)
203 : CLRBIT(fFlags,kLoGain); }
204 void SetOscillations ( const Bool_t b=kTRUE ) { b
205 ? SETBIT(fFlags,kOscillations)
206 : CLRBIT(fFlags,kOscillations); }
207 void SetSizeCheck ( const Bool_t b=kTRUE ) { b
208 ? SETBIT(fFlags,kSizeCheck)
209 : CLRBIT(fFlags,kSizeCheck); }
210 void SetInterlaced ( const Bool_t b=kTRUE ) { b
211 ? SETBIT(fFlags,kInterlaced)
212 : CLRBIT(fFlags,kInterlaced); }
213 void SetHistName ( const char *name ) { fHistName = name; }
214 void SetHistTitle ( const char *name ) { fHistTitle = name; }
215 void SetHistXTitle( const char *name ) { fHistXTitle = name; }
216 void SetHistYTitle( const char *name ) { fHistYTitle = name; }
217
218 void SetNbins ( const Int_t i ) { fNbins = i; }
219 void SetFirst ( const Axis_t f ) { fFirst = f; }
220 void SetLast ( const Axis_t f ) { fLast = f; }
221
222 void SetProbLimit ( const Float_t f=fgProbLimit) { fProbLimit = f; }
223
224 void SetNumLoGainSaturationLimit( const Float_t lim ) { fNumLoGainSaturationLimit = lim; }
225 void SetNumHiGainSaturationLimit( const Float_t lim ) { fNumHiGainSaturationLimit = lim; }
226 void SetPulserFrequency ( const Int_t f=fgPulserFrequency) { fPulserFrequency = f; }
227
228 ClassDef(MHCalibrationCam, 2) // Base Histogram class for Calibration Camera
229};
230
231#endif
Note: See TracBrowser for help on using the repository browser.