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

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