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

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