source: tags/Mars-V0.9/mhflux/MHAlpha.h

Last change on this file was 6240, checked in by tbretz, 20 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 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 Bool_t fSkipHistTime;
107 Bool_t fSkipHistTheta;
108 Bool_t fSkipHistEnergy;
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 void 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 void SetOffData(const MHAlpha &h)
141 {
142 fOffData = &h.fHAlpha;
143 }
144 void SetNumTimeBins(UShort_t n) { fNumTimeBins = n; }
145/*
146 void SetSizeCuts(Float_t min, Float_t max) { fSizeMin=min; fSizeMax=max; }
147 void SetSizeMin(Float_t min) { fSizeMin=min; }
148 void SetSizeMax(Float_t max) { fSizeMax=max; }
149 void SetEnergyCuts(Float_t min, Float_t max) { fEnergyMin=min; fEnergyMax=max; }
150 void SetEnergyMin(Float_t min) { fEnergyMin=min; }
151 void SetEnergyMax(Float_t max) { fEnergyMax=max; }
152
153 void SetCuts(const MHAlpha &h) {
154 fSizeMin = h.fSizeMin; fEnergyMin = h.fEnergyMin;
155 fSizeMax = h.fSizeMax; fEnergyMax = h.fEnergyMax;
156 }
157 */
158
159 void SkipHistTime(Bool_t b=kTRUE) { fSkipHistTime=b; }
160 void SkipHistTheta(Bool_t b=kTRUE) { fSkipHistTheta=b; }
161 void SkipHistEnergy(Bool_t b=kTRUE) { fSkipHistEnergy=b; }
162
163 void DrawAll(); //*MENU*
164
165 void InitMapping(MHMatrix *mat, Int_t type=0);
166 void StopMapping();
167
168 // TObject
169 void Paint(Option_t *opt="");
170 void Draw(Option_t *option="");
171
172 // MParContainer
173 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
174
175 ClassDef(MHAlpha, 1) // Alpha-Plot which is fitted online
176};
177
178#endif
Note: See TracBrowser for help on using the repository browser.