source: trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h@ 3635

Last change on this file since 3635 was 3624, checked in by gaug, 21 years ago
*** empty log message ***
File size: 6.3 KB
Line 
1#ifndef MARS_MCalibrationChargeCam
2#define MARS_MCalibrationChargeCam
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7#ifndef MARS_MCamEvent
8#include "MCamEvent.h"
9#endif
10
11class TH1D;
12class TH2D;
13class TClonesArray;
14
15class MCalibrationChargeBlindPix;
16class MCalibrationChargePINDiode;
17class MCalibrationChargePix;
18class MBadPixelsPix;
19class MBadPixelsCam;
20class MCalibrationChargeCam : public MParContainer, public MCamEvent
21{
22private:
23
24 static const Float_t fgAverageQE; // The default for fAverageQE (now set to: 0.18)
25 static const Float_t fgAverageQEErr; // The default for fAverageQEErr (now set to: 0.02)
26 static const Float_t fgConvFFactorRelErrLimit; // The default for fConvFFactorRelErrLimit (now set to: 0.35)
27 static const Float_t fgPheFFactorRelErrLimit; // The default for fPheFFactorRelErrLimit (now set to: 5.)
28
29 Float_t fAverageQE; // The average quantum efficieny (see Class description)
30 Float_t fAverageQEVar; // The error of the average quantum efficieny (see Class description)
31 Float_t fConvFFactorRelVarLimit; // Acceptance limit for rel. error of conversion factor (FFactor method)
32 Float_t fPheFFactorRelVarLimit; // Acceptance limit for number of phe's w.r.t mean number (in variances)
33
34 TClonesArray *fPixels; //-> Array of MCalibrationChargePix, one per pixel
35 TClonesArray *fAverageAreas; //-> Array of MCalibrationChargePix, one per pixel area
36 TClonesArray *fAverageSectors; //-> Array of MCalibrationChargePix, one per camera sector
37 TClonesArray *fAverageBadAreas; //-> Array of MBadPixelsPix, one per pixel area
38 TClonesArray *fAverageBadSectors; //-> Array of MBadPixelsPix, one per camera sector
39
40 TH1D* fOffsets; //!
41 TH1D* fSlopes; //!
42
43 TH2D* fOffvsSlope; //!
44
45 Byte_t fFlags;
46
47 enum { kFFactorMethodValid, kBlindPixelMethodValid, kPINDiodeMethodValid, kCombinedMethodValid };
48
49 Float_t fMeanFluxPhesInnerPixel; // The mean number of photo-electrons in an INNER PIXEL
50 Float_t fMeanFluxPhesInnerPixelVar; // The variance of the number of photo-electrons INNER PIXEL
51 Float_t fMeanFluxPhesOuterPixel; // The mean number of photo-electrons in an INNER PIXEL
52 Float_t fMeanFluxPhesOuterPixelVar; // The variance of the number of photo-electrons INNER PIXEL
53
54 Float_t fMeanFluxPhotonsInnerPixel; // The mean number of photo-electrons in an INNER PIXEL
55 Float_t fMeanFluxPhotonsInnerPixelVar; // The variance of the number of photo-electrons INNER PIXEL
56 Float_t fMeanFluxPhotonsOuterPixel; // The mean number of photo-electrons in an INNER PIXEL
57 Float_t fMeanFluxPhotonsOuterPixelVar; // The variance of the number of photo-electrons INNER PIXEL
58
59public:
60
61 MCalibrationChargeCam(const char *name=NULL, const char *title=NULL);
62 ~MCalibrationChargeCam();
63
64 void Clear( Option_t *o="" );
65 void InitSize( const UInt_t i );
66 void InitAverageAreas( const UInt_t i );
67 void InitAverageSectors( const UInt_t i );
68
69 // Setters
70 void SetAverageQE( const Float_t qe= fgAverageQE,
71 const Float_t err=fgAverageQEErr) { fAverageQE = qe;
72 fAverageQEVar = err*err; }
73 void SetConvFFactorRelErrLimit( const Float_t f=fgConvFFactorRelErrLimit ) { fConvFFactorRelVarLimit = f*f; }
74 void SetPheFFactorRelErrLimit ( const Float_t f=fgPheFFactorRelErrLimit ) { fPheFFactorRelVarLimit = f*f; }
75
76 void SetFFactorMethodValid( const Bool_t b = kTRUE );
77 void SetBlindPixelMethodValid( const Bool_t b = kTRUE );
78 void SetPINDiodeMethodValid( const Bool_t b = kTRUE );
79
80 // Getters
81 Int_t GetSize() const;
82 Int_t GetAverageAreas() const;
83 Int_t GetAverageSectors() const;
84
85 Bool_t GetConversionFactorFFactor( Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma );
86 Bool_t GetConversionFactorBlindPixel( Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma );
87 Bool_t GetConversionFactorPINDiode( Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma );
88 Bool_t GetConversionFactorCombined( Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma );
89
90 Float_t GetMeanFluxPhesInnerPixel() const { return fMeanFluxPhesInnerPixel; }
91 Float_t GetMeanFluxPhesInnerPixelErr() const;
92 Float_t GetMeanFluxPhesOuterPixel() const { return fMeanFluxPhesOuterPixel; }
93 Float_t GetMeanFluxPhesOuterPixelErr() const;
94
95 Float_t GetMeanFluxPhotonsInnerPixel() const { return fMeanFluxPhotonsInnerPixel; }
96 Float_t GetMeanFluxPhotonsInnerPixelErr() const;
97 Float_t GetMeanFluxPhotonsOuterPixel() const { return fMeanFluxPhotonsOuterPixel; }
98 Float_t GetMeanFluxPhotonsOuterPixelErr() const;
99
100 Bool_t IsBlindPixelMethodValid() const;
101 Bool_t IsPINDiodeMethodValid() const;
102
103 // Others
104 MCalibrationChargePix &operator[](UInt_t i);
105 const MCalibrationChargePix &operator[](UInt_t i) const;
106
107 MCalibrationChargePix &GetAverageArea(UInt_t i);
108 const MCalibrationChargePix &GetAverageArea(UInt_t i) const;
109
110 MBadPixelsPix &GetAverageBadArea(UInt_t i);
111 const MBadPixelsPix &GetAverageBadArea(UInt_t i) const;
112
113 MCalibrationChargePix &GetAverageSector(UInt_t i);
114 const MCalibrationChargePix &GetAverageSector(UInt_t i) const;
115
116 MBadPixelsPix &GetAverageBadSector(UInt_t i);
117 const MBadPixelsPix &GetAverageBadSector(UInt_t i) const;
118
119 // Prints
120 void Print(Option_t *o="") const;
121
122 // Draws
123 void DrawPixelContent(Int_t num) const;
124// void DrawHiLoFits();
125
126 // Others
127 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
128
129 Bool_t CalcMeanFluxPhotonsFFactorMethod(const MGeomCam &geom, MBadPixelsCam &bad);
130
131 void ApplyPINDiodeCalibration(const MGeomCam &geom,
132 const MBadPixelsCam &bad,
133 const MCalibrationChargePINDiode &pindiode);
134 void ApplyBlindPixelCalibration(const MGeomCam &geom,
135 const MBadPixelsCam &bad,
136 const MCalibrationChargeBlindPix &blindpix);
137 void ApplyFFactorCalibration(const MGeomCam &geom, const MBadPixelsCam &bad);
138
139 ClassDef(MCalibrationChargeCam, 1) // Container for calibration of the camera
140};
141
142#endif
Note: See TracBrowser for help on using the repository browser.