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

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