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

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