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

Last change on this file since 4875 was 4873, checked in by gaug, 20 years ago
*** empty log message ***
File size: 7.4 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 TArrayI fHiGainOverFlow; // Number of times overflow occurred in whole run
68 TArrayI 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 Bool_t fLoGain; // Is Low-Gain available
83
84 virtual Bool_t SetupHists(const MParList *pList);
85 virtual Bool_t ReInitHists(MParList *pList);
86 virtual Bool_t FillHists(const MParContainer *par, const Stat_t w=1);
87 virtual Bool_t FinalizeHists();
88 virtual void FinalizeBadPixels();
89
90 virtual void CalcAverageSigma();
91
92 void DrawAverageSigma(Bool_t sat, Bool_t inner,
93 Float_t sigma, Float_t sigmaerr,
94 Float_t relsigma, Float_t relsigmaerr) const;
95
96 void FitHiGainArrays(MCalibrationCam &calcam, MBadPixelsCam &badcam,
97 MBadPixelsPix::UncalibratedType_t fittyp,
98 MBadPixelsPix::UncalibratedType_t osctyp);
99
100 void FitHiGainHists(MHGausEvents &hist,
101 MCalibrationPix &pix,
102 MBadPixelsPix &bad,
103 MBadPixelsPix::UncalibratedType_t fittyp,
104 MBadPixelsPix::UncalibratedType_t osctyp);
105
106 void FitLoGainArrays(MCalibrationCam &calcam, MBadPixelsCam &badcam,
107 MBadPixelsPix::UncalibratedType_t fittyp,
108 MBadPixelsPix::UncalibratedType_t osctyp);
109
110 void FitLoGainHists(MHGausEvents &hist,
111 MCalibrationPix &pix,
112 MBadPixelsPix &bad,
113 MBadPixelsPix::UncalibratedType_t fittyp,
114 MBadPixelsPix::UncalibratedType_t osctyp);
115
116 void InitHists(MHGausEvents &hist, MBadPixelsPix &bad, const Int_t i);
117
118 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
119
120public:
121
122 MHCalibrationCam(const char *name=NULL, const char *title=NULL);
123 virtual ~MHCalibrationCam();
124
125 virtual Bool_t SetupFill(const MParList *pList);
126 virtual Bool_t ReInit ( MParList *pList);
127 virtual Bool_t Fill (const MParContainer *par, const Stat_t w=1);
128 virtual Bool_t Finalize ( );
129
130 // Clone
131 virtual TObject *Clone(const char *name="") const;
132
133 // Draw
134 virtual void Draw(const Option_t *opt);
135
136 virtual Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
137 virtual void DrawPixelContent( Int_t num ) const;
138
139 const Int_t GetAverageAreas () const;
140 MHGausEvents &GetAverageHiGainArea (UInt_t i);
141 const MHGausEvents &GetAverageHiGainArea (UInt_t i) const;
142 MHGausEvents &GetAverageLoGainArea (UInt_t i);
143 const MHGausEvents &GetAverageLoGainArea (UInt_t i) const;
144 MHGausEvents &GetAverageHiGainSector(UInt_t i);
145 const MHGausEvents &GetAverageHiGainSector(UInt_t i) const;
146 MHGausEvents &GetAverageLoGainSector(UInt_t i);
147 const MHGausEvents &GetAverageLoGainSector(UInt_t i) const;
148 const Int_t GetAverageSectors () const;
149 const MCalibrationCam::PulserColor_t GetColor () const { return fColor; }
150 const Float_t GetNumHiGainSaturationLimit() const { return fNumHiGainSaturationLimit; }
151 const Float_t GetNumLoGainSaturationLimit() const { return fNumLoGainSaturationLimit; }
152 const TArrayI &GetRunNumbers () const;
153 const Int_t GetSize () const { return fHiGainArray->GetSize(); }
154
155 const Bool_t IsDebug () const { return fDebug; }
156
157 MHGausEvents &operator[] (UInt_t i);
158 const MHGausEvents &operator[] (UInt_t i) const;
159 MHGausEvents &operator() (UInt_t i);
160 const MHGausEvents &operator() (UInt_t i) const;
161
162 void SetColor ( const MCalibrationCam::PulserColor_t color ) { fColor = color; }
163 void SetDebug ( const Bool_t b=kTRUE ) { fDebug = b; }
164 void SetLoGain ( const Bool_t b=kTRUE ) { fLoGain = b; }
165 void SetAverageNbins ( const Int_t bins=fgAverageNbins ) { fAverageNbins = bins; }
166 void SetNumLoGainSaturationLimit( const Float_t lim ) { fNumLoGainSaturationLimit = lim; }
167 void SetNumHiGainSaturationLimit( const Float_t lim ) { fNumHiGainSaturationLimit = lim; }
168 void SetPulserFrequency ( const Int_t f=fgPulserFrequency ) { fPulserFrequency = f; }
169
170 ClassDef(MHCalibrationCam, 1) // Base Histogram class for Calibration Camera
171};
172
173#endif
174
175
176
177
178
179
180
181
182
Note: See TracBrowser for help on using the repository browser.