1 | #ifndef MARS_MHCalibrationPixel
|
---|
2 | #define MARS_MHCalibrationPixel
|
---|
3 |
|
---|
4 | #ifndef MARS_MH
|
---|
5 | #include "MH.h"
|
---|
6 | #endif
|
---|
7 |
|
---|
8 | class TArrayF;
|
---|
9 | class TH1F;
|
---|
10 | class TH1I;
|
---|
11 | class TF1;
|
---|
12 | class TProfile;
|
---|
13 | class TPaveText;
|
---|
14 |
|
---|
15 | class MHCalibrationPixel : public MH
|
---|
16 | {
|
---|
17 |
|
---|
18 | private:
|
---|
19 |
|
---|
20 | static const Int_t fChargeNbinsHiGain;
|
---|
21 | static const Int_t fChargeNbinsLoGain;
|
---|
22 | static const Int_t fAbsTimeNbins;
|
---|
23 | static const Axis_t fAbsTimeFirst;
|
---|
24 | static const Axis_t fAbsTimeLast;
|
---|
25 | static const Float_t fProbLimit;
|
---|
26 | static const Int_t fNDFLimit;
|
---|
27 |
|
---|
28 | static const Axis_t fMaxFreq;
|
---|
29 | static const Axis_t fMinFreq;
|
---|
30 | static const Int_t fPSDNbins;
|
---|
31 |
|
---|
32 | Int_t fPixId; // Pixel Nr
|
---|
33 |
|
---|
34 | TProfile* fHivsLoGain; //->
|
---|
35 |
|
---|
36 | Double_t fOffset;
|
---|
37 | Double_t fSlope;
|
---|
38 |
|
---|
39 | protected:
|
---|
40 |
|
---|
41 | TH1F* fHChargeHiGain; //-> Summed FADC slices High Gain
|
---|
42 | TH1F* fHAbsTimeHiGain; //-> Mean arrival time in number of FADC sice
|
---|
43 |
|
---|
44 | TH1F* fHChargeLoGain; //-> Summed FADC slices Low Gain
|
---|
45 | TH1F* fHAbsTimeLoGain; //-> Mean arrival time in number of FADC sice
|
---|
46 |
|
---|
47 | TArrayF* fPSDHiGain; //-> Power spectrum density of fHiGains
|
---|
48 | TArrayF* fPSDLoGain; //-> Power spectrum density of fLoGains
|
---|
49 |
|
---|
50 | TF1* fChargeGausFit; //->
|
---|
51 |
|
---|
52 | TH1F* fHPSD; //->
|
---|
53 | TF1* fPSDExpFit; //->
|
---|
54 |
|
---|
55 | TArrayF *fHiGains; //->
|
---|
56 | TArrayF *fLoGains; //->
|
---|
57 | TArrayF *fChargeXaxis; //
|
---|
58 | TArrayF *fPSDXaxis; //
|
---|
59 |
|
---|
60 | TPaveText *fFitLegend; //->
|
---|
61 |
|
---|
62 | Int_t fTotalEntries; // Number of entries
|
---|
63 | Int_t fCurrentSize;
|
---|
64 |
|
---|
65 | Axis_t fChargeFirstHiGain;
|
---|
66 | Axis_t fChargeLastHiGain;
|
---|
67 | Axis_t fChargeFirstLoGain;
|
---|
68 | Axis_t fChargeLastLoGain;
|
---|
69 |
|
---|
70 | Double_t fChargeChisquare;
|
---|
71 | Double_t fChargeProb;
|
---|
72 | Int_t fChargeNdf;
|
---|
73 |
|
---|
74 | Double_t fChargeMean;
|
---|
75 | Double_t fChargeMeanErr;
|
---|
76 | Double_t fChargeSigma;
|
---|
77 | Double_t fChargeSigmaErr;
|
---|
78 |
|
---|
79 | Float_t fAbsTimeMean;
|
---|
80 | Float_t fAbsTimeMeanErr;
|
---|
81 | Float_t fAbsTimeRms;
|
---|
82 |
|
---|
83 | Float_t fAbsTimeFirstHiGain;
|
---|
84 | Float_t fAbsTimeFirstLoGain;
|
---|
85 | Float_t fAbsTimeLastHiGain;
|
---|
86 | Float_t fAbsTimeLastLoGain;
|
---|
87 |
|
---|
88 | Float_t fPSDProb;
|
---|
89 |
|
---|
90 | Byte_t fFlags;
|
---|
91 |
|
---|
92 | enum { kUseLoGain, kChargeFitOK, kOscillating };
|
---|
93 |
|
---|
94 | virtual void DrawLegend();
|
---|
95 | virtual void CreateChargeXaxis(Int_t n);
|
---|
96 | virtual void CreatePSDXaxis(Int_t n);
|
---|
97 | virtual void CutArrayBorder(TArrayF *array);
|
---|
98 |
|
---|
99 | public:
|
---|
100 |
|
---|
101 | MHCalibrationPixel(const char *name=NULL, const char *title=NULL);
|
---|
102 | ~MHCalibrationPixel();
|
---|
103 |
|
---|
104 | void Clear(Option_t *o="");
|
---|
105 | void Reset();
|
---|
106 |
|
---|
107 | void ChangeHistId(Int_t i);
|
---|
108 |
|
---|
109 | // Setters
|
---|
110 | void SetUseLoGain(Bool_t b = kTRUE);
|
---|
111 |
|
---|
112 | // Getters
|
---|
113 | const Double_t GetChargeMean() const { return fChargeMean; }
|
---|
114 | const Double_t GetChargeMeanErr() const { return fChargeMeanErr; }
|
---|
115 | const Double_t GetChargeSigma() const { return fChargeSigma; }
|
---|
116 | const Double_t GetChargeSigmaErr() const { return fChargeSigmaErr; }
|
---|
117 | const Double_t GetChargeChiSquare() const { return fChargeChisquare; }
|
---|
118 | const Double_t GetChargeProb() const { return fChargeProb; }
|
---|
119 | const Int_t GetChargeNdf() const { return fChargeNdf; }
|
---|
120 |
|
---|
121 | const Float_t GetAbsTimeFirstHiGain() const { return fAbsTimeFirstHiGain; }
|
---|
122 | const Float_t GetAbsTimeFirstLoGain() const { return fAbsTimeFirstLoGain; }
|
---|
123 | const Float_t GetAbsTimeLastHiGain() const { return fAbsTimeLastHiGain; }
|
---|
124 | const Float_t GetAbsTimeLastLoGain() const { return fAbsTimeLastLoGain; }
|
---|
125 |
|
---|
126 | const Float_t GetAbsTimeMean() const { return fAbsTimeMean; }
|
---|
127 | const Float_t GetAbsTimeMeanErr() const { return fAbsTimeMeanErr; }
|
---|
128 | const Float_t GetAbsTimeRms() const { return fAbsTimeRms; }
|
---|
129 |
|
---|
130 | const TH1F *GetHCharge() { return fHChargeHiGain; }
|
---|
131 | const TH1F *GetHCharge() const { return fHChargeHiGain; }
|
---|
132 |
|
---|
133 | const TH1F *GetHAbsTime() { return fHAbsTimeHiGain; }
|
---|
134 | const TH1F *GetHAbsTime() const { return fHAbsTimeHiGain; }
|
---|
135 |
|
---|
136 | Double_t GetOffset() const { return fOffset; }
|
---|
137 | Double_t GetSlope() const { return fSlope; }
|
---|
138 |
|
---|
139 | Bool_t UseLoGain();
|
---|
140 | Bool_t CheckOscillations();
|
---|
141 |
|
---|
142 | Bool_t IsChargeFitOK() const;
|
---|
143 | Bool_t IsOscillating();
|
---|
144 | Bool_t IsUseLoGain() const;
|
---|
145 | Bool_t IsEmpty() const;
|
---|
146 |
|
---|
147 | // Fill histos
|
---|
148 | Bool_t FillChargeLoGain(Float_t q);
|
---|
149 | Bool_t FillAbsTimeLoGain(Float_t t);
|
---|
150 |
|
---|
151 | Bool_t FillChargeHiGain(Float_t q);
|
---|
152 | Bool_t FillAbsTimeHiGain(Float_t t);
|
---|
153 |
|
---|
154 | Bool_t FillGraphs(Float_t qhi, Float_t qlo);
|
---|
155 |
|
---|
156 | // Fits
|
---|
157 | Bool_t FitCharge(Option_t *option="RQ0");
|
---|
158 |
|
---|
159 | void FitHiGainvsLoGain();
|
---|
160 |
|
---|
161 | // Draws
|
---|
162 | virtual void Draw(Option_t *option="");
|
---|
163 | TObject *DrawClone(Option_t *option="") const;
|
---|
164 |
|
---|
165 | // Prints
|
---|
166 | void PrintChargeFitResult();
|
---|
167 |
|
---|
168 | // Others
|
---|
169 | virtual void CutAllEdges();
|
---|
170 |
|
---|
171 | ClassDef(MHCalibrationPixel, 1) // Histograms for each calibrated pixel
|
---|
172 | };
|
---|
173 |
|
---|
174 | #endif
|
---|