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