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

Last change on this file since 4693 was 4630, checked in by gaug, 20 years ago
*** empty log message ***
File size: 7.3 KB
Line 
1#ifndef MARS_MHCalibrationCam
2#define MARS_MHCalibrationCam
3
4#ifndef ROOT_TObjArray
5#include <TObjArray.h>
6#endif
7
8#ifndef ROOT_TArrayI
9#include <TArrayI.h>
10#endif
11
12#ifndef ROOT_TArrayF
13#include <TArrayF.h>
14#endif
15
16#ifndef MARS_MH
17#include "MH.h"
18#endif
19#ifndef MARS_MCamEvent
20#include "MCamEvent.h"
21#endif
22
23#ifndef MARS_MBadPixelsPix
24#include "MBadPixelsPix.h"
25#endif
26
27#ifndef MARS_MCalibrationCam
28#include "MCalibrationCam.h"
29#endif
30
31class TText;
32class TArrayI;
33class TArrayF;
34class MHGausEvents;
35class MGeomCam;
36class MRawRunHeader;
37class MCalibrationCam;
38class MCalibrationPix;
39class MBadPixelsCam;
40class MBadPixelsPix;
41class MHCalibrationCam : public MH, public MCamEvent
42{
43
44private:
45
46 static const Int_t fgAverageNbins; //! The default for fAverageNbins (now set to: 2000)
47 static const Int_t fgPulserFrequency; //! The default for fPulserFrequency (now set to: 500)
48
49protected:
50
51 Float_t fNumHiGainSaturationLimit; // Rel. amount sat. higain FADC slices until pixel is called saturated
52 Float_t fNumLoGainSaturationLimit; // Rel. amount sat. logain FADC slices until pixel is called saturated
53
54 TArrayI fAverageAreaNum; // Number of pixels in average pixels per area
55 TArrayF fAverageAreaRelSigma; // Re-normalized relative sigmas in average pixels per area
56 TArrayF fAverageAreaRelSigmaVar; // Variance Re-normalized relative sigmas in average pixels per area
57 TArrayI fAverageAreaSat; // Number of saturated slices in average pixels per area
58 TArrayF fAverageAreaSigma; // Re-normalized sigmas in average pixels per area
59 TArrayF fAverageAreaSigmaVar; // Variance Re-normalized sigmas in average pixels per area
60 Int_t fAverageNbins; // Number of bins for the average histograms
61 TObjArray *fAverageHiGainAreas; //-> Array of calibration pixels, one per pixel area
62 TObjArray *fAverageHiGainSectors; //-> Array of calibration pixels, one per camera sector
63 TObjArray *fAverageLoGainAreas; //-> Array of calibration pixels, one per pixel area
64 TObjArray *fAverageLoGainSectors; //-> Array of calibration pixels, one per camera sector
65 TArrayI fAverageSectorNum; // Number of pixels in average pixels per sector
66 TArrayI fRunNumbers; // Numbers of runs used
67 UInt_t fHiGainOverFlow; // Number of times overflow occurred in whole run
68 UInt_t fLoGainOverFlow; // Number of times overflow occurred in whole run
69
70 MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs
71
72 MBadPixelsCam *fBadPixels; //! Bad Pixels storage container
73 MCalibrationCam *fCam; //! Calibration Cam with the results
74 MGeomCam *fGeom; //! Camera geometry
75 MRawRunHeader *fRunHeader; //! Run Header
76
77 TObjArray *fHiGainArray; //-> Array of calibration pixels, one per pixel
78 TObjArray *fLoGainArray; //-> Array of calibration pixels, one per pixel
79
80 Int_t fPulserFrequency; // Light pulser frequency
81 Bool_t fDebug; // Debug option is used?
82
83 virtual Bool_t SetupHists(const MParList *pList);
84 virtual Bool_t ReInitHists(MParList *pList);
85 virtual Bool_t FillHists(const MParContainer *par, const Stat_t w=1);
86 virtual Bool_t FinalizeHists();
87 virtual void FinalizeBadPixels();
88
89 virtual void CalcAverageSigma();
90
91 void DrawAverageSigma(Bool_t sat, Bool_t inner,
92 Float_t sigma, Float_t sigmaerr,
93 Float_t relsigma, Float_t relsigmaerr) const;
94
95 void FitHiGainArrays(MCalibrationCam &calcam, MBadPixelsCam &badcam,
96 MBadPixelsPix::UncalibratedType_t fittyp,
97 MBadPixelsPix::UncalibratedType_t osctyp);
98
99 void FitHiGainHists(MHGausEvents &hist,
100 MCalibrationPix &pix,
101 MBadPixelsPix &bad,
102 MBadPixelsPix::UncalibratedType_t fittyp,
103 MBadPixelsPix::UncalibratedType_t osctyp);
104
105 void FitLoGainArrays(MCalibrationCam &calcam, MBadPixelsCam &badcam,
106 MBadPixelsPix::UncalibratedType_t fittyp,
107 MBadPixelsPix::UncalibratedType_t osctyp);
108
109 void FitLoGainHists(MHGausEvents &hist,
110 MCalibrationPix &pix,
111 MBadPixelsPix &bad,
112 MBadPixelsPix::UncalibratedType_t fittyp,
113 MBadPixelsPix::UncalibratedType_t osctyp);
114
115 void InitHists(MHGausEvents &hist, MBadPixelsPix &bad, const Int_t i);
116
117 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
118
119public:
120
121 MHCalibrationCam(const char *name=NULL, const char *title=NULL);
122 virtual ~MHCalibrationCam();
123
124 virtual Bool_t SetupFill(const MParList *pList);
125 virtual Bool_t ReInit ( MParList *pList);
126 virtual Bool_t Fill (const MParContainer *par, const Stat_t w=1);
127 virtual Bool_t Finalize ( );
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 MHGausEvents &GetAverageHiGainArea (UInt_t i);
140 const MHGausEvents &GetAverageHiGainArea (UInt_t i) const;
141 MHGausEvents &GetAverageLoGainArea (UInt_t i);
142 const MHGausEvents &GetAverageLoGainArea (UInt_t i) const;
143 MHGausEvents &GetAverageHiGainSector(UInt_t i);
144 const MHGausEvents &GetAverageHiGainSector(UInt_t i) const;
145 MHGausEvents &GetAverageLoGainSector(UInt_t i);
146 const MHGausEvents &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 { return fHiGainArray->GetSize(); }
153
154 const Bool_t IsDebug () const { return fDebug; }
155
156 MHGausEvents &operator[] (UInt_t i);
157 const MHGausEvents &operator[] (UInt_t i) const;
158 MHGausEvents &operator() (UInt_t i);
159 const MHGausEvents &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 SetAverageNbins ( const Int_t bins=fgAverageNbins ) { fAverageNbins = bins; }
164 void SetNumLoGainSaturationLimit( const Float_t lim ) { fNumLoGainSaturationLimit = lim; }
165 void SetNumHiGainSaturationLimit( const Float_t lim ) { fNumHiGainSaturationLimit = lim; }
166 void SetPulserFrequency ( const Int_t f=fgPulserFrequency ) { fPulserFrequency = f; }
167
168 ClassDef(MHCalibrationCam, 1) // Base Histogram class for Calibration Camera
169};
170
171#endif
172
173
174
175
176
177
178
179
180
Note: See TracBrowser for help on using the repository browser.