Skip to content
Prev Previous commit
Next Next commit
remove virtual where probably not required and …
… use forward declarations
  • Loading branch information
paulgessinger committed Aug 31, 2016
commit d6a4d35bc97066267d0007d1e2420351a26b687b
73 changes: 37 additions & 36 deletions graf2d/gpad/inc/TRatioPlot.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@
// //
//////////////////////////////////////////////////////////////////////////

#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;

Expand Down Expand Up @@ -135,12 +136,12 @@ class TRatioPlot : public TObject {
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");

Expand All @@ -164,29 +165,29 @@ class TRatioPlot : public TObject {
virtual void Paint(Option_t *opt = "");

// 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; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These functions should be const - please check the other functions, too...

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can already construct an TFileResultPtr from a TFitResult*, do we really need this overload?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found it unintuitive to use TFitResultPtr, and I cannot just use TFitResult* since TFitResultPtr does not convert to TFitResult* automatically.


// Setters for margins
void SetUpTopMargin(Float_t margin);
Expand All @@ -196,18 +197,18 @@ class TRatioPlot : public TObject {
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);
void SetSeparationMargin(Float_t);
Float_t GetSeparationMargin();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be const?

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
};
Expand Down