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

Last change on this file since 3011 was 3007, 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 MARS_MH
5#include "MH.h"
6#endif
7
8class TArrayF;
9class TH1F;
10class TH1I;
11class TF1;
12class TProfile;
13class TPaveText;
14
15class MHCalibrationPixel : public MH
16{
17
18private:
19
20 static const Int_t fChargeNbinsHiGain;
21 static const Int_t fChargeNbinsLoGain;
22 static const Int_t fAbsTimeNbins;
23 static const Int_t fRelTimeNbins;
24 static const Int_t fChargevsNbins;
25 static const Axis_t fAbsTimeFirst;
26 static const Axis_t fAbsTimeLast;
27 static const Axis_t fRelTimeFirst;
28 static const Axis_t fRelTimeLast;
29
30 Int_t fPixId; // Pixel Nr
31
32 TArrayF *fHiGains; //->
33 TArrayF *fLoGains; //->
34
35 TProfile* fHivsLoGain;
36
37 Double_t fOffset;
38 Double_t fSlope;
39
40protected:
41
42 TH1F* fHChargeHiGain; //-> Summed FADC slices High Gain
43 TH1F* fHAbsTimeHiGain; //-> Mean arrival time in number of FADC sice
44 TH1F* fHRelTimeHiGain; //-> Mean arrival time in number of FADC sice
45 TH1I* fHChargevsNHiGain; //-> Summed Charge vs. Event Nr.
46
47 TH1F* fHChargeLoGain; //-> Summed FADC slices Low Gain
48 TH1F* fHAbsTimeLoGain; //-> Mean arrival time in number of FADC sice
49 TH1F* fHRelTimeLoGain; //-> Mean arrival time in number of FADC sice
50 TH1I* fHChargevsNLoGain; //-> Summed Charge vs. Event Nr.
51
52 TH1F* fHPSD; // Power spectrum density of fHBlindPixelChargevsN
53
54 TF1* fChargeGausFit;
55 TF1* fRelTimeGausFit;
56
57 TPaveText *fFitLegend;
58
59 Int_t fTotalEntries; // Number of entries
60
61 Axis_t fChargeFirstHiGain;
62 Axis_t fChargeLastHiGain;
63 Axis_t fChargeFirstLoGain;
64 Axis_t fChargeLastLoGain;
65
66 Double_t fChargeChisquare;
67 Double_t fChargeProb;
68 Int_t fChargeNdf;
69
70 Double_t fChargeMean;
71 Double_t fChargeMeanErr;
72 Double_t fChargeSigma;
73 Double_t fChargeSigmaErr;
74
75 Double_t fRelTimeChisquare;
76 Double_t fRelTimeProb;
77 Int_t fRelTimeNdf;
78 Double_t fRelTimeMean;
79 Double_t fRelTimeMeanErr;
80 Double_t fRelTimeSigma;
81
82 Float_t fRelTimeLowerFitRangeHiGain;
83 Float_t fRelTimeUpperFitRangeHiGain;
84 Float_t fRelTimeLowerFitRangeLoGain;
85 Float_t fRelTimeUpperFitRangeLoGain;
86
87 Float_t fAbsTimeFirstHiGain;
88 Float_t fAbsTimeFirstLoGain;
89 Float_t fAbsTimeLastHiGain;
90 Float_t fAbsTimeLastLoGain;
91
92 Byte_t fFlags;
93
94 enum { kUseLoGain, kChargeFitOK, kTimeFitOK };
95
96 virtual void DrawLegend();
97
98public:
99
100 MHCalibrationPixel(const char *name=NULL, const char *title=NULL);
101 ~MHCalibrationPixel();
102
103 void Clear(Option_t *o="");
104 void Reset();
105
106 void ChangeHistId(Int_t i);
107
108 // Setters
109 void SetUseLoGain(Bool_t b = kTRUE);
110
111 // Getters
112 const Double_t GetChargeMean() const { return fChargeMean; }
113 const Double_t GetChargeMeanErr() const { return fChargeMeanErr; }
114 const Double_t GetChargeSigma() const { return fChargeSigma; }
115 const Double_t GetChargeSigmaErr() const { return fChargeSigmaErr; }
116 const Double_t GetChargeChiSquare() const { return fChargeChisquare; }
117 const Double_t GetChargeProb() const { return fChargeProb; }
118 const Int_t GetChargeNdf() const { return fChargeNdf; }
119
120 const Float_t GetAbsTimeFirstHiGain() const { return fAbsTimeFirstHiGain; }
121 const Float_t GetAbsTimeFirstLoGain() const { return fAbsTimeFirstLoGain; }
122 const Float_t GetAbsTimeLastHiGain() const { return fAbsTimeLastHiGain; }
123 const Float_t GetAbsTimeLastLoGain() const { return fAbsTimeLastLoGain; }
124
125 const Double_t GetRelTimeMean() const { return fRelTimeMean; }
126 const Double_t GetRelTimeMeanErr() const { return fRelTimeMeanErr; }
127 const Double_t GetRelTimeSigma() const { return fRelTimeSigma; }
128 const Double_t GetRelTimeChiSquare() const { return fRelTimeChisquare;}
129 const Double_t GetRelTimeProb() const { return fRelTimeProb; }
130 const Int_t GetRelTimeNdf() const { return fRelTimeNdf; }
131
132 const TH1F *GetHCharge() { return fHChargeHiGain; }
133 const TH1F *GetHCharge() const { return fHChargeHiGain; }
134
135 const TH1F *GetHAbsTime() { return fHAbsTimeHiGain; }
136 const TH1F *GetHAbsTime() const { return fHAbsTimeHiGain; }
137
138 const TH1F *GetHRelTime() { return fHRelTimeHiGain; }
139 const TH1F *GetHRelTime() const { return fHRelTimeHiGain; }
140
141 const TH1I *GetHChargevsN() { return fHChargevsNHiGain;}
142 const TH1I *GetHChargevsN() const { return fHChargevsNHiGain;}
143
144 Double_t GetOffset() const { return fOffset; }
145 Double_t GetSlope() const { return fSlope; }
146
147 Bool_t UseLoGain();
148
149 Bool_t IsChargeFitOK() const;
150 Bool_t IsTimeFitOK() const;
151 Bool_t IsUseLoGain() const;
152 Bool_t IsEmpty() const;
153
154 // Fill histos
155 Bool_t FillChargeLoGain(Float_t q);
156 Bool_t FillAbsTimeLoGain(Float_t t);
157 Bool_t FillRelTimeLoGain(Float_t t);
158 Bool_t FillChargevsNLoGain(Float_t q, Int_t n);
159
160 Bool_t FillChargeHiGain(Float_t q);
161 Bool_t FillAbsTimeHiGain(Float_t t);
162 Bool_t FillRelTimeHiGain(Float_t t);
163 Bool_t FillChargevsNHiGain(Float_t q, Int_t n);
164
165 Bool_t FillPointInGraph(Float_t qhi, Float_t qlo);
166
167 Bool_t SetupFill(const MParList *pList);
168 Bool_t Fill(const MParContainer *, const Stat_t w=1) { return kTRUE; }
169
170 // Fits
171 Bool_t FitCharge(Option_t *option="RQ0");
172 Bool_t FitTime(Option_t *option="RQ0");
173
174 void FitHiGainvsLoGain();
175
176 // Draws
177 virtual void Draw(Option_t *option="");
178 TObject *DrawClone(Option_t *option="") const;
179
180 // Prints
181 void PrintChargeFitResult();
182 void PrintTimeFitResult();
183
184 // Others
185 virtual void CutAllEdges();
186
187 ClassDef(MHCalibrationPixel, 1) // Histograms for each calibrated pixel
188};
189
190#endif
Note: See TracBrowser for help on using the repository browser.