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

Last change on this file since 5954 was 5692, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 4.8 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 MARS_MAlphaFitter
13#include "MAlphaFitter.h"
14#endif
15
16#ifndef ROOT_TH3
17#include <TH3.h>
18#endif
19
20class MParList;
21class MParameterD;
22class MEnergyEst;
23class MHillas;
24class MHMatrix;
25class MPointingPos;
26
27/*
28class MAlphaFitter : public MParContainer
29{
30private:
31 Float_t fSigInt;
32 Float_t fSigMax;
33 Float_t fBgMin;
34 Float_t fBgMax;
35 Int_t fPolynom;
36
37 Double_t fSignificance;
38 Double_t fExcessEvents;
39 Double_t fChiSqSignal;
40 Double_t fChiSqBg;
41 Double_t fSigmaGaus;
42 Double_t fIntegralMax;
43
44public:
45 MAlphaFitter() : fSigInt(10), fSigMax(75), fBgMin(45), fBgMax(85), fPolynom(2)
46 {
47 }
48
49 MAlphaFitter(const MAlphaFitter &f)
50 {
51 f.Copy(*this);
52 }
53
54 void Copy(TObject &o) const
55 {
56 MAlphaFitter &f = static_cast<MAlphaFitter&>(o);
57
58 f.fSigInt = fSigInt;
59 f.fSigMax = fSigMax;
60 f.fBgMin = fBgMin;
61 f.fBgMax = fBgMax;
62 f.fPolynom = fPolynom;
63 }
64
65 void SetSignalIntegralMax(Float_t s) { fSigInt = s; }
66 void SetSignalFitMax(Float_t s) { fSigMax = s; }
67 void SetBackgroundFitMin(Float_t s) { fBgMin = s; }
68 void SetBackgroundFitMax(Float_t s) { fBgMax = s; }
69 void SetNumPolynom(Int_t s) { fPolynom = s; }
70
71 Double_t GetExcessEvents() const { return fExcessEvents; }
72 Double_t GetSignificance() const { return fSignificance; }
73 Double_t GetChiSqSignal() const { return fChiSqSignal; }
74 Double_t GetChiSqBg() const { return fChiSqBg; }
75 Double_t GetSigmaGaus() const { return fSigmaGaus; }
76
77 void PaintResult(Float_t x=0.04, Float_t y=0.94, Float_t size=0.035) const;
78
79 Bool_t Fit(TH1D &h, Bool_t paint=kFALSE);
80 ClassDef(MAlphaFitter, 1)
81};
82*/
83
84class MHAlpha : public MH
85{
86private:
87 const TH3D *fOffData;
88
89 MAlphaFitter fFit; // SEEMS THAT STREAMER HAS SOME PROBLEMS... MAYBE IF FUNC IS USED AT THE SAME TIME FOR FITS (PAINT)
90
91 TH3D fHAlpha; // Alpha vs. theta and energy
92 TH1D fHEnergy; // excess events vs energy
93 TH1D fHTheta; // excess events vs theta
94 TH1D fHTime; // excess events vs time;
95 TH1D fHAlphaTime; //! temporary histogram to get alpha vs. time
96
97 MParameterD *fResult; //!
98 MEnergyEst *fEnergy; //!
99 MHillas *fHillas; //!
100 MPointingPos *fPointPos; //!
101
102 MTime *fTimeEffOn; //! Time to steer filling of fHTime
103 MTime *fTime; //! Event-Time to finalize fHTime
104 MTime fLastTime; //! Last fTimeEffOn
105
106 //Float_t fEnergyMin;
107 //Float_t fEnergyMax;
108 //Float_t fSizeMin;
109 //Float_t fSizeMax;
110
111 Bool_t fSkipHistTime;
112 Bool_t fSkipHistTheta;
113 Bool_t fSkipHistEnergy;
114
115 //const TString fNameProjAlpha; //! This should make sure, that gROOT doen't confuse the projection with something else
116
117 MHMatrix *fMatrix; //!
118 Int_t fMap[5]; //!
119
120 void FitEnergySpec(Bool_t paint=kFALSE);
121 void FitEnergyBins(Bool_t paint=kFALSE);
122 void FitThetaBins(Bool_t paint=kFALSE);
123
124 void UpdateAlphaTime(Bool_t final=kFALSE);
125 void InitAlphaTime(const MTime &t);
126 void FinalAlphaTime(MBinning &bins);
127
128 void PaintText(Double_t val, Double_t error) const;
129
130 Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; }
131
132public:
133 MHAlpha(const char *name=NULL, const char *title=NULL);
134
135 Bool_t SetupFill(const MParList *pl);
136 Bool_t Fill(const MParContainer *par, const Stat_t w=1);
137 Bool_t Finalize();
138
139 const TH3D &GetHist() const { return fHAlpha; }
140 const MAlphaFitter &GetAlphaFitter() const { return fFit; }
141
142 void SetOffData(const MHAlpha &h)
143 {
144 fOffData = &h.fHAlpha;
145 }
146/*
147 void SetSizeCuts(Float_t min, Float_t max) { fSizeMin=min; fSizeMax=max; }
148 void SetSizeMin(Float_t min) { fSizeMin=min; }
149 void SetSizeMax(Float_t max) { fSizeMax=max; }
150 void SetEnergyCuts(Float_t min, Float_t max) { fEnergyMin=min; fEnergyMax=max; }
151 void SetEnergyMin(Float_t min) { fEnergyMin=min; }
152 void SetEnergyMax(Float_t max) { fEnergyMax=max; }
153
154 void SetCuts(const MHAlpha &h) {
155 fSizeMin = h.fSizeMin; fEnergyMin = h.fEnergyMin;
156 fSizeMax = h.fSizeMax; fEnergyMax = h.fEnergyMax;
157 }
158 */
159
160 void SkipHistTime(Bool_t b=kTRUE) { fSkipHistTime=b; }
161 void SkipHistTheta(Bool_t b=kTRUE) { fSkipHistTheta=b; }
162 void SkipHistEnergy(Bool_t b=kTRUE) { fSkipHistEnergy=b; }
163
164 void Paint(Option_t *opt="");
165 void Draw(Option_t *option="");
166
167 void DrawAll(); //*MENU*
168
169 void InitMapping(MHMatrix *mat, Int_t type=0);
170 void StopMapping();
171
172 ClassDef(MHAlpha, 1) // Alpha-Plot which is fitted online
173};
174
175#endif
Note: See TracBrowser for help on using the repository browser.