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

Last change on this file since 7110 was 7064, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 4.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
26class MHAlpha : public MH
27{
28protected:
29 TH3D fHist; // Alpha vs. theta and energy
30 TH1D fHistTime; //! temporary histogram to get alpha vs. time
31
32 TString fNameParameter;
33
34 MParContainer *fParameter; //!
35
36 const TH3D *fOffData;
37
38 MAlphaFitter fFit; // SEEMS THAT STREAMER HAS SOME PROBLEMS... MAYBE IF FUNC IS USED AT THE SAME TIME FOR FITS (PAINT)
39
40private:
41 TH1D fHEnergy; // excess events vs energy
42 TH1D fHTheta; // excess events vs theta
43 TH1D fHTime; // excess events vs time;
44
45 MParameterD *fResult; //!
46 MParameterD *fEnergy; //!
47 MHillas *fHillas; //!
48 MPointingPos *fPointPos; //!
49
50 MTime *fTimeEffOn; //! Time to steer filling of fHTime
51 MTime *fTime; //! Event-Time to finalize fHTime
52 MTime fLastTime; //! Last fTimeEffOn
53
54 Bool_t fSkipHistTime;
55 Bool_t fSkipHistTheta;
56 Bool_t fSkipHistEnergy;
57 Bool_t fForceUsingSize;
58
59 UShort_t fNumTimeBins; // Number of time bins to fill together
60 UShort_t fNumRebin; //!
61
62 //const TString fNameProjAlpha; //! This should make sure, that gROOT doen't confuse the projection with something else
63
64 MHMatrix *fMatrix; //!
65 Int_t fMap[5]; //!
66
67 Float_t FitEnergyBins(Bool_t paint=kFALSE);
68 void FitThetaBins(Bool_t paint=kFALSE);
69
70 void UpdateAlphaTime(Bool_t final=kFALSE);
71 void InitAlphaTime(const MTime &t);
72 void FinalAlphaTime(MBinning &bins);
73
74 void PaintText(Double_t val, Double_t error) const;
75
76 Int_t DistancetoPrimitive(Int_t px, Int_t py);
77
78 virtual Bool_t GetParameter(const MParList &pl);
79 virtual Double_t GetVal() const;
80 virtual const char *GetParameterRule() const
81 {
82 return "MHillasSrc.fAlpha";
83 }
84
85public:
86 MHAlpha(const char *name=NULL, const char *title=NULL);
87
88 // MH
89 Bool_t SetupFill(const MParList *pl);
90 Bool_t Fill(const MParContainer *par, const Stat_t w=1);
91 Bool_t Finalize();
92
93 // MHAlpha
94 const TH3D &GetHist() const { return fHist; }
95 const MAlphaFitter &GetAlphaFitter() const { return fFit; }
96
97 const TH1D &GetHEnergy() const { return fHEnergy; }
98
99 // Setter
100 void SetNameParameter(const char *name) { fNameParameter=name; }
101 void SetOffData(const MHAlpha &h)
102 {
103 fOffData = &h.fHist;
104 fForceUsingSize = h.fForceUsingSize;
105 fNumTimeBins = h.fNumTimeBins;
106 }
107 void SetNumTimeBins(UShort_t n) { fNumTimeBins = n; }
108/*
109 void SetSizeCuts(Float_t min, Float_t max) { fSizeMin=min; fSizeMax=max; }
110 void SetSizeMin(Float_t min) { fSizeMin=min; }
111 void SetSizeMax(Float_t max) { fSizeMax=max; }
112 void SetEnergyCuts(Float_t min, Float_t max) { fEnergyMin=min; fEnergyMax=max; }
113 void SetEnergyMin(Float_t min) { fEnergyMin=min; }
114 void SetEnergyMax(Float_t max) { fEnergyMax=max; }
115
116 void SetCuts(const MHAlpha &h) {
117 fSizeMin = h.fSizeMin; fEnergyMin = h.fEnergyMin;
118 fSizeMax = h.fSizeMax; fEnergyMax = h.fEnergyMax;
119 }
120 */
121
122 void SkipHistTime(Bool_t b=kTRUE) { fSkipHistTime=b; }
123 void SkipHistTheta(Bool_t b=kTRUE) { fSkipHistTheta=b; }
124 void SkipHistEnergy(Bool_t b=kTRUE) { fSkipHistEnergy=b; }
125 void ForceUsingSize(Bool_t b=kTRUE) { fForceUsingSize=b; }
126
127 void DrawAll(); //*MENU*
128
129 void InitMapping(MHMatrix *mat, Int_t type=0);
130 void StopMapping();
131
132 // TObject
133 void Paint(Option_t *opt="");
134 void Draw(Option_t *option="");
135
136 // MParContainer
137 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
138
139 ClassDef(MHAlpha, 1) // Alpha-Plot which is fitted online
140};
141
142#endif
Note: See TracBrowser for help on using the repository browser.