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

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