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

Last change on this file since 2945 was 2941, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 5.3 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 Int_t fPixId; // Pixel Nr
21
22 TArrayF *fHiGains; //->
23 TArrayF *fLoGains; //->
24
25 const Int_t fChargeNbinsHiGain;
26 const Int_t fChargeNbinsLoGain;
27 const Int_t fTimeNbins;
28 const Int_t fChargevsNbins;
29
30 const Axis_t fTimeFirst;
31 const Axis_t fTimeLast;
32
33 TProfile* fHivsLoGain;
34
35 Double_t fOffset;
36 Double_t fSlope;
37
38protected:
39
40 TH1F* fHChargeHiGain; //-> Summed FADC slices High Gain
41 TH1F* fHTimeHiGain; //-> Mean arrival time in number of FADC sice
42 TH1I* fHChargevsNHiGain; //-> Summed Charge vs. Event Nr.
43
44 TH1F* fHChargeLoGain; //-> Summed FADC slices Low Gain
45 TH1F* fHTimeLoGain; //-> Mean arrival time in number of FADC sice
46 TH1I* fHChargevsNLoGain; //-> Summed Charge vs. Event Nr.
47
48 TH1F* fHPSD; // Power spectrum density of fHBlindPixelChargevsN
49
50 TF1* fChargeGausFit;
51 TF1* fTimeGausFit;
52
53 TPaveText *fFitLegend;
54
55 Int_t fTotalEntries; // Number of entries
56
57 Axis_t fChargeFirstHiGain;
58 Axis_t fChargeLastHiGain;
59 Axis_t fChargeFirstLoGain;
60 Axis_t fChargeLastLoGain;
61
62 Double_t fChargeChisquare;
63 Double_t fChargeProb;
64 Int_t fChargeNdf;
65
66 Double_t fChargeMean;
67 Double_t fChargeMeanErr;
68 Double_t fChargeSigma;
69 Double_t fChargeSigmaErr;
70
71 Double_t fTimeChisquare;
72 Double_t fTimeProb;
73 Int_t fTimeNdf;
74
75 Double_t fTimeMean;
76 Double_t fTimeSigma;
77
78 Byte_t fTimeLowerFitRangeHiGain;
79 Byte_t fTimeUpperFitRangeHiGain;
80 Byte_t fTimeLowerFitRangeLoGain;
81 Byte_t fTimeUpperFitRangeLoGain;
82
83 Byte_t fFlags;
84
85 enum { kUseLoGain, kFitOK };
86
87 virtual void DrawLegend();
88
89public:
90
91 MHCalibrationPixel(const char *name=NULL, const char *title=NULL);
92 ~MHCalibrationPixel();
93
94 void Clear(Option_t *o="");
95 void Reset();
96
97 void ChangeHistId(Int_t i);
98
99 // Setters
100 void SetUseLoGain(Bool_t b = kTRUE)
101 { b ? SETBIT(fFlags, kUseLoGain) : SETBIT(fFlags, kUseLoGain); }
102
103 void SetTimeFitRangesHiGain(Byte_t low, Byte_t up) { fTimeLowerFitRangeHiGain = low,
104 fTimeUpperFitRangeHiGain = up ; }
105 void SetTimeFitRangesLoGain(Byte_t low, Byte_t up) { fTimeLowerFitRangeLoGain = low,
106 fTimeUpperFitRangeLoGain = up ; }
107
108 // Getters
109 const TH1F *GetHCharge() const { return fHChargeHiGain; }
110
111 const Double_t GetChargeMean() const { return fChargeMean; }
112 const Double_t GetChargeMeanErr() const { return fChargeMeanErr; }
113 const Double_t GetChargeSigma() const { return fChargeSigma; }
114 const Double_t GetChargeSigmaErr() const { return fChargeSigmaErr; }
115 const Double_t GetChargeChiSquare() const { return fChargeChisquare; }
116 const Double_t GetChargeProb() const { return fChargeProb; }
117 const Int_t GetChargeNdf() const { return fChargeNdf; }
118
119 const Double_t GetTimeMean() const { return fTimeMean; }
120 const Double_t GetTimeSigma() const { return fTimeSigma; }
121
122 const Byte_t GetTimeLowerFitRangeHiGain() const { return fTimeLowerFitRangeHiGain; }
123 const Byte_t GetTimeUpperFitRangeHiGain() const { return fTimeUpperFitRangeHiGain; }
124 const Byte_t GetTimeLowerFitRangeLoGain() const { return fTimeLowerFitRangeLoGain; }
125 const Byte_t GetTimeUpperFitRangeLoGain() const { return fTimeUpperFitRangeLoGain; }
126
127 const Double_t GetTimeChiSquare() const { return fTimeChisquare; }
128 const Double_t GetTimeProb() const { return fTimeProb; }
129 const Int_t GetTimeNdf() const { return fTimeNdf; }
130
131 const TH1F *GetHTime() { return fHTimeHiGain; }
132 const TH1F *GetHTime() const { return fHTimeHiGain; }
133
134 const TH1I *GetHChargevsN() { return fHChargevsNHiGain; }
135 const TH1I *GetHChargevsN() const { return fHChargevsNHiGain; }
136
137 Double_t GetOffset() { return fOffset; }
138 Double_t GetSlope() { return fSlope; }
139
140 Bool_t UseLoGain();
141
142 Bool_t IsFitOK() const;
143 Bool_t IsUseLoGain() const;
144 Bool_t IsEmpty() const;
145
146 // Fill histos
147 Bool_t FillChargeLoGain(Float_t q);
148 Bool_t FillTimeLoGain(Float_t t);
149 Bool_t FillChargevsNLoGain(Float_t q, Int_t n);
150
151 Bool_t FillChargeHiGain(Float_t q);
152 Bool_t FillTimeHiGain(Float_t t);
153 Bool_t FillChargevsNHiGain(Float_t q, Int_t n);
154
155 Bool_t FillPointInGraph(Float_t qhi, Float_t qlo);
156
157 Bool_t SetupFill(const MParList *pList);
158 Bool_t Fill(const MParContainer *, const Stat_t w=1) { return kTRUE; }
159
160 // Fits
161 Bool_t FitCharge(Option_t *option="RQ0");
162
163 Bool_t FitTimeHiGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
164 Bool_t FitTimeLoGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
165
166 void FitHiGainvsLoGain();
167
168 // Draws
169 virtual void Draw(Option_t *option="");
170 TObject *DrawClone(Option_t *option="") const;
171
172 // Prints
173 void PrintChargeFitResult();
174 void PrintTimeFitResult();
175
176 // Others
177 virtual void CutAllEdges();
178
179 ClassDef(MHCalibrationPixel, 1) // Histograms for each calibrated pixel
180};
181
182#endif
Note: See TracBrowser for help on using the repository browser.