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

Last change on this file since 3062 was 3062, checked in by gaug, 21 years ago
*** empty log message ***
File size: 4.1 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 TH1D* fOffsets; //!
33 TH1D* fSlopes; //!
34
35 TH2D* fOffvsSlope; //!
36
37 Float_t fMeanPhotInsidePlexiglass; // The mean number of photons in an INNER PIXEL inside the plexiglass
38 Float_t fMeanPhotErrInsidePlexiglass; // The uncertainty about the number of photons in an INNER PIXEL
39 Float_t fMeanPhotOutsidePlexiglass; // The mean number of photons in an INNER PIXEL outside the plexiglass
40 Float_t fMeanPhotErrOutsidePlexiglass; // The uncertainty about the number of photons in an INNER PIXEL
41
42 UInt_t fNumExcludedPixels;
43
44 Byte_t fFlags;
45
46 enum { kBlindPixelMethodValid, kPINDiodeMethodValid,
47 kNumPhotInsidePlexiglassAvailable, kNumPhotOutsidePlexiglassAvailable };
48
49public:
50
51 enum CalibrationColor_t { kECGreen, kECBlue, kECUV, kECCT1 };
52
53private:
54
55 CalibrationColor_t fColor;
56
57public:
58
59 MCalibrationCam(const char *name=NULL, const char *title=NULL);
60 ~MCalibrationCam();
61
62 void Clear(Option_t *o="");
63 void InitSize(const UInt_t i);
64
65 // Setters
66 void SetColor(const CalibrationColor_t color) { fColor = color; }
67 void SetNumPixelsExcluded(const UInt_t n) { fNumExcludedPixels = n; }
68
69 void SetBlindPixelMethodValid(const Bool_t b = kTRUE);
70 void SetPINDiodeMethodValid(const Bool_t b = kTRUE);
71
72 // Getters
73 Int_t GetSize() const;
74 UInt_t GetNumPixels() const { return fNumPixels; }
75
76 MCalibrationBlindPix *GetBlindPixel() const { return fBlindPixel; }
77 MCalibrationPINDiode *GetPINDiode() const { return fPINDiode; }
78 MCalibrationBlindPix *GetBlindPixel() { return fBlindPixel; }
79 MCalibrationPINDiode *GetPINDiode() { return fPINDiode; }
80
81 Float_t GetMeanPhotInsidePlexiglass() const { return fMeanPhotInsidePlexiglass; }
82 Float_t GetMeanPhotErrInsidePlexiglass() const { return fMeanPhotErrInsidePlexiglass; }
83 Float_t GetMeanPhotOutsidePlexiglass() const { return fMeanPhotOutsidePlexiglass; }
84 Float_t GetMeanPhotErrOutsidePlexiglass() const { return fMeanPhotErrOutsidePlexiglass; }
85
86 Bool_t GetConversionFactorFFactor(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
87 Bool_t GetConversionFactorBlindPixel(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
88 Bool_t GetConversionFactorPINDiode(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
89 Bool_t GetConversionFactorCombined(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
90
91 Bool_t IsPixelUsed(Int_t idx) const;
92 Bool_t IsPixelFitted(Int_t idx) const;
93
94 Bool_t IsBlindPixelMethodValid() const;
95 Bool_t IsPINDiodeMethodValid() const;
96
97 Bool_t IsNumPhotInsidePlexiglassAvailable() const;
98 Bool_t IsNumPhotOutsidePlexiglassAvailable() const;
99
100 // Others
101 MCalibrationPix &operator[](Int_t i);
102 MCalibrationPix &operator[](Int_t i) const;
103
104 void CutEdges();
105 Bool_t CheckBounds(Int_t i) const;
106
107 // Prints
108 void Print(Option_t *o="") const;
109
110 // Draws
111 void DrawPixelContent(Int_t num) const;
112 void DrawHiLoFits();
113
114 // Others
115 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
116
117 Bool_t CalcNumPhotInsidePlexiglass();
118 Bool_t CalcNumPhotOutsidePlexiglass();
119
120 ClassDef(MCalibrationCam, 1) // Container for calibration information of the camera
121};
122
123#endif
124
Note: See TracBrowser for help on using the repository browser.