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

Last change on this file since 2969 was 2950, checked in by gaug, 21 years ago
*** empty log message ***
File size: 5.4 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 Double_t GetChargeMean() const { return fChargeMean; }
110 const Double_t GetChargeMeanErr() const { return fChargeMeanErr; }
111 const Double_t GetChargeSigma() const { return fChargeSigma; }
112 const Double_t GetChargeSigmaErr() const { return fChargeSigmaErr; }
113 const Double_t GetChargeChiSquare() const { return fChargeChisquare; }
114 const Double_t GetChargeProb() const { return fChargeProb; }
115 const Int_t GetChargeNdf() const { return fChargeNdf; }
116
117 const Double_t GetTimeMean() const { return fTimeMean; }
118 const Double_t GetTimeSigma() const { return fTimeSigma; }
119
120 const Byte_t GetTimeLowerFitRangeHiGain() const { return fTimeLowerFitRangeHiGain; }
121 const Byte_t GetTimeUpperFitRangeHiGain() const { return fTimeUpperFitRangeHiGain; }
122 const Byte_t GetTimeLowerFitRangeLoGain() const { return fTimeLowerFitRangeLoGain; }
123 const Byte_t GetTimeUpperFitRangeLoGain() const { return fTimeUpperFitRangeLoGain; }
124
125 const Double_t GetTimeChiSquare() const { return fTimeChisquare; }
126 const Double_t GetTimeProb() const { return fTimeProb; }
127 const Int_t GetTimeNdf() const { return fTimeNdf; }
128
129 const TH1F *GetHCharge() { return fHChargeHiGain; }
130 const TH1F *GetHCharge() const { return fHChargeHiGain; }
131
132 const TH1F *GetHTime() { return fHTimeHiGain; }
133 const TH1F *GetHTime() const { return fHTimeHiGain; }
134
135 const TH1I *GetHChargevsN() { return fHChargevsNHiGain; }
136 const TH1I *GetHChargevsN() const { return fHChargevsNHiGain; }
137
138 Double_t GetOffset() { return fOffset; }
139 Double_t GetSlope() { return fSlope; }
140
141 Bool_t UseLoGain();
142
143 Bool_t IsFitOK() const;
144 Bool_t IsUseLoGain() const;
145 Bool_t IsEmpty() const;
146
147 // Fill histos
148 Bool_t FillChargeLoGain(Float_t q);
149 Bool_t FillTimeLoGain(Float_t t);
150 Bool_t FillChargevsNLoGain(Float_t q, Int_t n);
151
152 Bool_t FillChargeHiGain(Float_t q);
153 Bool_t FillTimeHiGain(Float_t t);
154 Bool_t FillChargevsNHiGain(Float_t q, Int_t n);
155
156 Bool_t FillPointInGraph(Float_t qhi, Float_t qlo);
157
158 Bool_t SetupFill(const MParList *pList);
159 Bool_t Fill(const MParContainer *, const Stat_t w=1) { return kTRUE; }
160
161 // Fits
162 Bool_t FitCharge(Option_t *option="RQ0");
163
164 Bool_t FitTimeHiGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
165 Bool_t FitTimeLoGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
166
167 void FitHiGainvsLoGain();
168
169 // Draws
170 virtual void Draw(Option_t *option="");
171 TObject *DrawClone(Option_t *option="") const;
172
173 // Prints
174 void PrintChargeFitResult();
175 void PrintTimeFitResult();
176
177 // Others
178 virtual void CutAllEdges();
179
180 ClassDef(MHCalibrationPixel, 1) // Histograms for each calibrated pixel
181};
182
183#endif
Note: See TracBrowser for help on using the repository browser.