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

Last change on this file since 3027 was 3007, checked in by gaug, 21 years ago
*** empty log message ***
File size: 3.8 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 gkTimeSliceWidth;
26
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 TH1D* fOffsets; //!
35 TH1D* fSlopes; //!
36
37 TH2D* fOffvsSlope; //!
38
39 Float_t fMeanPhotInsidePlexiglass; // The mean number of photons in an INNER PIXEL inside the plexiglass
40 Float_t fMeanPhotErrInsidePlexiglass; // The uncertainty about the number of photons in an INNER PIXEL
41 Float_t fMeanPhotOutsidePlexiglass; // The mean number of photons in an INNER PIXEL outside the plexiglass
42 Float_t fMeanPhotErrOutsidePlexiglass; // 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 kNumPhotInsidePlexiglassAvailable, kNumPhotOutsidePlexiglassAvailable };
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 // Getters
75 Int_t GetSize() const;
76 UInt_t GetNumPixels() const { return fNumPixels; }
77
78 MCalibrationBlindPix *GetBlindPixel() const { return fBlindPixel; }
79 MCalibrationPINDiode *GetPINDiode() const { return fPINDiode; }
80 MCalibrationBlindPix *GetBlindPixel() { return fBlindPixel; }
81 MCalibrationPINDiode *GetPINDiode() { return fPINDiode; }
82
83 Bool_t GetConversionFactorFFactor(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
84 Bool_t GetConversionFactorBlindPixel(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
85 Bool_t GetConversionFactorPINDiode(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
86 Bool_t GetConversionFactorCombined(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma);
87
88 Bool_t IsPixelUsed(Int_t idx) const;
89 Bool_t IsPixelFitted(Int_t idx) const;
90
91 Bool_t IsBlindPixelMethodValid() const;
92 Bool_t IsPINDiodeMethodValid() const;
93
94 Bool_t IsNumPhotInsidePlexiglassAvailable() const;
95 Bool_t IsNumPhotOutsidePlexiglassAvailable() const;
96
97 // Others
98 MCalibrationPix &operator[](Int_t i);
99 MCalibrationPix &operator[](Int_t i) const;
100
101 void CutEdges();
102 Bool_t CheckBounds(Int_t i) const;
103
104 // Prints
105 void Print(Option_t *o="") const;
106
107 // Draws
108 void DrawPixelContent(Int_t num) const;
109 void DrawHiLoFits();
110
111 // Others
112 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
113
114 Bool_t CalcNumPhotInsidePlexiglass();
115 Bool_t CalcNumPhotOutsidePlexiglass();
116
117 ClassDef(MCalibrationCam, 1) // Storage Container for all calibration information of the camera
118};
119
120#endif
121
Note: See TracBrowser for help on using the repository browser.