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_TGraph
|
---|
21 | #include "TGraph.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 | TGraph *fHiGainvsLoGain; //! Plot the HiGain vs. the LoGain
|
---|
39 | Int_t fTotalEntries; // Number of entries
|
---|
40 |
|
---|
41 | TArrayF *fHiGains;
|
---|
42 | TArrayF *fLoGains;
|
---|
43 |
|
---|
44 | protected:
|
---|
45 |
|
---|
46 | TH1F* fHChargeHiGain; // Summed FADC slices High Gain
|
---|
47 | TH1I* fHTimeHiGain; // Mean arrival time in number of FADC sice
|
---|
48 | TH1I* fHChargevsNHiGain; // Summed Charge vs. Event Nr.
|
---|
49 |
|
---|
50 | TH1F* fHChargeLoGain; // Summed FADC slices Low Gain
|
---|
51 | TH1I* fHTimeLoGain; // Mean arrival time in number of FADC sice
|
---|
52 | TH1I* fHChargevsNLoGain; // Summed Charge vs. Event Nr.
|
---|
53 |
|
---|
54 | TF1* fChargeGausFit;
|
---|
55 | TF1* fTimeGausFit;
|
---|
56 |
|
---|
57 | TPaveText *fFitLegend;
|
---|
58 |
|
---|
59 | Axis_t fLowerFitRange;
|
---|
60 | Axis_t fChargeFirstHiGain;
|
---|
61 | Axis_t fChargeLastHiGain;
|
---|
62 | Int_t fChargeNbinsHiGain;
|
---|
63 |
|
---|
64 | Axis_t fChargeFirstLoGain;
|
---|
65 | Axis_t fChargeLastLoGain;
|
---|
66 | Int_t fChargeNbinsLoGain;
|
---|
67 |
|
---|
68 | Bool_t fFitOK;
|
---|
69 |
|
---|
70 | Double_t fChargeChisquare;
|
---|
71 | Double_t fChargeProb;
|
---|
72 | Int_t fChargeNdf;
|
---|
73 |
|
---|
74 | Double_t fChargeMean;
|
---|
75 | Double_t fChargeMeanErr;
|
---|
76 | Double_t fChargeSigma;
|
---|
77 | Double_t fChargeSigmaErr;
|
---|
78 |
|
---|
79 | Double_t fTimeChisquare;
|
---|
80 | Double_t fTimeProb;
|
---|
81 | Int_t fTimeNdf;
|
---|
82 |
|
---|
83 | Double_t fTimeMean;
|
---|
84 | Double_t fTimeSigma;
|
---|
85 |
|
---|
86 | Bool_t fUseLoGain;
|
---|
87 |
|
---|
88 | virtual void DrawLegend();
|
---|
89 |
|
---|
90 | public:
|
---|
91 |
|
---|
92 | MHCalibrationPixel(const char *name=NULL, const char *title=NULL);
|
---|
93 | ~MHCalibrationPixel();
|
---|
94 |
|
---|
95 | void ChangeHistId(Int_t i);
|
---|
96 |
|
---|
97 | Bool_t SetupFill(const MParList *pList);
|
---|
98 | Bool_t Fill(const MParContainer *, const Stat_t w=1) { return kTRUE; }
|
---|
99 |
|
---|
100 | void SetPointInGraph(Float_t qhi, Float_t qlo);
|
---|
101 |
|
---|
102 | Bool_t FillChargeLoGain(Float_t q) { return (fHChargeLoGain->Fill(q) > -1); }
|
---|
103 | Bool_t FillTimeLoGain(Int_t t) { return (fHTimeLoGain->Fill(t) > -1); }
|
---|
104 | Bool_t FillChargevsNLoGain(Float_t q, Int_t n) { return (fHChargevsNLoGain->Fill(n,q) > -1); }
|
---|
105 |
|
---|
106 | Bool_t FillChargeHiGain(Float_t q) { return (fHChargeHiGain->Fill(q) > -1); }
|
---|
107 | Bool_t FillTimeHiGain(Int_t t) { return (fHTimeHiGain->Fill(t) > -1); }
|
---|
108 | Bool_t FillChargevsNHiGain(Float_t q, Int_t n) { return (fHChargevsNHiGain->Fill(n,q) > -1); }
|
---|
109 |
|
---|
110 | void SetUseLoGain() { fUseLoGain = kTRUE; }
|
---|
111 | Bool_t UseLoGain();
|
---|
112 |
|
---|
113 | const TH1F *GetHCharge() { return fHChargeHiGain; }
|
---|
114 | const TH1F *GetHCharge() const { return fHChargeHiGain; }
|
---|
115 |
|
---|
116 | const Double_t GetChargeMean() const { return fChargeMean; }
|
---|
117 | const Double_t GetChargeMeanErr() const { return fChargeMeanErr; }
|
---|
118 | const Double_t GetChargeSigma() const { return fChargeSigma; }
|
---|
119 | const Double_t GetChargeSigmaErr() const { return fChargeSigmaErr; }
|
---|
120 | const Double_t GetArea() const { return fChargeGausFit->GetParameter(0); }
|
---|
121 | const Double_t GetAreaErr() const { return fChargeGausFit->GetParError(0); }
|
---|
122 |
|
---|
123 | const Double_t GetChargeChiSquare() const { return fChargeChisquare; }
|
---|
124 | const Double_t GetChargeProb() const { return fChargeProb; }
|
---|
125 | const Int_t GetChargeNdf() const { return fChargeNdf; }
|
---|
126 |
|
---|
127 | const Double_t GetTimeMean() const { return fTimeMean; }
|
---|
128 | const Double_t GetTimeSigma() const { return fTimeSigma; }
|
---|
129 |
|
---|
130 | const Double_t GetTimeChiSquare() const { return fTimeChisquare; }
|
---|
131 | const Double_t GetTimeProb() const { return fTimeProb; }
|
---|
132 | const Int_t GetTimeNdf() const { return fTimeNdf; }
|
---|
133 |
|
---|
134 | const TH1I *GetHTime() { return fHTimeHiGain; }
|
---|
135 | const TH1I *GetHTime() const { return fHTimeHiGain; }
|
---|
136 |
|
---|
137 | const TH1I *GetHChargevsN() { return fHChargevsNHiGain; }
|
---|
138 | const TH1I *GetHChargevsN() const { return fHChargevsNHiGain; }
|
---|
139 |
|
---|
140 | Bool_t FitChargeHiGain(Option_t *option="RQ0");
|
---|
141 | Bool_t FitTimeHiGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
|
---|
142 |
|
---|
143 | Bool_t FitChargeLoGain(Option_t *option="RQ0");
|
---|
144 | Bool_t FitTimeLoGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
|
---|
145 |
|
---|
146 | virtual void Draw(Option_t *option="");
|
---|
147 | virtual void CutAllEdges();
|
---|
148 | virtual void Reset();
|
---|
149 |
|
---|
150 | void SetLowerFitRange(Axis_t min) { fLowerFitRange = min; }
|
---|
151 |
|
---|
152 | void PrintChargeFitResult();
|
---|
153 | void PrintTimeFitResult();
|
---|
154 |
|
---|
155 | Bool_t IsFitOK() { return fFitOK; }
|
---|
156 |
|
---|
157 | ClassDef(MHCalibrationPixel, 1)
|
---|
158 | };
|
---|
159 |
|
---|
160 | #endif
|
---|