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 |
|
---|
20 | class MParList;
|
---|
21 | class MParameterD;
|
---|
22 | class MHillas;
|
---|
23 | class MHMatrix;
|
---|
24 | class MPointingPos;
|
---|
25 |
|
---|
26 | class MHAlpha : public MH
|
---|
27 | {
|
---|
28 | protected:
|
---|
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 |
|
---|
40 | private:
|
---|
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
|
---|
59 | protected:
|
---|
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 |
|
---|
68 | private:
|
---|
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 |
|
---|
88 | public:
|
---|
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 | 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(); //*MENU*
|
---|
131 |
|
---|
132 | virtual void InitMapping(MHMatrix *mat, Int_t type=0);
|
---|
133 | void StopMapping();
|
---|
134 |
|
---|
135 | // TObject
|
---|
136 | void Paint(Option_t *opt="");
|
---|
137 | void Draw(Option_t *option="");
|
---|
138 |
|
---|
139 | // MParContainer
|
---|
140 | Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
|
---|
141 |
|
---|
142 | ClassDef(MHAlpha, 1) // Alpha-Plot which is fitted online
|
---|
143 | };
|
---|
144 |
|
---|
145 | #endif
|
---|