source: trunk/MagicSoft/Mars/mcalib/MHCalibrationPixel.h@ 2901

Last change on this file since 2901 was 2885, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 5.1 KB
Line 
1#ifndef MARS_MHCalibrationPixel
2#define MARS_MHCalibrationPixel
3
4#ifndef MARS_MH
5#include "MH.h"
6#endif
7
8class TArrayF;
9class TH1F;
10class TH1I;
11class TF1;
12class TProfile;
13class TPaveText;
14
15class MHCalibrationPixel : public MH
16{
17
18private:
19
20 Int_t fPixId; // Pixel Nr
21 Int_t fTotalEntries; // Number of entries
22
23 TArrayF *fHiGains;
24 TArrayF *fLoGains;
25
26protected:
27
28 TH1F* fHChargeHiGain; // Summed FADC slices High Gain
29 TH1I* fHTimeHiGain; // Mean arrival time in number of FADC sice
30 TH1I* fHChargevsNHiGain; // Summed Charge vs. Event Nr.
31
32 TH1F* fHChargeLoGain; // Summed FADC slices Low Gain
33 TH1I* fHTimeLoGain; // Mean arrival time in number of FADC sice
34 TH1I* fHChargevsNLoGain; // Summed Charge vs. Event Nr.
35
36 TF1* fChargeGausFit;
37 TF1* fTimeGausFit;
38
39 TProfile* fHivsLoGain;
40
41 TPaveText *fFitLegend;
42
43 Axis_t fLowerFitRange;
44 Axis_t fChargeFirstHiGain;
45 Axis_t fChargeLastHiGain;
46 Int_t fChargeNbinsHiGain;
47
48 Axis_t fChargeFirstLoGain;
49 Axis_t fChargeLastLoGain;
50 Int_t fChargeNbinsLoGain;
51
52 Double_t fChargeChisquare;
53 Double_t fChargeProb;
54 Int_t fChargeNdf;
55
56 Double_t fChargeMean;
57 Double_t fChargeMeanErr;
58 Double_t fChargeSigma;
59 Double_t fChargeSigmaErr;
60
61 Double_t fTimeChisquare;
62 Double_t fTimeProb;
63 Int_t fTimeNdf;
64
65 Double_t fTimeMean;
66 Double_t fTimeSigma;
67
68 Byte_t fTimeLowerFitRangeHiGain;
69 Byte_t fTimeUpperFitRangeHiGain;
70 Byte_t fTimeLowerFitRangeLoGain;
71 Byte_t fTimeUpperFitRangeLoGain;
72
73 Bool_t fUseLoGain;
74 Bool_t fFitOK;
75
76 Double_t fOffset;
77 Double_t fSlope;
78
79 virtual void DrawLegend();
80
81public:
82
83 MHCalibrationPixel(const char *name=NULL, const char *title=NULL);
84 ~MHCalibrationPixel();
85
86 void ChangeHistId(Int_t i);
87
88 // Setters
89 void SetPointInGraph(Float_t qhi, Float_t qlo);
90 void SetUseLoGain(Bool_t b = kTRUE) { fUseLoGain = b; }
91
92 void SetTimeFitRangesHiGain(Byte_t low, Byte_t up) { fTimeLowerFitRangeHiGain = low,
93 fTimeUpperFitRangeHiGain = up ; }
94 void SetTimeFitRangesLoGain(Byte_t low, Byte_t up) { fTimeLowerFitRangeLoGain = low,
95 fTimeUpperFitRangeLoGain = up ; }
96
97 void SetLowerFitRange(Axis_t min) { fLowerFitRange = min; }
98
99 // Getters
100 const TH1F *GetHCharge() { return fHChargeHiGain; }
101 const TH1F *GetHCharge() const { return fHChargeHiGain; }
102
103 const Double_t GetChargeMean() const { return fChargeMean; }
104 const Double_t GetChargeMeanErr() const { return fChargeMeanErr; }
105 const Double_t GetChargeSigma() const { return fChargeSigma; }
106 const Double_t GetChargeSigmaErr() const { return fChargeSigmaErr; }
107 const Double_t GetArea() const;
108 const Double_t GetAreaErr() const;
109
110 const Double_t GetChargeChiSquare() const { return fChargeChisquare; }
111 const Double_t GetChargeProb() const { return fChargeProb; }
112 const Int_t GetChargeNdf() const { return fChargeNdf; }
113
114 const Double_t GetTimeMean() const { return fTimeMean; }
115 const Double_t GetTimeSigma() const { return fTimeSigma; }
116
117 const Byte_t GetTimeLowerFitRangeHiGain() const { return fTimeLowerFitRangeHiGain; }
118 const Byte_t GetTimeUpperFitRangeHiGain() const { return fTimeUpperFitRangeHiGain; }
119 const Byte_t GetTimeLowerFitRangeLoGain() const { return fTimeLowerFitRangeLoGain; }
120 const Byte_t GetTimeUpperFitRangeLoGain() const { return fTimeUpperFitRangeLoGain; }
121
122 const Double_t GetTimeChiSquare() const { return fTimeChisquare; }
123 const Double_t GetTimeProb() const { return fTimeProb; }
124 const Int_t GetTimeNdf() const { return fTimeNdf; }
125
126 const TH1I *GetHTime() { return fHTimeHiGain; }
127 const TH1I *GetHTime() const { return fHTimeHiGain; }
128
129 const TH1I *GetHChargevsN() { return fHChargevsNHiGain; }
130 const TH1I *GetHChargevsN() const { return fHChargevsNHiGain; }
131
132 Double_t GetOffset() { return fOffset; }
133 Double_t GetSlope() { return fSlope; }
134
135 Bool_t UseLoGain();
136
137 Bool_t IsFitOK() { return fFitOK; }
138 Bool_t IsEmpty();
139
140 // Fill histos
141 Bool_t FillChargeLoGain(Float_t q);
142 Bool_t FillTimeLoGain(Int_t t);
143 Bool_t FillChargevsNLoGain(Float_t q, Int_t n);
144
145 Bool_t FillChargeHiGain(Float_t q);
146 Bool_t FillTimeHiGain(Int_t t);
147 Bool_t FillChargevsNHiGain(Float_t q, Int_t n);
148
149 // Fits
150 Bool_t FitChargeHiGain(Option_t *option="RQ0");
151 Bool_t FitTimeHiGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
152
153 Bool_t FitChargeLoGain(Option_t *option="RQ0");
154 Bool_t FitTimeLoGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
155
156 void FitHiGainvsLoGain();
157
158 // Draws
159 virtual void Draw(Option_t *option="");
160
161 // Prints
162 void PrintChargeFitResult();
163 void PrintTimeFitResult();
164
165 // Others
166 virtual void CutAllEdges();
167 virtual void Reset();
168
169 ClassDef(MHCalibrationPixel, 1) // Histograms for each calibrated pixel
170};
171
172#endif
Note: See TracBrowser for help on using the repository browser.