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

Last change on this file since 2855 was 2852, 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 // Setters
106 void SetPointInGraph(Float_t qhi, Float_t qlo);
107 void SetUseLoGain(Bool_t b = kTRUE) { fUseLoGain = b; }
108
109 void SetTimeFitRangesHiGain(Byte_t low, Byte_t up) { fTimeLowerFitRangeHiGain = low,
110 fTimeUpperFitRangeHiGain = up ; }
111 void SetTimeFitRangesLoGain(Byte_t low, Byte_t up) { fTimeLowerFitRangeLoGain = low,
112 fTimeUpperFitRangeLoGain = up ; }
113
114 void SetLowerFitRange(Axis_t min) { fLowerFitRange = min; }
115
116 // Getters
117 const TH1F *GetHCharge() { return fHChargeHiGain; }
118 const TH1F *GetHCharge() const { return fHChargeHiGain; }
119
120 const Double_t GetChargeMean() const { return fChargeMean; }
121 const Double_t GetChargeMeanErr() const { return fChargeMeanErr; }
122 const Double_t GetChargeSigma() const { return fChargeSigma; }
123 const Double_t GetChargeSigmaErr() const { return fChargeSigmaErr; }
124 const Double_t GetArea() const { return fChargeGausFit->GetParameter(0); }
125 const Double_t GetAreaErr() const { return fChargeGausFit->GetParError(0); }
126
127 const Double_t GetChargeChiSquare() const { return fChargeChisquare; }
128 const Double_t GetChargeProb() const { return fChargeProb; }
129 const Int_t GetChargeNdf() const { return fChargeNdf; }
130
131 const Double_t GetTimeMean() const { return fTimeMean; }
132 const Double_t GetTimeSigma() const { return fTimeSigma; }
133
134 const Byte_t GetTimeLowerFitRangeHiGain() const { return fTimeLowerFitRangeHiGain; }
135 const Byte_t GetTimeUpperFitRangeHiGain() const { return fTimeUpperFitRangeHiGain; }
136 const Byte_t GetTimeLowerFitRangeLoGain() const { return fTimeLowerFitRangeLoGain; }
137 const Byte_t GetTimeUpperFitRangeLoGain() const { return fTimeUpperFitRangeLoGain; }
138
139 const Double_t GetTimeChiSquare() const { return fTimeChisquare; }
140 const Double_t GetTimeProb() const { return fTimeProb; }
141 const Int_t GetTimeNdf() const { return fTimeNdf; }
142
143 const TH1I *GetHTime() { return fHTimeHiGain; }
144 const TH1I *GetHTime() const { return fHTimeHiGain; }
145
146 const TH1I *GetHChargevsN() { return fHChargevsNHiGain; }
147 const TH1I *GetHChargevsN() const { return fHChargevsNHiGain; }
148
149 Double_t GetOffset() { return fOffset; }
150 Double_t GetSlope() { return fSlope; }
151
152 Bool_t UseLoGain();
153
154 Bool_t IsFitOK() { return fFitOK; }
155 Bool_t IsEmpty() { return !( (fHChargeHiGain->GetEntries())
156 || (fHChargeLoGain->GetEntries()) ); }
157
158 // Fill histos
159 Bool_t FillChargeLoGain(Float_t q) { return (fHChargeLoGain->Fill(q) > -1); }
160 Bool_t FillTimeLoGain(Int_t t) { return (fHTimeLoGain->Fill(t) > -1); }
161 Bool_t FillChargevsNLoGain(Float_t q, Int_t n) { return (fHChargevsNLoGain->Fill(n,q) > -1); }
162
163 Bool_t FillChargeHiGain(Float_t q) { return (fHChargeHiGain->Fill(q) > -1); }
164 Bool_t FillTimeHiGain(Int_t t) { return (fHTimeHiGain->Fill(t) > -1); }
165 Bool_t FillChargevsNHiGain(Float_t q, Int_t n) { return (fHChargevsNHiGain->Fill(n,q) > -1); }
166
167 // Fits
168 Bool_t FitChargeHiGain(Option_t *option="RQ0");
169 Bool_t FitTimeHiGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
170
171 Bool_t FitChargeLoGain(Option_t *option="RQ0");
172 Bool_t FitTimeLoGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
173
174 void FitHiGainvsLoGain();
175
176 // Draws
177 virtual void Draw(Option_t *option="");
178
179 // Prints
180 void PrintChargeFitResult();
181 void PrintTimeFitResult();
182
183 // Others
184 virtual void CutAllEdges();
185 virtual void Reset();
186
187 ClassDef(MHCalibrationPixel, 1) // Histograms for each calibrated pixel
188};
189
190#endif
Note: See TracBrowser for help on using the repository browser.