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

Last change on this file since 5863 was 5863, checked in by gaug, 20 years ago
*** empty log message ***
File size: 10.1 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 MCalibrationIntensityCam;
32class MCalibrationCam;
33class MCalibrationPix;
34class MBadPixelsIntensityCam;
35class MBadPixelsCam;
36class MBadPixelsPix;
37
38class MHCalibrationCam : public MH, public MCamEvent
39{
40
41private:
42
43 static const Int_t fgPulserFrequency; //! The default for fPulserFrequency (now set to: 500)
44 static const Float_t fgProbLimit; //! The default for fProbLimit (now set to: 0.0001)
45
46 static const TString gsHistName; //! Default Histogram names
47 static const TString gsHistTitle; //! Default Histogram titles
48 static const TString gsHistXTitle; //! Default Histogram x-axis titles
49 static const TString gsHistYTitle; //! Default Histogram y-axis titles
50
51protected:
52
53 Int_t fNbins; // Number of bins
54 Axis_t fFirst; // Lower histogram limit
55 Axis_t fLast; // Upper histogram limit
56
57 Float_t fProbLimit; // Limit for acceptance of probability of Gauss-Fit
58
59 TString fHistName; //! Histogram names
60 TString fHistTitle; //! Histogram titles
61 TString fHistXTitle; //! Histogram x-axis titles
62 TString fHistYTitle; //! Histogram y-axis titles
63
64 Float_t fNumHiGainSaturationLimit; // Rel. amount sat. higain FADC slices until pixel is called saturated
65 Float_t fNumLoGainSaturationLimit; // Rel. amount sat. logain FADC slices until pixel is called saturated
66 Float_t fNumOverflowLimit; // Part of maximum allowed overflow events
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
92 TOrdCollection *fHiGainArray; // Array of calibration pixels, one per pixel
93 TOrdCollection *fLoGainArray; // Array of calibration pixels, one per pixel
94
95 Int_t fPulserFrequency; // Light pulser frequency
96
97 enum { kDebug, kLoGain, kAverageing,
98 kOscillations, kSizeCheck }; // Possible global flags
99
100 Byte_t fFlags; // Bit-field to hold the global flags
101
102 virtual Bool_t SetupHists ( const MParList *pList ) { return kTRUE; }
103 virtual Bool_t ReInitHists( MParList *pList ) { return kTRUE; }
104 virtual Bool_t FillHists ( const MParContainer *par, const Stat_t w=1) { return kTRUE; }
105 virtual Bool_t FinalizeHists() { return kTRUE; }
106
107 virtual void FinalizeBadPixels() { }
108
109 virtual void CalcAverageSigma();
110
111 virtual void InitHiGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors );
112 virtual void InitLoGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors );
113
114 virtual void ResetHistTitles();
115
116 void DrawAverageSigma( Bool_t sat, Bool_t inner,
117 Float_t sigma, Float_t sigmaerr,
118 Float_t relsigma, Float_t relsigmaerr) const;
119
120 void FitHiGainArrays ( MCalibrationCam &calcam, MBadPixelsCam &badcam,
121 MBadPixelsPix::UncalibratedType_t fittyp,
122 MBadPixelsPix::UncalibratedType_t osctyp);
123
124 void FitHiGainHists ( MHCalibrationPix &hist,
125 MCalibrationPix &pix,
126 MBadPixelsPix &bad,
127 MBadPixelsPix::UncalibratedType_t fittyp,
128 MBadPixelsPix::UncalibratedType_t osctyp);
129
130 void FitLoGainArrays ( MCalibrationCam &calcam, MBadPixelsCam &badcam,
131 MBadPixelsPix::UncalibratedType_t fittyp,
132 MBadPixelsPix::UncalibratedType_t osctyp);
133
134 void FitLoGainHists ( MHCalibrationPix &hist,
135 MCalibrationPix &pix,
136 MBadPixelsPix &bad,
137 MBadPixelsPix::UncalibratedType_t fittyp,
138 MBadPixelsPix::UncalibratedType_t osctyp);
139
140 void InitHists ( MHCalibrationPix &hist, MBadPixelsPix &bad, const Int_t i);
141
142 Bool_t IsAverageing () const { return TESTBIT(fFlags,kAverageing); }
143 Bool_t IsDebug () const { return TESTBIT(fFlags,kDebug); }
144 Bool_t IsLoGain () const { return TESTBIT(fFlags,kLoGain); }
145 Bool_t IsOscillations() const { return TESTBIT(fFlags,kOscillations); }
146 Bool_t IsSizeCheck () const { return TESTBIT(fFlags,kSizeCheck); }
147
148 void Remove ( TOrdCollection *col );
149
150 Int_t ReadEnv ( const TEnv &env, TString prefix, Bool_t print );
151
152public:
153
154 MHCalibrationCam(const char *name=NULL, const char *title=NULL);
155 virtual ~MHCalibrationCam();
156
157 Bool_t SetupFill(const MParList *pList);
158 Bool_t ReInit ( MParList *pList);
159 Bool_t Fill (const MParContainer *par, const Stat_t w=1);
160 Bool_t Finalize ( );
161
162 virtual void ResetHists();
163
164 // Draw
165 void Draw(const Option_t *opt);
166
167 Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const { return kTRUE; }
168 void DrawPixelContent( Int_t num ) const {}
169
170 const Int_t GetAverageAreas () const;
171 MHCalibrationPix &GetAverageHiGainArea (UInt_t i);
172 const MHCalibrationPix &GetAverageHiGainArea (UInt_t i) const;
173 MHCalibrationPix &GetAverageLoGainArea (UInt_t i);
174 const MHCalibrationPix &GetAverageLoGainArea (UInt_t i) const;
175 MHCalibrationPix &GetAverageHiGainSector(UInt_t i);
176 const MHCalibrationPix &GetAverageHiGainSector(UInt_t i) const;
177 MHCalibrationPix &GetAverageLoGainSector(UInt_t i);
178 const MHCalibrationPix &GetAverageLoGainSector(UInt_t i) const;
179 const Int_t GetAverageSectors () const;
180 const MCalibrationCam::PulserColor_t GetColor () const { return fColor; }
181 const Float_t GetNumHiGainSaturationLimit() const { return fNumHiGainSaturationLimit; }
182 const Float_t GetNumLoGainSaturationLimit() const { return fNumLoGainSaturationLimit; }
183 const MArrayI &GetRunNumbers () const { return fRunNumbers; }
184 const Int_t GetSize () const;
185
186 MHCalibrationPix &operator[] (UInt_t i);
187 const MHCalibrationPix &operator[] (UInt_t i) const;
188 MHCalibrationPix &operator() (UInt_t i);
189 const MHCalibrationPix &operator() (UInt_t i) const;
190
191 void SetColor ( const MCalibrationCam::PulserColor_t color) { fColor = color; }
192 void SetAverageing ( const Bool_t b=kTRUE ) { b
193 ? SETBIT(fFlags,kAverageing)
194 : CLRBIT(fFlags,kAverageing); }
195 void SetDebug ( const Bool_t b=kTRUE ) { b
196 ? SETBIT(fFlags,kDebug)
197 : CLRBIT(fFlags,kDebug); }
198 void SetLoGain ( const Bool_t b=kTRUE ) { b
199 ? SETBIT(fFlags,kLoGain)
200 : CLRBIT(fFlags,kLoGain); }
201 void SetOscillations ( const Bool_t b=kTRUE ) { b
202 ? SETBIT(fFlags,kOscillations)
203 : CLRBIT(fFlags,kOscillations); }
204 void SetSizeCheck ( const Bool_t b=kTRUE ) { b
205 ? SETBIT(fFlags,kSizeCheck)
206 : CLRBIT(fFlags,kSizeCheck); }
207 void SetHistName ( const char *name ) { fHistName = name; }
208 void SetHistTitle ( const char *name ) { fHistTitle = name; }
209 void SetHistXTitle( const char *name ) { fHistXTitle = name; }
210 void SetHistYTitle( const char *name ) { fHistYTitle = name; }
211
212 void SetNbins ( const Int_t i ) { fNbins = i; }
213 void SetFirst ( const Axis_t f ) { fFirst = f; }
214 void SetLast ( const Axis_t f ) { fLast = f; }
215
216 void SetProbLimit ( const Float_t f=fgProbLimit) { fProbLimit = f; }
217
218 void SetNumLoGainSaturationLimit( const Float_t lim ) { fNumLoGainSaturationLimit = lim; }
219 void SetNumHiGainSaturationLimit( const Float_t lim ) { fNumHiGainSaturationLimit = lim; }
220 void SetNumOverflowLimit ( const Float_t lim ) { fNumOverflowLimit = lim; }
221 void SetPulserFrequency ( const Int_t f=fgPulserFrequency) { fPulserFrequency = f; }
222
223 ClassDef(MHCalibrationCam, 4) // Base Histogram class for Calibration Camera
224};
225
226#endif
Note: See TracBrowser for help on using the repository browser.