source: trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.h@ 2632

Last change on this file since 2632 was 2629, checked in by gaug, 21 years ago
*** empty log message ***
File size: 4.4 KB
Line 
1#ifndef MARS_MHCalibrationPixel
2#define MARS_MHCalibrationPixel
3
4#ifndef ROOT_TH1
5#include "TH1.h"
6#endif
7
8#ifndef ROOT_TH1
9#include "TH1F.h"
10#endif
11
12#ifndef MARS_MH
13#include "MH.h"
14#endif
15
16#ifndef ROOT_TF1
17#include "TF1.h"
18#endif
19
20class TPaveText;
21class TMath;
22class MParList;
23
24class MHCalibrationPixel : public MH
25{
26
27private:
28
29 Int_t fPixId; //-> Pixel Nr
30
31protected:
32
33 TH1F* fHChargeHiGain; //-> Summed FADC slices
34 TH1I* fHTimeHiGain; //-> Mean arrival time in number of FADC sice
35 TH1I* fHChargevsNHiGain; //-> Summed Charge vs. Event Nr.
36
37 TH1F* fHChargeLoGain; //-> Summed FADC slices
38 TH1I* fHTimeLoGain; //-> Mean arrival time in number of FADC sice
39 TH1I* fHChargevsNLoGain; //-> Summed Charge vs. Event Nr.
40
41 TF1* fChargeGausFit;
42 TF1* fTimeGausFit;
43
44 TPaveText *fFitLegend;
45
46 Axis_t fLowerFitRange;
47 Axis_t fChargeFirstHiGain;
48 Axis_t fChargeLastHiGain;
49 Int_t fChargeNbinsHiGain;
50
51 Axis_t fChargeFirstLoGain;
52 Axis_t fChargeLastLoGain;
53 Int_t fChargeNbinsLoGain;
54
55 Bool_t fFitOK;
56
57 Double_t fChargeChisquare;
58 Double_t fChargeProb;
59 Int_t fChargeNdf;
60
61 Double_t fChargeMean;
62 Double_t fChargeMeanErr;
63 Double_t fChargeSigma;
64 Double_t fChargeSigmaErr;
65
66 Double_t fTimeChisquare;
67 Double_t fTimeProb;
68 Int_t fTimeNdf;
69
70 Double_t fTimeMean;
71 Double_t fTimeSigma;
72
73 Bool_t fUseLoGain;
74
75 virtual void DrawLegend();
76
77public:
78
79 MHCalibrationPixel(const char *name=NULL, const char *title=NULL);
80 ~MHCalibrationPixel();
81
82 void ChangeHistId(Int_t i);
83
84 Bool_t SetupFill(const MParList *pList);
85 Bool_t Fill(const MParContainer *, const Stat_t w=1) { return kTRUE; }
86
87 Bool_t FillChargeLoGain(Float_t q) { return fHChargeLoGain->Fill(q) > -1; }
88 Bool_t FillTimeLoGain(Int_t t) { return fHTimeLoGain->Fill(t) > -1; }
89 Bool_t FillChargevsNLoGain(Float_t q, Int_t n) { return fHChargevsNLoGain->Fill(n,q) > -1; }
90
91 Bool_t FillChargeHiGain(Float_t q) { return fHChargeHiGain->Fill(q) > -1; }
92 Bool_t FillTimeHiGain(Int_t t) { return fHTimeHiGain->Fill(t) > -1; }
93 Bool_t FillChargevsNHiGain(Float_t q, Int_t n) { return fHChargevsNHiGain->Fill(n,q) > -1; }
94
95 void SetUseLoGain() { fUseLoGain = kTRUE; }
96 Bool_t UseLoGain();
97
98 const TH1F *GetHCharge() { return fHChargeHiGain; }
99 const TH1F *GetHCharge() const { return fHChargeHiGain; }
100
101 const Double_t GetChargeMean() const { return fChargeMean; }
102 const Double_t GetChargeMeanErr() const { return fChargeMeanErr; }
103 const Double_t GetChargeSigma() const { return fChargeSigma; }
104 const Double_t GetChargeSigmaErr() const { return fChargeSigmaErr; }
105 const Double_t GetArea() const { return fChargeGausFit->GetParameter(0); }
106 const Double_t GetAreaErr() const { return fChargeGausFit->GetParError(0); }
107
108 const Double_t GetChargeChiSquare() const { return fChargeChisquare; }
109 const Double_t GetChargeProb() const { return fChargeProb; }
110 const Int_t GetChargeNdf() const { return fChargeNdf; }
111
112 const Double_t GetTimeMean() const { return fTimeMean; }
113 const Double_t GetTimeSigma() const { return fTimeSigma; }
114
115 const Double_t GetTimeChiSquare() const { return fTimeChisquare; }
116 const Double_t GetTimeProb() const { return fTimeProb; }
117 const Int_t GetTimeNdf() const { return fTimeNdf; }
118
119 const TH1I *GetHTime() { return fHTimeHiGain; }
120 const TH1I *GetHTime() const { return fHTimeHiGain; }
121
122 const TH1I *GetHChargevsN() { return fHChargevsNHiGain; }
123 const TH1I *GetHChargevsN() const { return fHChargevsNHiGain; }
124
125 Bool_t FitChargeHiGain(Option_t *option="RQ0");
126 Bool_t FitTimeHiGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
127
128 Bool_t FitChargeLoGain(Option_t *option="RQ0");
129 Bool_t FitTimeLoGain(Axis_t rmin=0, Axis_t rmax=0, Option_t *option="RQ0");
130
131 virtual void Draw(Option_t *option="");
132 virtual void CutAllEdges();
133 virtual void Reset();
134
135 void SetLowerFitRange(Axis_t min) { fLowerFitRange = min; }
136
137 void PrintChargeFitResult();
138 void PrintTimeFitResult();
139
140 Bool_t IsFitOK() { return fFitOK; }
141
142 ClassDef(MHCalibrationPixel, 1)
143};
144
145#endif
Note: See TracBrowser for help on using the repository browser.