1 | #ifndef MARS_MHCalibrationPixel
|
---|
2 | #define MARS_MHCalibrationPixel
|
---|
3 |
|
---|
4 | #ifndef MARS_MH
|
---|
5 | #include "MH.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class TArrayF;
|
---|
9 | class TH1F;
|
---|
10 | class TH1I;
|
---|
11 | class TF1;
|
---|
12 | class TProfile;
|
---|
13 | class TPaveText;
|
---|
14 |
|
---|
15 | class MHCalibrationPixel : public MH
|
---|
16 | {
|
---|
17 |
|
---|
18 | private:
|
---|
19 |
|
---|
20 | Int_t fPixId; // Pixel Nr
|
---|
21 | Int_t fTotalEntries; // Number of entries
|
---|
22 |
|
---|
23 | TArrayF *fHiGains; //->
|
---|
24 | TArrayF *fLoGains; //->
|
---|
25 |
|
---|
26 | protected:
|
---|
27 |
|
---|
28 | TH1F* fHChargeHiGain; // Summed FADC slices High Gain
|
---|
29 | TH1F* 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 | TH1F* 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 fChargeFirstHiGain;
|
---|
44 | Axis_t fChargeLastHiGain;
|
---|
45 | Int_t fChargeNbinsHiGain;
|
---|
46 |
|
---|
47 | Axis_t fChargeFirstLoGain;
|
---|
48 | Axis_t fChargeLastLoGain;
|
---|
49 | Int_t fChargeNbinsLoGain;
|
---|
50 |
|
---|
51 | Double_t fChargeChisquare;
|
---|
52 | Double_t fChargeProb;
|
---|
53 | Int_t fChargeNdf;
|
---|
54 |
|
---|
55 | Double_t fChargeMean;
|
---|
56 | Double_t fChargeMeanErr;
|
---|
57 | Double_t fChargeSigma;
|
---|
58 | Double_t fChargeSigmaErr;
|
---|
59 |
|
---|
60 | Double_t fTimeChisquare;
|
---|
61 | Double_t fTimeProb;
|
---|
62 | Int_t fTimeNdf;
|
---|
63 |
|
---|
64 | Double_t fTimeMean;
|
---|
65 | Double_t fTimeSigma;
|
---|
66 |
|
---|
67 | Byte_t fTimeLowerFitRangeHiGain;
|
---|
68 | Byte_t fTimeUpperFitRangeHiGain;
|
---|
69 | Byte_t fTimeLowerFitRangeLoGain;
|
---|
70 | Byte_t fTimeUpperFitRangeLoGain;
|
---|
71 |
|
---|
72 | Byte_t fFlags;
|
---|
73 |
|
---|
74 | enum { kUseLoGain, kFitOK };
|
---|
75 |
|
---|
76 | Double_t fOffset;
|
---|
77 | Double_t fSlope;
|
---|
78 |
|
---|
79 | virtual void DrawLegend();
|
---|
80 |
|
---|
81 | public:
|
---|
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 SetUseLoGain(Bool_t b = kTRUE)
|
---|
90 | { b ? SETBIT(fFlags, kUseLoGain) : SETBIT(fFlags, kUseLoGain); }
|
---|
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 | // Getters
|
---|
98 | const TH1F *GetHCharge() { return fHChargeHiGain; }
|
---|
99 | const TH1F *GetHCharge() const { return fHChargeHiGain; }
|
---|
100 |
|
---|
101 | const Double_t GetChargeMean() const { return fChargeMean; }
|
---|
102 | const Double_t GetChargeMeanErr() const { return fChargeMeanErr; }
|
---|
103 | const Double_t GetChargeSigma() const { return fChargeSigma; }
|
---|
104 | const Double_t GetChargeSigmaErr() const { return fChargeSigmaErr; }
|
---|
105 | const Double_t GetChargeChiSquare() const { return fChargeChisquare; }
|
---|
106 | const Double_t GetChargeProb() const { return fChargeProb; }
|
---|
107 | const Int_t GetChargeNdf() const { return fChargeNdf; }
|
---|
108 |
|
---|
109 | const Double_t GetTimeMean() const { return fTimeMean; }
|
---|
110 | const Double_t GetTimeSigma() const { return fTimeSigma; }
|
---|
111 |
|
---|
112 | const Byte_t GetTimeLowerFitRangeHiGain() const { return fTimeLowerFitRangeHiGain; }
|
---|
113 | const Byte_t GetTimeUpperFitRangeHiGain() const { return fTimeUpperFitRangeHiGain; }
|
---|
114 | const Byte_t GetTimeLowerFitRangeLoGain() const { return fTimeLowerFitRangeLoGain; }
|
---|
115 | const Byte_t GetTimeUpperFitRangeLoGain() const { return fTimeUpperFitRangeLoGain; }
|
---|
116 |
|
---|
117 | const Double_t GetTimeChiSquare() const { return fTimeChisquare; }
|
---|
118 | const Double_t GetTimeProb() const { return fTimeProb; }
|
---|
119 | const Int_t GetTimeNdf() const { return fTimeNdf; }
|
---|
120 |
|
---|
121 | const TH1F *GetHTime() { return fHTimeHiGain; }
|
---|
122 | const TH1F *GetHTime() const { return fHTimeHiGain; }
|
---|
123 |
|
---|
124 | const TH1I *GetHChargevsN() { return fHChargevsNHiGain; }
|
---|
125 | const TH1I *GetHChargevsN() const { return fHChargevsNHiGain; }
|
---|
126 |
|
---|
127 | Double_t GetOffset() { return fOffset; }
|
---|
128 | Double_t GetSlope() { return fSlope; }
|
---|
129 |
|
---|
130 | Bool_t UseLoGain();
|
---|
131 |
|
---|
132 | Bool_t IsFitOK() const;
|
---|
133 | Bool_t IsUseLoGain() const;
|
---|
134 | Bool_t IsEmpty() const;
|
---|
135 |
|
---|
136 | // Fill histos
|
---|
137 | Bool_t FillChargeLoGain(Float_t q);
|
---|
138 | Bool_t FillTimeLoGain(Float_t t);
|
---|
139 | Bool_t FillChargevsNLoGain(Float_t q, Int_t n);
|
---|
140 |
|
---|
141 | Bool_t FillChargeHiGain(Float_t q);
|
---|
142 | Bool_t FillTimeHiGain(Float_t t);
|
---|
143 | Bool_t FillChargevsNHiGain(Float_t q, Int_t n);
|
---|
144 |
|
---|
145 | Bool_t FillPointInGraph(Float_t qhi, Float_t qlo);
|
---|
146 |
|
---|
147 | Bool_t SetupFill(const MParList *pList);
|
---|
148 | Bool_t Fill(const MParContainer *, const Stat_t w=1) { return kTRUE; }
|
---|
149 |
|
---|
150 | // Fits
|
---|
151 | Bool_t FitCharge(Option_t *option="RQ0");
|
---|
152 |
|
---|
153 | Bool_t FitTimeHiGain(Axis_t rmin=0, Axis_t rmax=0, 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 | TObject *DrawClone(Option_t *option="") const;
|
---|
161 |
|
---|
162 | // Prints
|
---|
163 | void PrintChargeFitResult();
|
---|
164 | void PrintTimeFitResult();
|
---|
165 |
|
---|
166 | // Others
|
---|
167 | virtual void CutAllEdges();
|
---|
168 | virtual void Reset();
|
---|
169 |
|
---|
170 | ClassDef(MHCalibrationPixel, 1) // Histograms for each calibrated pixel
|
---|
171 | };
|
---|
172 |
|
---|
173 | #endif
|
---|