source: trunk/MagicSoft/Mars/mhflux/MHAlpha.h@ 4999

Last change on this file since 4999 was 4999, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 3.4 KB
Line 
1#ifndef MARS_MHAlpha
2#define MARS_MHAlpha
3
4#ifndef MARS_MH
5#include "MH.h"
6#endif
7
8#ifndef MARS_MTime
9#include "MTime.h"
10#endif
11
12#ifndef ROOT_TH3
13#include <TH3.h>
14#endif
15
16class MParList;
17class MParameterD;
18class MEnergyEst;
19class MHMatrix;
20class MPointingPos;
21
22
23class MAlphaFitter : public MParContainer
24{
25private:
26 Float_t fSigInt;
27 Float_t fSigMax;
28 Float_t fBgMin;
29 Float_t fBgMax;
30 Int_t fPolynom;
31
32 Double_t fSignificance;
33 Double_t fExcessEvents;
34 Double_t fChiSqSignal;
35 Double_t fChiSqBg;
36 Double_t fSigmaGaus;
37 Double_t fIntegralMax;
38
39public:
40 MAlphaFitter() : fSigInt(10), fSigMax(75), fBgMin(45), fBgMax(85), fPolynom(2)
41 {
42 }
43
44 MAlphaFitter(const MAlphaFitter &f)
45 {
46 f.Copy(*this);
47 }
48
49 void Copy(TObject &o) const
50 {
51 MAlphaFitter &f = static_cast<MAlphaFitter&>(o);
52
53 f.fSigInt = fSigInt;
54 f.fSigMax = fSigMax;
55 f.fBgMin = fBgMin;
56 f.fBgMax = fBgMax;
57 f.fPolynom = fPolynom;
58 }
59
60 void SetSignalIntegralMax(Float_t s) { fSigInt = s; }
61 void SetSignalFitMax(Float_t s) { fSigMax = s; }
62 void SetBackgroundFitMin(Float_t s) { fBgMin = s; }
63 void SetBackgroundFitMax(Float_t s) { fBgMax = s; }
64 void SetNumPolynom(Int_t s) { fPolynom = s; }
65
66 Double_t GetExcessEvents() const { return fExcessEvents; }
67 Double_t GetSignificance() const { return fSignificance; }
68 Double_t GetChiSqSignal() const { return fChiSqSignal; }
69 Double_t GetChiSqBg() const { return fChiSqBg; }
70 Double_t GetSigmaGaus() const { return fSigmaGaus; }
71
72 void PaintResult(Float_t x=0.04, Float_t y=0.94, Float_t size=0.035) const;
73
74 Bool_t Fit(TH1D &h, Bool_t paint=kFALSE);
75 ClassDef(MAlphaFitter, 1)
76};
77
78
79class MHAlpha : public MH
80{
81private:
82 MAlphaFitter fFit;
83
84 TH3D fHAlpha; // Alpha vs. theta and energy
85 TH1D fHEnergy; // excess events vs energy
86 TH1D fHTheta; // excess events vs theta
87 TH1D fHTime; // excess events vs time;
88 TH1D fHAlphaTime; //! temporary histogram to get alpha vs. time
89
90 MParameterD *fResult; //!
91 MEnergyEst *fEnergy; //!
92 MPointingPos *fPointPos; //!
93
94 MTime *fTimeEffOn; //! Time to steer filling of fHTime
95 MTime *fTime; //! Event-Time to finalize fHTime
96 MTime fLastTime; //! Last fTimeEffOn
97
98 const TString fNameProjAlpha; //! This should make sure, that gROOT doen't confuse the projection with something else
99
100 MHMatrix *fMatrix; //!
101 Int_t fMap[2]; //!
102
103 void FitEnergySpec(Bool_t paint=kFALSE);
104 void FitEnergyBins(Bool_t paint=kFALSE);
105 void FitThetaBins(Bool_t paint=kFALSE);
106
107 void UpdateAlphaTime(Bool_t final=kFALSE);
108 void InitAlphaTime(const MTime &t);
109 void FinalAlphaTime(MBinning &bins);
110
111 void PaintText(Double_t val, Double_t error) const;
112
113public:
114 MHAlpha(const char *name=NULL, const char *title=NULL);
115
116 Bool_t SetupFill(const MParList *pl);
117 Bool_t Fill(const MParContainer *par, const Stat_t w=1);
118 Bool_t Finalize();
119
120 const TH3D &GetHist() const { return fHAlpha; }
121 const MAlphaFitter &GetAlphaFitter() const { return fFit; }
122
123 void Paint(Option_t *opt="");
124 void Draw(Option_t *option="");
125
126 void InitMapping(MHMatrix *mat);
127 void StopMapping();
128
129 ClassDef(MHAlpha, 1) // Alpha-Plot which is fitted online
130};
131
132#endif
Note: See TracBrowser for help on using the repository browser.