source: trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.h@ 4887

Last change on this file since 4887 was 4882, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 7.3 KB
Line 
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
27class TText;
28class TObjArray;
29
30class MHGausEvents;
31class MGeomCam;
32class MRawRunHeader;
33class MCalibrationCam;
34class MCalibrationPix;
35class MBadPixelsCam;
36class MBadPixelsPix;
37
38class MHCalibrationCam : public MH, public MCamEvent
39{
40
41private:
42
43 static const Int_t fgAverageNbins; //! The default for fAverageNbins (now set to: 2000)
44 static const Int_t fgPulserFrequency; //! The default for fPulserFrequency (now set to: 500)
45
46protected:
47
48 Float_t fNumHiGainSaturationLimit; // Rel. amount sat. higain FADC slices until pixel is called saturated
49 Float_t fNumLoGainSaturationLimit; // Rel. amount sat. logain FADC slices until pixel is called saturated
50
51 TArrayI fAverageAreaNum; // Number of pixels in average pixels per area
52 TArrayF fAverageAreaRelSigma; // Re-normalized relative sigmas in average pixels per area
53 TArrayF fAverageAreaRelSigmaVar; // Variance Re-normalized relative sigmas in average pixels per area
54 TArrayI fAverageAreaSat; // Number of saturated slices in average pixels per area
55 TArrayF fAverageAreaSigma; // Re-normalized sigmas in average pixels per area
56 TArrayF fAverageAreaSigmaVar; // Variance Re-normalized sigmas in average pixels per area
57 Int_t fAverageNbins; // Number of bins for the average histograms
58 TObjArray *fAverageHiGainAreas; //-> Array of calibration pixels, one per pixel area
59 TObjArray *fAverageHiGainSectors; //-> Array of calibration pixels, one per camera sector
60 TObjArray *fAverageLoGainAreas; //-> Array of calibration pixels, one per pixel area
61 TObjArray *fAverageLoGainSectors; //-> Array of calibration pixels, one per camera sector
62 TArrayI fAverageSectorNum; // Number of pixels in average pixels per sector
63 TArrayI fRunNumbers; // Numbers of runs used
64 TArrayI fHiGainOverFlow; // Number of times overflow occurred in whole run
65 TArrayI fLoGainOverFlow; // Number of times overflow occurred in whole run
66
67 MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs
68
69 MBadPixelsCam *fBadPixels; //! Bad Pixels storage container
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(MHGausEvents &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(MHGausEvents &hist,
108 MCalibrationPix &pix,
109 MBadPixelsPix &bad,
110 MBadPixelsPix::UncalibratedType_t fittyp,
111 MBadPixelsPix::UncalibratedType_t osctyp);
112
113 void InitHists(MHGausEvents &hist, MBadPixelsPix &bad, const Int_t i);
114
115 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
116
117public:
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 // Clone
128 virtual TObject *Clone(const char *name="") const;
129
130 // Draw
131 virtual void Draw(const Option_t *opt);
132
133 virtual Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
134 virtual void DrawPixelContent( Int_t num ) const;
135
136 const Int_t GetAverageAreas () const;
137 MHGausEvents &GetAverageHiGainArea (UInt_t i);
138 const MHGausEvents &GetAverageHiGainArea (UInt_t i) const;
139 MHGausEvents &GetAverageLoGainArea (UInt_t i);
140 const MHGausEvents &GetAverageLoGainArea (UInt_t i) const;
141 MHGausEvents &GetAverageHiGainSector(UInt_t i);
142 const MHGausEvents &GetAverageHiGainSector(UInt_t i) const;
143 MHGausEvents &GetAverageLoGainSector(UInt_t i);
144 const MHGausEvents &GetAverageLoGainSector(UInt_t i) const;
145 const Int_t GetAverageSectors () const;
146 const MCalibrationCam::PulserColor_t GetColor () const { return fColor; }
147 const Float_t GetNumHiGainSaturationLimit() const { return fNumHiGainSaturationLimit; }
148 const Float_t GetNumLoGainSaturationLimit() const { return fNumLoGainSaturationLimit; }
149 const TArrayI &GetRunNumbers () const;
150 const Int_t GetSize () const;
151
152 const Bool_t IsDebug () const { return fDebug; }
153
154 MHGausEvents &operator[] (UInt_t i);
155 const MHGausEvents &operator[] (UInt_t i) const;
156 MHGausEvents &operator() (UInt_t i);
157 const MHGausEvents &operator() (UInt_t i) const;
158
159 void SetColor ( const MCalibrationCam::PulserColor_t color ) { fColor = color; }
160 void SetDebug ( const Bool_t b=kTRUE ) { fDebug = b; }
161 void SetLoGain ( const Bool_t b=kTRUE ) { fLoGain = b; }
162 void SetAverageNbins ( const Int_t bins=fgAverageNbins ) { fAverageNbins = bins; }
163 void SetNumLoGainSaturationLimit( const Float_t lim ) { fNumLoGainSaturationLimit = lim; }
164 void SetNumHiGainSaturationLimit( const Float_t lim ) { fNumHiGainSaturationLimit = lim; }
165 void SetPulserFrequency ( const Int_t f=fgPulserFrequency ) { fPulserFrequency = f; }
166
167 ClassDef(MHCalibrationCam, 1) // Base Histogram class for Calibration Camera
168};
169
170#endif
171
172
173
174
175
176
177
178
179
Note: See TracBrowser for help on using the repository browser.