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

Last change on this file since 6983 was 6977, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 5.2 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 Bool_t fForceUsingSize;
109
110 UShort_t fNumTimeBins; // Number of time bins to fill together
111 UShort_t fNumRebin; //!
112
113 //const TString fNameProjAlpha; //! This should make sure, that gROOT doen't confuse the projection with something else
114
115 MHMatrix *fMatrix; //!
116 Int_t fMap[5]; //!
117
118 void FitEnergySpec(Bool_t paint=kFALSE);
119 Float_t FitEnergyBins(Bool_t paint=kFALSE);
120 void FitThetaBins(Bool_t paint=kFALSE);
121
122 void UpdateAlphaTime(Bool_t final=kFALSE);
123 void InitAlphaTime(const MTime &t);
124 void FinalAlphaTime(MBinning &bins);
125
126 void PaintText(Double_t val, Double_t error) const;
127
128 Int_t DistancetoPrimitive(Int_t px, Int_t py) { return 0; }
129
130public:
131 MHAlpha(const char *name=NULL, const char *title=NULL);
132
133 Bool_t SetupFill(const MParList *pl);
134 Bool_t Fill(const MParContainer *par, const Stat_t w=1);
135 Bool_t Finalize();
136
137 const TH3D &GetHist() const { return fHAlpha; }
138 const MAlphaFitter &GetAlphaFitter() const { return fFit; }
139
140 const TH1D &GetHEnergy() const { return fHEnergy; }
141
142 void SetOffData(const MHAlpha &h)
143 {
144 fOffData = &h.fHAlpha;
145 fForceUsingSize = h.fForceUsingSize;
146 fNumTimeBins = h.fNumTimeBins;
147 }
148 void SetNumTimeBins(UShort_t n) { fNumTimeBins = n; }
149/*
150 void SetSizeCuts(Float_t min, Float_t max) { fSizeMin=min; fSizeMax=max; }
151 void SetSizeMin(Float_t min) { fSizeMin=min; }
152 void SetSizeMax(Float_t max) { fSizeMax=max; }
153 void SetEnergyCuts(Float_t min, Float_t max) { fEnergyMin=min; fEnergyMax=max; }
154 void SetEnergyMin(Float_t min) { fEnergyMin=min; }
155 void SetEnergyMax(Float_t max) { fEnergyMax=max; }
156
157 void SetCuts(const MHAlpha &h) {
158 fSizeMin = h.fSizeMin; fEnergyMin = h.fEnergyMin;
159 fSizeMax = h.fSizeMax; fEnergyMax = h.fEnergyMax;
160 }
161 */
162
163 void SkipHistTime(Bool_t b=kTRUE) { fSkipHistTime=b; }
164 void SkipHistTheta(Bool_t b=kTRUE) { fSkipHistTheta=b; }
165 void SkipHistEnergy(Bool_t b=kTRUE) { fSkipHistEnergy=b; }
166 void ForceUsingSize(Bool_t b=kTRUE) { fForceUsingSize=b; }
167
168 void DrawAll(); //*MENU*
169
170 void InitMapping(MHMatrix *mat, Int_t type=0);
171 void StopMapping();
172
173 // TObject
174 void Paint(Option_t *opt="");
175 void Draw(Option_t *option="");
176
177 // MParContainer
178 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
179
180 ClassDef(MHAlpha, 1) // Alpha-Plot which is fitted online
181};
182
183#endif
Note: See TracBrowser for help on using the repository browser.