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

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