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

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