-
Notifications
You must be signed in to change notification settings - Fork 1.4k
TRatioPlot: Fixes to warnings and implementation of suggestions #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
59eda8d
d6a4d35
77d69cf
38c5182
9873d74
59248b4
a5ea3e8
6b2afa2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,21 +21,22 @@ | |
| // // | ||
| ////////////////////////////////////////////////////////////////////////// | ||
|
|
||
| #include "TH1.h" | ||
| #include "TPad.h" | ||
| #include "TGraphAsymmErrors.h" | ||
| #include "TGraphErrors.h" | ||
| #include "TGraph.h" | ||
| #include "TAxis.h" | ||
| #include "TGaxis.h" | ||
| #include "TH1F.h" | ||
| #include "TFitResultPtr.h" | ||
| #include "THStack.h" | ||
|
|
||
| class TObject; | ||
| class TH1; | ||
| class TPad; | ||
| class TGraphAsymmErrors; | ||
| class TGraphErrors; | ||
| class TGraph; | ||
| class TAxis; | ||
| class TGaxis; | ||
| class TLine; | ||
| class TFitResultPtr; | ||
| class TFitResult; | ||
| class THStack; | ||
| class TBrowser; | ||
| class TFileMergeInfo; | ||
|
|
||
| class TRatioPlot : public TPad { | ||
| class TRatioPlot : public TObject { | ||
|
|
||
| private: | ||
| TRatioPlot& operator=(const TRatioPlot&); // Not implemented | ||
|
|
@@ -135,59 +136,60 @@ class TRatioPlot : public TPad { | |
| virtual void SetupPads(); | ||
| virtual void CreateVisualAxes(); | ||
| virtual Bool_t SyncPadMargins(); | ||
| virtual void SetPadMargins(); | ||
| virtual void CreateGridline(); | ||
| void SetPadMargins(); | ||
| void CreateGridline(); | ||
|
|
||
| virtual void ImportAxisAttributes(TGaxis* gaxis, TAxis* axis); | ||
| void ImportAxisAttributes(TGaxis* gaxis, TAxis* axis); | ||
|
|
||
| virtual Bool_t IsDrawn(); | ||
| Bool_t IsDrawn(); | ||
|
|
||
| virtual void Init(TH1* h1, TH1* h2, Option_t *option = "", Option_t *h1DrawOpt = "hist", Option_t *h2DrawOpt = "E", Option_t *graphDrawOpt = "AP"); | ||
| virtual void Init(TH1* h1, TH1* h2, Option_t *option = ""); | ||
|
|
||
| public: | ||
|
|
||
| TRatioPlot(); | ||
| virtual ~TRatioPlot(); | ||
| TRatioPlot(TH1* h1, TH1* h2, Option_t *option = "pois", Option_t *h1DrawOpt = "hist", Option_t *h2DrawOpt = "E", Option_t *graphDrawOpt = "AP", const char *name = "RatioPlot", const char *title = "RatioPlot", Double_t xlow = 0, Double_t ylow = 0, Double_t xup = 1, Double_t yup = 1); | ||
|
|
||
| TRatioPlot(THStack* st, TH1* h2, Option_t *option = "pois", Option_t *h1DrawOpt = "hist", Option_t *h2DrawOpt = "E", Option_t *graphDrawOpt = "AP", const char *name = "RatioPlot", const char *title = "RatioPlot", Double_t xlow = 0, Double_t ylow = 0, Double_t xup = 1, Double_t yup = 1); | ||
| TRatioPlot(TH1* h1, TH1* h2, Option_t *option = "pois"); | ||
|
|
||
| TRatioPlot(TH1* h1, Option_t *option = "", Option_t *h1DrawOpt = "", Option_t *graphDrawOpt = "LX", TFitResult *fitres = 0, const char *name = "RatioPlot", const char *title = "RatioPlot", Double_t xlow = 0, Double_t ylow = 0, Double_t xup = 1, Double_t yup = 1); | ||
| TRatioPlot(THStack* st, TH1* h2, Option_t *option = "pois"); | ||
|
|
||
| TRatioPlot(TH1* h1, Option_t *option = "", TFitResult *fitres = 0); | ||
|
|
||
| void SetH1DrawOpt(Option_t *opt); | ||
| void SetH2DrawOpt(Option_t *opt); | ||
| void SetGraphDrawOpt(Option_t *opt); | ||
|
|
||
| virtual void Draw(Option_t *chopt=""); | ||
| virtual void Browse(TBrowser *b); | ||
|
|
||
| virtual void BuildLowerPlot(); | ||
|
||
|
|
||
| virtual void Paint(Option_t *opt = ""); | ||
| virtual void PaintModified(); | ||
|
|
||
| // Slots for signal receiving | ||
| virtual void UnZoomed(); | ||
| virtual void RangeAxisChanged(); | ||
| virtual void SubPadResized(); | ||
| void UnZoomed(); | ||
| void RangeAxisChanged(); | ||
| void SubPadResized(); | ||
|
|
||
| // Getters | ||
| virtual TAxis *GetXaxis() { return fSharedXAxis; } | ||
| virtual TAxis *GetUpYaxis() { return fUpYaxis; } | ||
| virtual TAxis *GetLowYaxis() { return fLowYaxis; } | ||
| TAxis *GetXaxis() { return fSharedXAxis; } | ||
|
||
| TAxis *GetUpYaxis() { return fUpYaxis; } | ||
| TAxis *GetLowYaxis() { return fLowYaxis; } | ||
|
|
||
| virtual TGraph *GetLowerRefGraph(); | ||
| virtual TAxis *GetLowerRefXaxis(); | ||
| virtual TAxis *GetLowerRefYaxis(); | ||
| TAxis *GetLowerRefXaxis(); | ||
| TAxis *GetLowerRefYaxis(); | ||
|
|
||
| virtual TObject *GetUpperRefObject(); | ||
| virtual TAxis *GetUpperRefXaxis(); | ||
| virtual TAxis *GetUpperRefYaxis(); | ||
| TAxis *GetUpperRefXaxis(); | ||
| TAxis *GetUpperRefYaxis(); | ||
|
|
||
| virtual TPad * GetUpperPad() { return fUpperPad; } | ||
| virtual TPad * GetLowerPad() { return fLowerPad; } | ||
| TPad * GetUpperPad() { return fUpperPad; } | ||
| TPad * GetLowerPad() { return fLowerPad; } | ||
|
|
||
| // Setters | ||
| virtual void SetFitResult(TFitResultPtr fitres); | ||
| virtual void SetFitResult(TFitResult *fitres); | ||
| void SetFitResult(TFitResultPtr fitres); | ||
| void SetFitResult(TFitResult *fitres); | ||
|
||
|
|
||
| // Setters for margins | ||
| void SetUpTopMargin(Float_t margin); | ||
|
|
@@ -197,21 +199,18 @@ class TRatioPlot : public TPad { | |
| void SetLeftMargin(Float_t margin); | ||
| void SetRightMargin(Float_t margin); | ||
|
|
||
| virtual void SetSeparationMargin(Float_t); | ||
| virtual Float_t GetSeparationMargin(); | ||
| virtual void SetSplitFraction(Float_t sf); | ||
| virtual void SetConfidenceLevels(Double_t cl1, Double_t cl2); | ||
|
|
||
| virtual void SetLogx(Int_t value = 1); // *TOGGLE* | ||
| virtual void SetLogy(Int_t value = 1); // *TOGGLE* | ||
| void SetSeparationMargin(Float_t); | ||
| Float_t GetSeparationMargin(); | ||
|
||
| void SetSplitFraction(Float_t sf); | ||
| void SetConfidenceLevels(Double_t cl1, Double_t cl2); | ||
|
|
||
| virtual void SetGridlines(Double_t *gridlines, Int_t numGridlines); | ||
| virtual void SetGridlines(std::vector<double> gridlines); | ||
|
|
||
| virtual void SetConfidenceIntervalColors(Color_t ci1 = kGreen, Color_t ci2 = kYellow); | ||
| void SetConfidenceIntervalColors(Color_t ci1 = kGreen, Color_t ci2 = kYellow); | ||
|
|
||
| virtual void SetC1(Double_t c1) { fC1 = c1; } | ||
| virtual void SetC2(Double_t c2) { fC2 = c2; } | ||
| void SetC1(Double_t c1) { fC1 = c1; } | ||
| void SetC2(Double_t c2) { fC2 = c2; } | ||
|
|
||
| ClassDef(TRatioPlot, 1) //A ratio of histograms | ||
| }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you inherit from TObject (and you should) then we need to
#includeTObject.h. If you source file starts with#include "TRatioPlot.h"then it should have told you - which is why that should be the first#include:-)