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

Last change on this file since 3081 was 3081, checked in by gaug, 21 years ago
*** empty log message ***
File size: 4.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 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 Int_t fPSDNbins;
29
30 Int_t fPixId; // Pixel Nr
31
32 TProfile* fHivsLoGain; //->
33
34 Double_t fOffset;
35 Double_t fSlope;
36
37protected:
38
39 TH1F* fHChargeHiGain; //-> Summed FADC slices High Gain
40 TH1F* fHAbsTimeHiGain; //-> Mean arrival time in number of FADC sice
41
42 TH1F* fHChargeLoGain; //-> Summed FADC slices Low Gain
43 TH1F* fHAbsTimeLoGain; //-> Mean arrival time in number of FADC sice
44
45 TArrayF* fPSDHiGain; //-> Power spectrum density of fHiGains
46 TArrayF* fPSDLoGain; //-> Power spectrum density of fLoGains
47
48 TF1* fChargeGausFit; //->
49
50 TH1I* fHPSD; //->
51 TF1* fPSDExpFit; //->
52
53 TArrayF *fHiGains; //->
54 TArrayF *fLoGains; //->
55 TArrayF *fChargeXaxis; //
56 TArrayF *fPSDXaxis; //
57
58 TPaveText *fFitLegend; //->
59
60 Int_t fTotalEntries; // Number of entries
61 Int_t fCurrentSize;
62
63 Axis_t fChargeFirstHiGain;
64 Axis_t fChargeLastHiGain;
65 Axis_t fChargeFirstLoGain;
66 Axis_t fChargeLastLoGain;
67
68 Double_t fChargeChisquare;
69 Double_t fChargeProb;
70 Int_t fChargeNdf;
71
72 Double_t fChargeMean;
73 Double_t fChargeMeanErr;
74 Double_t fChargeSigma;
75 Double_t fChargeSigmaErr;
76
77 Float_t fAbsTimeMean;
78 Float_t fAbsTimeMeanErr;
79 Float_t fAbsTimeRms;
80
81 Float_t fAbsTimeFirstHiGain;
82 Float_t fAbsTimeFirstLoGain;
83 Float_t fAbsTimeLastHiGain;
84 Float_t fAbsTimeLastLoGain;
85
86 Float_t fPSDProb;
87
88 Byte_t fFlags;
89
90 enum { kUseLoGain, kChargeFitOK, kOscillating };
91
92 virtual void DrawLegend();
93 virtual void CreateChargeXaxis(Int_t n);
94 virtual void CreatePSDXaxis(Int_t n);
95 virtual void CutArrayBorder(TArrayF *array);
96
97public:
98
99 MHCalibrationPixel(const char *name=NULL, const char *title=NULL);
100 ~MHCalibrationPixel();
101
102 void Clear(Option_t *o="");
103 void Reset();
104
105 void ChangeHistId(Int_t i);
106
107 // Setters
108 void SetUseLoGain(Bool_t b = kTRUE);
109
110 // Getters
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 Float_t GetAbsTimeFirstHiGain() const { return fAbsTimeFirstHiGain; }
120 const Float_t GetAbsTimeFirstLoGain() const { return fAbsTimeFirstLoGain; }
121 const Float_t GetAbsTimeLastHiGain() const { return fAbsTimeLastHiGain; }
122 const Float_t GetAbsTimeLastLoGain() const { return fAbsTimeLastLoGain; }
123
124 const Float_t GetAbsTimeMean() const { return fAbsTimeMean; }
125 const Float_t GetAbsTimeMeanErr() const { return fAbsTimeMeanErr; }
126 const Float_t GetAbsTimeRms() const { return fAbsTimeRms; }
127
128 const TH1F *GetHCharge() { return fHChargeHiGain; }
129 const TH1F *GetHCharge() const { return fHChargeHiGain; }
130
131 const TH1F *GetHAbsTime() { return fHAbsTimeHiGain; }
132 const TH1F *GetHAbsTime() const { return fHAbsTimeHiGain; }
133
134 Double_t GetOffset() const { return fOffset; }
135 Double_t GetSlope() const { return fSlope; }
136
137 Bool_t UseLoGain();
138 Bool_t CheckOscillations();
139
140 Bool_t IsChargeFitOK() const;
141 Bool_t IsOscillating();
142 Bool_t IsUseLoGain() const;
143 Bool_t IsEmpty() const;
144
145 // Fill histos
146 Bool_t FillChargeLoGain(Float_t q);
147 Bool_t FillAbsTimeLoGain(Float_t t);
148
149 Bool_t FillChargeHiGain(Float_t q);
150 Bool_t FillAbsTimeHiGain(Float_t t);
151
152 Bool_t FillGraphs(Float_t qhi, Float_t qlo);
153
154 // Fits
155 Bool_t FitCharge(Option_t *option="RQ0");
156
157 void FitHiGainvsLoGain();
158
159 // Draws
160 virtual void Draw(Option_t *option="");
161 TObject *DrawClone(Option_t *option="") const;
162
163 // Prints
164 void PrintChargeFitResult();
165
166 // Others
167 virtual void CutAllEdges();
168
169 ClassDef(MHCalibrationPixel, 1) // Histograms for each calibrated pixel
170};
171
172#endif
Note: See TracBrowser for help on using the repository browser.