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

Last change on this file since 4619 was 4619, checked in by gaug, 20 years ago
*** empty log message ***
File size: 6.9 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
27class TText;
28class TArrayI;
29class TArrayF;
30class MHGausEvents;
31class MGeomCam;
32class MRawRunHeader;
33class MCalibrationCam;
34class MCalibrationPix;
35class MBadPixelsCam;
36class MBadPixelsPix;
37class MHCalibrationCam : public MH, public MCamEvent
38{
39
40private:
41
42 static const Int_t fgAverageNbins; //! The default for fAverageNbins (now set to: 2000)
43 static const Int_t fgPulserFrequency; //! The default for fPulserFrequency (now set to: 500)
44
45protected:
46
47 Float_t fNumHiGainSaturationLimit; // Rel. amount sat. higain FADC slices until pixel is called saturated
48 Float_t fNumLoGainSaturationLimit; // Rel. amount sat. logain FADC slices until pixel is called saturated
49
50 TArrayI fAverageAreaNum; // Number of pixels in average pixels per area
51 TArrayF fAverageAreaRelSigma; // Re-normalized relative sigmas in average pixels per area
52 TArrayF fAverageAreaRelSigmaVar; // Variance Re-normalized relative sigmas in average pixels per area
53 TArrayI fAverageAreaSat; // Number of saturated slices in average pixels per area
54 TArrayF fAverageAreaSigma; // Re-normalized sigmas in average pixels per area
55 TArrayF fAverageAreaSigmaVar; // Variance Re-normalized sigmas in average pixels per area
56 Int_t fAverageNbins; // Number of bins for the average histograms
57 TObjArray *fAverageHiGainAreas; //-> Array of calibration pixels, one per pixel area
58 TObjArray *fAverageHiGainSectors; //-> Array of calibration pixels, one per camera sector
59 TObjArray *fAverageLoGainAreas; //-> Array of calibration pixels, one per pixel area
60 TObjArray *fAverageLoGainSectors; //-> Array of calibration pixels, one per camera sector
61 TArrayI fAverageSectorNum; // Number of pixels in average pixels per sector
62 TArrayI fRunNumbers; // Numbers of runs used
63 UInt_t fHiGainOverFlow; // Number of times overflow occurred in whole run
64 UInt_t fLoGainOverFlow; // Number of times overflow occurred in whole run
65
66 MBadPixelsCam *fBadPixels; //! Bad Pixels storage container
67 MCalibrationCam *fCam; //! Calibration Cam with the results
68 MGeomCam *fGeom; //! Camera geometry
69 MRawRunHeader *fRunHeader; //! Run Header
70
71 TObjArray *fHiGainArray; //-> Array of calibration pixels, one per pixel
72 TObjArray *fLoGainArray; //-> Array of calibration pixels, one per pixel
73
74 Int_t fPulserFrequency; // Light pulser frequency
75 Bool_t fDebug; // Debug option is used?
76
77 virtual Bool_t SetupHists(const MParList *pList);
78 virtual Bool_t ReInitHists(MParList *pList);
79 virtual Bool_t FillHists(const MParContainer *par, const Stat_t w=1);
80 virtual Bool_t FinalizeHists();
81 virtual void FinalizeBadPixels();
82
83 virtual void CalcAverageSigma();
84
85 void DrawAverageSigma(Bool_t sat, Bool_t inner,
86 Float_t sigma, Float_t sigmaerr,
87 Float_t relsigma, Float_t relsigmaerr) const;
88
89 void FitHiGainArrays(MCalibrationCam &calcam, MBadPixelsCam &badcam,
90 MBadPixelsPix::UncalibratedType_t fittyp,
91 MBadPixelsPix::UncalibratedType_t osctyp);
92
93 void FitHiGainHists(MHGausEvents &hist,
94 MCalibrationPix &pix,
95 MBadPixelsPix &bad,
96 MBadPixelsPix::UncalibratedType_t fittyp,
97 MBadPixelsPix::UncalibratedType_t osctyp);
98
99 void FitLoGainArrays(MCalibrationCam &calcam, MBadPixelsCam &badcam,
100 MBadPixelsPix::UncalibratedType_t fittyp,
101 MBadPixelsPix::UncalibratedType_t osctyp);
102
103 void FitLoGainHists(MHGausEvents &hist,
104 MCalibrationPix &pix,
105 MBadPixelsPix &bad,
106 MBadPixelsPix::UncalibratedType_t fittyp,
107 MBadPixelsPix::UncalibratedType_t osctyp);
108
109 void InitHists(MHGausEvents &hist, MBadPixelsPix &bad, const Int_t i);
110
111 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
112
113public:
114
115 MHCalibrationCam(const char *name=NULL, const char *title=NULL);
116 virtual ~MHCalibrationCam();
117
118 virtual Bool_t SetupFill(const MParList *pList);
119 virtual Bool_t ReInit ( MParList *pList);
120 virtual Bool_t Fill (const MParContainer *par, const Stat_t w=1);
121 virtual Bool_t Finalize ( );
122
123 // Clone
124 virtual TObject *Clone(const char *name="") const;
125
126 // Draw
127 virtual void Draw(const Option_t *opt);
128
129 virtual Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
130 virtual void DrawPixelContent( Int_t num ) const;
131
132 const Int_t GetAverageAreas () const;
133 MHGausEvents &GetAverageHiGainArea (UInt_t i);
134 const MHGausEvents &GetAverageHiGainArea (UInt_t i) const;
135 MHGausEvents &GetAverageLoGainArea (UInt_t i);
136 const MHGausEvents &GetAverageLoGainArea (UInt_t i) const;
137 MHGausEvents &GetAverageHiGainSector(UInt_t i);
138 const MHGausEvents &GetAverageHiGainSector(UInt_t i) const;
139 MHGausEvents &GetAverageLoGainSector(UInt_t i);
140 const MHGausEvents &GetAverageLoGainSector(UInt_t i) const;
141 const Int_t GetAverageSectors () const;
142 const Float_t GetNumHiGainSaturationLimit() const { return fNumHiGainSaturationLimit; }
143 const Float_t GetNumLoGainSaturationLimit() const { return fNumLoGainSaturationLimit; }
144 const TArrayI &GetRunNumbers () const;
145 const Int_t GetSize () const { return fHiGainArray->GetSize(); }
146
147 const Bool_t IsDebug () const { return fDebug; }
148
149 MHGausEvents &operator[] (UInt_t i);
150 const MHGausEvents &operator[] (UInt_t i) const;
151 MHGausEvents &operator() (UInt_t i);
152 const MHGausEvents &operator() (UInt_t i) const;
153
154 void SetDebug (const Bool_t b=kTRUE) { fDebug = b; }
155 void SetAverageNbins ( const Int_t bins=fgAverageNbins ) { fAverageNbins = bins; }
156 void SetNumLoGainSaturationLimit( const Float_t lim) { fNumLoGainSaturationLimit = lim; }
157 void SetNumHiGainSaturationLimit( const Float_t lim) { fNumHiGainSaturationLimit = lim; }
158 void SetPulserFrequency ( const Int_t f=fgPulserFrequency) { fPulserFrequency = f; }
159
160 ClassDef(MHCalibrationCam, 1) // Base Histogram class for Calibration Camera
161};
162
163#endif
164
165
166
167
168
169
170
171
172
Note: See TracBrowser for help on using the repository browser.