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 |
|
---|
28 | class TPaveText;
|
---|
29 | class TMath;
|
---|
30 | class MParList;
|
---|
31 |
|
---|
32 | class MHCalibrationPixel : public MH
|
---|
33 | {
|
---|
34 |
|
---|
35 | private:
|
---|
36 |
|
---|
37 | Int_t fPixId; // Pixel Nr
|
---|
38 | Int_t fTotalEntries; // Number of entries
|
---|
39 |
|
---|
40 | TArrayF *fHiGains;
|
---|
41 | TArrayF *fLoGains;
|
---|
42 |
|
---|
43 | protected:
|
---|
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 | Stat_t fTimeLowerFitRange;
|
---|
88 | Stat_t fTimeUpperFitRange;
|
---|
89 |
|
---|
90 | Bool_t fUseLoGain;
|
---|
91 |
|
---|
92 | Double_t fOffset;
|
---|
93 | Double_t fSlope;
|
---|
94 |
|
---|
95 | virtual void DrawLegend();
|
---|
96 |
|
---|
97 | public:
|
---|
98 |
|
---|
99 | MHCalibrationPixel(const char *name=NULL, const char *title=NULL);
|
---|
100 | ~MHCalibrationPixel();
|
---|
101 |
|
---|
102 | void ChangeHistId(Int_t i);
|
---|
103 |
|
---|
104 | Bool_t SetupFill(const MParList *pList);
|
---|
105 | Bool_t Fill(const MParContainer *, const Stat_t w=1) { return kTRUE; }
|
---|
106 |
|
---|
107 | void SetPointInGraph(Float_t qhi, Float_t qlo);
|
---|
108 | void FitHiGainvsLoGain();
|
---|
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 | const TH1F *GetHCharge() { return fHChargeHiGain; }
|
---|
122 | const TH1F *GetHCharge() const { return fHChargeHiGain; }
|
---|
123 |
|
---|
124 | const Double_t GetChargeMean() const { return fChargeMean; }
|
---|
125 | const Double_t GetChargeMeanErr() const { return fChargeMeanErr; }
|
---|
126 | const Double_t GetChargeSigma() const { return fChargeSigma; }
|
---|
127 | const Double_t GetChargeSigmaErr() const { return fChargeSigmaErr; }
|
---|
128 | const Double_t GetArea() const { return fChargeGausFit->GetParameter(0); }
|
---|
129 | const Double_t GetAreaErr() const { return fChargeGausFit->GetParError(0); }
|
---|
130 |
|
---|
131 | const Double_t GetChargeChiSquare() const { return fChargeChisquare; }
|
---|
132 | const Double_t GetChargeProb() const { return fChargeProb; }
|
---|
133 | const Int_t GetChargeNdf() const { return fChargeNdf; }
|
---|
134 |
|
---|
135 | const Double_t GetTimeMean() const { return fTimeMean; }
|
---|
136 | const Double_t GetTimeSigma() const { return fTimeSigma; }
|
---|
137 |
|
---|
138 | const Stat_t GetTimeLowerFitRange() const { return fTimeLowerFitRange; }
|
---|
139 | const Stat_t GetTimeUpperFitRange() const { return fTimeUpperFitRange; }
|
---|
140 |
|
---|
141 | const Double_t GetTimeChiSquare() const { return fTimeChisquare; }
|
---|
142 | const Double_t GetTimeProb() const { return fTimeProb; }
|
---|
143 | const Int_t GetTimeNdf() const { return fTimeNdf; }
|
---|
144 |
|
---|
145 | const TH1I *GetHTime() { return fHTimeHiGain; }
|
---|
146 | const TH1I *GetHTime() const { return fHTimeHiGain; }
|
---|
147 |
|
---|
148 | const TH1I *GetHChargevsN() { return fHChargevsNHiGain; }
|
---|
149 | const TH1I *GetHChargevsN() const { return fHChargevsNHiGain; }
|
---|
150 |
|
---|
151 | Double_t GetOffset() { return fOffset; }
|
---|
152 | Double_t GetSlope() { return fSlope; }
|
---|
153 |
|
---|
154 | Bool_t FitChargeHiGain(Option_t *option="RQ0");
|
---|
155 | Bool_t FitTimeHiGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
|
---|
156 |
|
---|
157 | Bool_t FitChargeLoGain(Option_t *option="RQ0");
|
---|
158 | Bool_t FitTimeLoGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
|
---|
159 |
|
---|
160 | virtual void Draw(Option_t *option="");
|
---|
161 | virtual void CutAllEdges();
|
---|
162 | virtual void Reset();
|
---|
163 |
|
---|
164 | void SetLowerFitRange(Axis_t min) { fLowerFitRange = min; }
|
---|
165 |
|
---|
166 | void PrintChargeFitResult();
|
---|
167 | void PrintTimeFitResult();
|
---|
168 |
|
---|
169 | Bool_t IsFitOK() { return fFitOK; }
|
---|
170 |
|
---|
171 | ClassDef(MHCalibrationPixel, 1)
|
---|
172 | };
|
---|
173 |
|
---|
174 | #endif
|
---|