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

Last change on this file since 2844 was 2792, checked in by gaug, 21 years ago
*** empty log message ***
File size: 5.8 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 Double_t fChargeChisquare;
70 Double_t fChargeProb;
71 Int_t fChargeNdf;
72
73 Double_t fChargeMean;
74 Double_t fChargeMeanErr;
75 Double_t fChargeSigma;
76 Double_t fChargeSigmaErr;
77
78 Double_t fTimeChisquare;
79 Double_t fTimeProb;
80 Int_t fTimeNdf;
81
82 Double_t fTimeMean;
83 Double_t fTimeSigma;
84
85 Byte_t fTimeLowerFitRangeHiGain;
86 Byte_t fTimeUpperFitRangeHiGain;
87 Byte_t fTimeLowerFitRangeLoGain;
88 Byte_t fTimeUpperFitRangeLoGain;
89
90 Bool_t fUseLoGain;
91 Bool_t fFitOK;
92
93 Double_t fOffset;
94 Double_t fSlope;
95
96 virtual void DrawLegend();
97
98public:
99
100 MHCalibrationPixel(const char *name=NULL, const char *title=NULL);
101 ~MHCalibrationPixel();
102
103 void ChangeHistId(Int_t i);
104
105 Bool_t SetupFill(const MParList *pList);
106 Bool_t Fill(const MParContainer *, const Stat_t w=1) { return kTRUE; }
107
108 void SetPointInGraph(Float_t qhi, Float_t qlo);
109
110 Bool_t FillChargeLoGain(Float_t q) { return (fHChargeLoGain->Fill(q) > -1); }
111 Bool_t FillTimeLoGain(Int_t t) { return (fHTimeLoGain->Fill(t) > -1); }
112 Bool_t FillChargevsNLoGain(Float_t q, Int_t n) { return (fHChargevsNLoGain->Fill(n,q) > -1); }
113
114 Bool_t FillChargeHiGain(Float_t q) { return (fHChargeHiGain->Fill(q) > -1); }
115 Bool_t FillTimeHiGain(Int_t t) { return (fHTimeHiGain->Fill(t) > -1); }
116 Bool_t FillChargevsNHiGain(Float_t q, Int_t n) { return (fHChargevsNHiGain->Fill(n,q) > -1); }
117
118 void SetUseLoGain() { fUseLoGain = kTRUE; }
119 Bool_t UseLoGain();
120
121 void SetTimeFitRangesHiGain(Byte_t low, Byte_t up) { fTimeLowerFitRangeHiGain = low,
122 fTimeUpperFitRangeHiGain = up ; }
123 void SetTimeFitRangesLoGain(Byte_t low, Byte_t up) { fTimeLowerFitRangeLoGain = low,
124 fTimeUpperFitRangeLoGain = up ; }
125
126 const TH1F *GetHCharge() { return fHChargeHiGain; }
127 const TH1F *GetHCharge() const { return fHChargeHiGain; }
128
129 const Double_t GetChargeMean() const { return fChargeMean; }
130 const Double_t GetChargeMeanErr() const { return fChargeMeanErr; }
131 const Double_t GetChargeSigma() const { return fChargeSigma; }
132 const Double_t GetChargeSigmaErr() const { return fChargeSigmaErr; }
133 const Double_t GetArea() const { return fChargeGausFit->GetParameter(0); }
134 const Double_t GetAreaErr() const { return fChargeGausFit->GetParError(0); }
135
136 const Double_t GetChargeChiSquare() const { return fChargeChisquare; }
137 const Double_t GetChargeProb() const { return fChargeProb; }
138 const Int_t GetChargeNdf() const { return fChargeNdf; }
139
140 const Double_t GetTimeMean() const { return fTimeMean; }
141 const Double_t GetTimeSigma() const { return fTimeSigma; }
142
143 const Byte_t GetTimeLowerFitRangeHiGain() const { return fTimeLowerFitRangeHiGain; }
144 const Byte_t GetTimeUpperFitRangeHiGain() const { return fTimeUpperFitRangeHiGain; }
145 const Byte_t GetTimeLowerFitRangeLoGain() const { return fTimeLowerFitRangeLoGain; }
146 const Byte_t GetTimeUpperFitRangeLoGain() const { return fTimeUpperFitRangeLoGain; }
147
148 const Double_t GetTimeChiSquare() const { return fTimeChisquare; }
149 const Double_t GetTimeProb() const { return fTimeProb; }
150 const Int_t GetTimeNdf() const { return fTimeNdf; }
151
152 const TH1I *GetHTime() { return fHTimeHiGain; }
153 const TH1I *GetHTime() const { return fHTimeHiGain; }
154
155 const TH1I *GetHChargevsN() { return fHChargevsNHiGain; }
156 const TH1I *GetHChargevsN() const { return fHChargevsNHiGain; }
157
158 Double_t GetOffset() { return fOffset; }
159 Double_t GetSlope() { return fSlope; }
160
161 Bool_t FitChargeHiGain(Option_t *option="RQ0");
162 Bool_t FitTimeHiGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
163
164 Bool_t FitChargeLoGain(Option_t *option="RQ0");
165 Bool_t FitTimeLoGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
166
167 void FitHiGainvsLoGain();
168
169 virtual void Draw(Option_t *option="");
170 virtual void CutAllEdges();
171 virtual void Reset();
172
173 void SetLowerFitRange(Axis_t min) { fLowerFitRange = min; }
174
175 void PrintChargeFitResult();
176 void PrintTimeFitResult();
177
178 Bool_t IsFitOK() { return fFitOK; }
179 Bool_t IsEmpty() { return !( (fHChargeHiGain->GetEntries())
180 || (fHChargeLoGain->GetEntries()) ); }
181
182 ClassDef(MHCalibrationPixel, 1)
183};
184
185#endif
Note: See TracBrowser for help on using the repository browser.