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

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