source: trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h@ 3075

Last change on this file since 3075 was 3075, checked in by gaug, 21 years ago
*** empty log message ***
File size: 4.2 KB
Line 
1#ifndef MARS_MCalibrationCam
2#define MARS_MCalibrationCam
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 MCalibrationPix;
16class MCalibrationBlindPix;
17class MCalibrationPINDiode;
18
19class MCalibrationCam : public MParContainer, public MCamEvent
20{
21private:
22
23 static const Int_t gkBlindPixelId;
24 static const Int_t gkPINDiodeId;
25
26 Int_t fNumPixels;
27 TClonesArray *fPixels; //-> Array of MCalibrationPix with fit results
28
29 MCalibrationBlindPix *fBlindPixel; //-> Pointer to the Blind Pixel with fit results
30 MCalibrationPINDiode *fPINDiode; //-> Pointer to the PIN Diode with fit results
31
32 MGeomCam *fGeomCam; //! Need geom cam to know which pixel in inner or outer
33
34 TH1D* fOffsets; //!
35 TH1D* fSlopes; //!
36
37 TH2D* fOffvsSlope; //!
38
39 Float_t fMeanFluxInsidePlexiglass; // The mean number of photons in an INNER PIXEL inside the plexiglass
40 Float_t fMeanFluxErrInsidePlexiglass; // The uncertainty about the number of photons in an INNER PIXEL
41 Float_t fMeanFluxOutsidePlexiglass; // The mean number of photons in an INNER PIXEL outside the plexiglass
42 Float_t fMeanFluxErrOutsidePlexiglass; // The uncertainty about the number of photons in an INNER PIXEL
43
44 UInt_t fNumExcludedPixels;
45
46 Byte_t fFlags;
47
48 enum { kBlindPixelMethodValid, kPINDiodeMethodValid,
49 kFluxInsidePlexiglassAvailable, kFluxOutsidePlexiglassAvailable };
50
51public:
52
53 enum CalibrationColor_t { kECGreen, kECBlue, kECUV, kECCT1 };
54
55private:
56
57 CalibrationColor_t fColor;
58
59public:
60
61 MCalibrationCam(const char *name=NULL, const char *title=NULL);
62 ~MCalibrationCam();
63
64 void Clear(Option_t *o="");
65 void InitSize(const UInt_t i);
66
67 // Setters
68 void SetColor(const CalibrationColor_t color) { fColor = color; }
69 void SetNumPixelsExcluded(const UInt_t n) { fNumExcludedPixels = n; }
70
71 void SetBlindPixelMethodValid(const Bool_t b = kTRUE);
72 void SetPINDiodeMethodValid(const Bool_t b = kTRUE);
73
74 void SetGeomCam(MGeomCam *geom) { fGeomCam = geom; }
75
76 // Getters
77 Int_t GetSize() const;
78 UInt_t GetNumPixels() const { return fNumPixels; }
79
80 MCalibrationBlindPix *GetBlindPixel() const { return fBlindPixel; }
81 MCalibrationPINDiode *GetPINDiode() const { return fPINDiode; }
82 MCalibrationBlindPix *GetBlindPixel() { return fBlindPixel; }
83 MCalibrationPINDiode *GetPINDiode() { return fPINDiode; }
84
85 Float_t GetMeanFluxInsidePlexiglass() const { return fMeanFluxInsidePlexiglass; }
86 Float_t GetMeanFluxErrInsidePlexiglass() const { return fMeanFluxErrInsidePlexiglass; }
87 Float_t GetMeanFluxOutsidePlexiglass() const { return fMeanFluxOutsidePlexiglass; }
88 Float_t GetMeanFluxErrOutsidePlexiglass() const { return fMeanFluxErrOutsidePlexiglass; }
89
90 Bool_t GetConversionFactorFFactor(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
91 Bool_t GetConversionFactorBlindPixel(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
92 Bool_t GetConversionFactorPINDiode(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
93 Bool_t GetConversionFactorCombined(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
94
95 Bool_t IsPixelUsed(Int_t idx) const;
96 Bool_t IsPixelFitted(Int_t idx) const;
97
98 Bool_t IsBlindPixelMethodValid() const;
99 Bool_t IsPINDiodeMethodValid() const;
100
101 Bool_t IsFluxInsidePlexiglassAvailable() const;
102 Bool_t IsFluxOutsidePlexiglassAvailable() const;
103
104 // Others
105 MCalibrationPix &operator[](Int_t i);
106 MCalibrationPix &operator[](Int_t i) const;
107
108 void CutEdges();
109 Bool_t CheckBounds(Int_t i) const;
110
111 // Prints
112 void Print(Option_t *o="") const;
113
114 // Draws
115 void DrawPixelContent(Int_t num) const;
116 void DrawHiLoFits();
117
118 // Others
119 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
120
121 Bool_t CalcFluxInsidePlexiglass();
122 Bool_t CalcFluxOutsidePlexiglass();
123
124 ClassDef(MCalibrationCam, 1) // Container for calibration information of the camera
125};
126
127#endif
128
Note: See TracBrowser for help on using the repository browser.