MINT2
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
RootPlotter1D Class Reference

#include <RootPlotter1D.h>

Inheritance diagram for RootPlotter1D:
RootPlotter Plotter

Public Member Functions

virtual double getGlobalMin ()
 
virtual double getGlobalMax ()
 
 RootPlotter1D (TH1 *histogram, double width=400, double height=300)
 
void addVerticalLine (double xpos, int style=1, int colour=1)
 
void addHorizontalLine (double ypos, int style=1, int colour=1)
 
void addHorizontalBox (double ypos, double width, int fillColour)
 
void addVerticalBox (double xmin, double xmax, int fillColour, int fillstyle)
 
virtual ~RootPlotter1D ()
 
void setRatioMax (double val)
 
void setRatioMin (double val)
 
void plotRatio (TString plotDirectory, TString plotOptions="", TPad *pad=0, double scaleFactor=1.0, double *returnMin=0, double *returnMax=0)
 
void plotPulls (TString plotDirectory, TString plotOptions="", TPad *pad=0, double scaleFactor=1.0)
 
void plotWithRatio (TString plotDirectory, TString plotOptions="", TPad *pad=0)
 
void plotWithPulls (TString plotDirectory, TString plotOptions="", TPad *pad=0)
 
- Public Member Functions inherited from RootPlotter
void setXaxisName (TString name)
 
void setYaxisName (TString name)
 
 RootPlotter (TH1 *histogram, double width=300, double height=200)
 
TString & drawOptions (int i)
 
TString & objDrawOptions (int i)
 
void plotStacked (TPad *pad, double scaleFactor)
 
void plotSame (TPad *pad, TString plotOptions, double scaleFactor=1.0)
 
virtual void plot (TString plotDirectory, TString plotOptions="", TPad *pad=0, double scaleFactor=1.0)
 
void addText (TString text, double x, double y, int alignh=1, int alignv=2, double size=0.06, int ndc=true, int color=kBlack)
 
void drawLegend ()
 
virtual ~RootPlotter ()
 
- Public Member Functions inherited from Plotter
int getColor (int i)
 
void setColor (int i, int color)
 
void usePresetColours (bool val=true)
 
void allImageFormats (bool val=true)
 
void setHistogramOwnership (bool i=1)
 
void setObjectOwnership (bool i=1)
 
 Plotter (TString canvasName, double width, double height)
 
 Plotter (const Plotter &other)
 
void add (TObject *histogram)
 
void addDot (double xpos, double ypos, double size, int colour=1, TString shape="circle", double sizeY=0.0)
 
void logX (bool log=1)
 
void logY (bool log=1)
 
void logZ (bool log=1)
 
void addObject (TObject *obj)
 
int getNumObjects ()
 
void setImageFormat (TString format)
 
TPad * getCanvas ()
 
void scaleTextSize (double scale)
 
void scaleAxisTitleSize (double scale)
 
void scaleAxisTitleOffset (double scale)
 
void setXAxisLabelSize (double val)
 
void setYAxisLabelSize (double val)
 
void setXAxisTitleSize (double val)
 
void setYAxisTitleSize (double val)
 
void setXAxisLabelOffset (double val)
 
void setYAxisLabelOffset (double val)
 
void setXAxisTitleOffset (double val)
 
void setYAxisTitleOffset (double val)
 
void setXAxisTickLength (double val)
 
void setYAxisTickLength (double val)
 
void setPropertiesFromTH1 (TH1 *hist)
 
void setMin (double min)
 
void setMax (double max)
 
void setBMargin (double val)
 
void setLMargin (double val)
 
void setRMargin (double val)
 
void setTMargin (double val)
 
virtual ~Plotter ()
 

Static Public Attributes

static double s_ratioMax = -999.999
 
static double s_ratioMin = -999.999
 
- Static Public Attributes inherited from Plotter
static TString s_imageformat = ".eps"
 
static TString s_imageformat2 = ""
 
static TString s_legend_position = "RightTop"
 
static int s_plotterCount = 0
 
static double s_forcedMax = -999.999
 
static double s_forcedMin = -999.999
 

Protected Member Functions

double getRatioMin (RootPlotter1D *ratioPlotter)
 
double getRatioMax (RootPlotter1D *ratioPlotter)
 
virtual void setHistogramStyle (TH1 *histogram, bool setMinMax=1)
 
- Protected Member Functions inherited from RootPlotter
TH1 * getHistogram (int i)
 
- Protected Member Functions inherited from Plotter
virtual void setCanvasDefaults (TPad *pad)
 

Protected Attributes

double _ratioMax
 
double _ratioMin
 
- Protected Attributes inherited from RootPlotter
TString _xAxisName
 
TString _yAxisName
 
std::vector< TString > _drawOptions
 
std::vector< TString > _objDrawOptions
 
- Protected Attributes inherited from Plotter
TPad * _canvas
 
TLegend * _legend
 
double _forcedMax
 
double _forcedMin
 
std::vector< TObject * > _objToPlot
 
std::vector< TObject * > _histograms
 
std::vector< int > _colours
 
double _lMargin
 
double _rMargin
 
double _tMargin
 
double _bMargin
 
double _xAxisTitleOffset
 
double _yAxisTitleOffset
 
double _xAxisLabelOffset
 
double _yAxisLabelOffset
 
double _xAxisTickLength
 
double _yAxisTickLength
 
double _xAxisLabelSize
 
double _yAxisLabelSize
 
double _xAxisTitleSize
 
double _yAxisTitleSize
 
bool _histogramOwnership
 
bool _objectOwnership
 
bool _usePresetColours
 
bool _allImageFormats
 

Detailed Description

HyperPlot, Author: Sam Harnew, sam.h.nosp@m.arne.nosp@m.w@gma.nosp@m.il.c.nosp@m.om , Date: Dec 2015

Class to make plotting 1D root histograms a little easier.

Definition at line 20 of file RootPlotter1D.h.

Constructor & Destructor Documentation

◆ RootPlotter1D()

RootPlotter1D::RootPlotter1D ( TH1 *  histogram,
double  width = 400,
double  height = 300 
)

Construct a RootPlotter with one histogram on a canvas with specified width and height

Definition at line 8 of file RootPlotter1D.cpp.

8  :
9  RootPlotter(histogram, width, height),
12 {
13 
14  _lMargin = 0.14;
15  _rMargin = 0.10;
16  _tMargin = 0.10;
17  _bMargin = 0.14;
18  WELCOME_LOG << "Hello from the Plotter() constructor!";
19 }
double _tMargin
Definition: Plotter.h:43
double _rMargin
Definition: Plotter.h:42
static double s_ratioMin
Definition: RootPlotter1D.h:53
double _ratioMin
Definition: RootPlotter1D.h:30
RootPlotter(TH1 *histogram, double width=300, double height=200)
Definition: RootPlotter.cpp:4
double _bMargin
Definition: Plotter.h:44
double _lMargin
Definition: Plotter.h:41
#define WELCOME_LOG
double _ratioMax
Definition: RootPlotter1D.h:29
static double s_ratioMax
Definition: RootPlotter1D.h:50

◆ ~RootPlotter1D()

RootPlotter1D::~RootPlotter1D ( )
virtual

Definition at line 159 of file RootPlotter1D.cpp.

159  {
160 
161 }

Member Function Documentation

◆ addHorizontalBox()

void RootPlotter1D::addHorizontalBox ( double  ypos,
double  width,
int  fillColour 
)

Add a box that spans the canvas in the horizontal direction, and goes from xmin to xmax in the vertical direction

Definition at line 94 of file RootPlotter1D.cpp.

94  {
95 
96  double xlow = getHistogram(0)->GetXaxis()->GetBinLowEdge(1);
97  double xhigh = getHistogram(0)->GetXaxis()->GetBinUpEdge (getHistogram(0)->GetXaxis()->GetNbins());
98  TBox* box = new TBox(xlow ,ypos - (width*0.5) ,xhigh, ypos + (width*0.5) );
99  box->SetLineColor(0);
100  box->SetFillColor(fillColour);
101  _objToPlot.push_back(box);
102 }
std::vector< TObject * > _objToPlot
Definition: Plotter.h:37
TH1 * getHistogram(int i)
Definition: RootPlotter.cpp:16

◆ addHorizontalLine()

void RootPlotter1D::addHorizontalLine ( double  ypos,
int  style = 1,
int  colour = 1 
)

Add a line that spans the canvas in the horizontal direction, and is at xmin in the vertical direction

Definition at line 83 of file RootPlotter1D.cpp.

83  {
84  double xlow = getHistogram(0)->GetXaxis()->GetBinLowEdge(1);
85  double xhigh = getHistogram(0)->GetXaxis()->GetBinUpEdge (getHistogram(0)->GetXaxis()->GetNbins());
86  TLine* line = new TLine(xlow ,ypos ,xhigh, ypos );
87  line->SetLineColor(colour);
88  line->SetLineStyle(style);
89  _objToPlot.push_back(line);
90 }
std::vector< TObject * > _objToPlot
Definition: Plotter.h:37
TH1 * getHistogram(int i)
Definition: RootPlotter.cpp:16

◆ addVerticalBox()

void RootPlotter1D::addVerticalBox ( double  xmin,
double  xmax,
int  fillColour,
int  fillstyle 
)

Add a box that spans the canvas in the vertical direction, and goes from xmin to xmax in the horizontal direction

Definition at line 106 of file RootPlotter1D.cpp.

106  {
107  double ymin = getGlobalMin();
108  double ymax = getGlobalMax();
109 
110  TBox* box = new TBox(xmin ,ymin ,xmax, ymax );
111  box->SetLineColor(0);
112  box->SetFillColor(fillColour);
113  box->SetFillStyle(fillstyle);
114  _objToPlot.push_back(box);
115 }
virtual double getGlobalMin()
std::vector< TObject * > _objToPlot
Definition: Plotter.h:37
virtual double getGlobalMax()

◆ addVerticalLine()

void RootPlotter1D::addVerticalLine ( double  xpos,
int  style = 1,
int  colour = 1 
)

Add a line that spans the canvas in the vertical direction, and is at xmin in the horizontal direction

Definition at line 71 of file RootPlotter1D.cpp.

71  {
72  double ymin = getGlobalMin();
73  double ymax = getGlobalMax();
74  VERBOSE_LOG << "Adding TLine from (" << xpos << ", " << ymin << ") to (" << xpos << ", " << ymax << ")";
75  TLine* line = new TLine(xpos ,ymin ,xpos, ymax );
76  line->SetLineColor(colour);
77  line->SetLineStyle(style);
78  _objToPlot.push_back(line);
79 }
virtual double getGlobalMin()
std::vector< TObject * > _objToPlot
Definition: Plotter.h:37
virtual double getGlobalMax()
#define VERBOSE_LOG

◆ getGlobalMax()

double RootPlotter1D::getGlobalMax ( )
virtual

find the maximum value accross all histogrmas

Reimplemented from RootPlotter.

Definition at line 137 of file RootPlotter1D.cpp.

137  {
138 
139  if ( _forcedMax != -999.999) return _forcedMax;
140 
141  double globalMax = getHistogram(0)->GetBinContent(getHistogram(0)->GetMaximumBin());
142  for (unsigned int h=1; h<_histograms.size(); h++)
143  {
144  double max = getHistogram(h)->GetBinContent(getHistogram(h)->GetMaximumBin());
145  if (max > globalMax) globalMax = max;
146  }
147 
148  if (globalMax > 0) globalMax = globalMax*1.05;
149  else globalMax = globalMax*0.95;
150 
151 
152 
153  return globalMax;
154 
155 }
std::vector< TObject * > _histograms
Definition: Plotter.h:38
double _forcedMax
Definition: Plotter.h:35
TH1 * getHistogram(int i)
Definition: RootPlotter.cpp:16

◆ getGlobalMin()

double RootPlotter1D::getGlobalMin ( )
virtual

find the minimum value accross all histogrmas

Reimplemented from RootPlotter.

Definition at line 118 of file RootPlotter1D.cpp.

118  {
119 
120  if ( _forcedMin != -999.999) return _forcedMin;
121 
122  double globalMin = getHistogram(0)->GetBinContent(getHistogram(0)->GetMinimumBin());
123 
124  for (unsigned int h=1; h<_histograms.size(); h++)
125  {
126  double min = getHistogram(h)->GetBinContent(getHistogram(h)->GetMinimumBin());
127  if (min < globalMin) globalMin = min;
128  }
129 
130  if (globalMin > 0) globalMin = globalMin*0.95;
131  else globalMin = globalMin*1.05;
132 
133  return globalMin;
134 }
std::vector< TObject * > _histograms
Definition: Plotter.h:38
double _forcedMin
Definition: Plotter.h:36
TH1 * getHistogram(int i)
Definition: RootPlotter.cpp:16

◆ getRatioMax()

double RootPlotter1D::getRatioMax ( RootPlotter1D ratioPlotter)
protected
Todo:
this stuff never really worked

Definition at line 336 of file RootPlotter1D.cpp.

336  {
337 
338  if ( _ratioMax != -999.999) return _ratioMax;
339  if ( s_ratioMax != -999.999) return s_ratioMax;
340 
341  ratioPlotter->setMax(-999.999);
342 
343  double max = ratioPlotter->getGlobalMax() - 1;
344  double absMax = fabs(max);
345 
346  double base = pow(10, floor(log10(absMax)));
347  int unit = ceil(double(absMax)/base);
348  double roundedMax = double(unit)*base;
349 
350  if (max < 0.0) roundedMax = -roundedMax;
351 
352  return 1.0 + roundedMax;
353 
354 }
virtual double getGlobalMax()
void setMax(double max)
Definition: Plotter.h:155
double _ratioMax
Definition: RootPlotter1D.h:29
static double s_ratioMax
Definition: RootPlotter1D.h:50

◆ getRatioMin()

double RootPlotter1D::getRatioMin ( RootPlotter1D ratioPlotter)
protected
Todo:
this stuff never really worked

Definition at line 316 of file RootPlotter1D.cpp.

316  {
317 
318  if ( _ratioMin != -999.999) return _ratioMin;
319  if ( s_ratioMin != -999.999) return s_ratioMin;
320 
321  ratioPlotter->setMin(-999.999);
322 
323  double min = ratioPlotter->getGlobalMin() - 1;
324  double absMin = fabs(min);
325 
326  double base = pow(10, floor(log10(absMin)));
327  int unit = ceil(double(absMin)/base);
328  double roundedMin = double(unit)*base;
329 
330  if (min < 0.0) roundedMin = -roundedMin;
331 
332  return 1.0 + roundedMin;
333 
334 }
virtual double getGlobalMin()
static double s_ratioMin
Definition: RootPlotter1D.h:53
double _ratioMin
Definition: RootPlotter1D.h:30
void setMin(double min)
Definition: Plotter.h:153

◆ plotPulls()

void RootPlotter1D::plotPulls ( TString  plotDirectory,
TString  plotOptions = "",
TPad *  pad = 0,
double  scaleFactor = 1.0 
)
Todo:
this stuff never really worked

Definition at line 247 of file RootPlotter1D.cpp.

247  {
248 
249  if (pad == 0) pad = _canvas;
250  pad->cd();
251  TH1D* divHist0 = new TH1D( gPullTH1D((TH1D*)getHistogram(1), (TH1D*)getHistogram(0), (TString)"division_1" + getHistogram(0)->GetName() ));
252  divHist0->GetXaxis()->SetTitle( getHistogram(0)->GetXaxis()->GetTitle() );
253  divHist0->GetYaxis()->SetTitle( getHistogram(0)->GetYaxis()->GetTitle() );
254 
255  //if there is a scale factor it means that be are adding this underneath another plot.
256  //We therefore adjust the histogram ticks to be the same in both
257 
258  if (scaleFactor != 1.0){
259  divHist0->GetXaxis()->SetTickLength(divHist0->GetXaxis()->GetTickLength()*scaleFactor);
260  divHist0->GetYaxis()->SetNdivisions(502);
261  }
262 
263  RootPlotter1D divPlotter(divHist0);
264  for (unsigned int i = 2; i < _histograms.size(); i++) {
265  TH1D* divHist = new TH1D( gPullTH1D((TH1D*)getHistogram(i), (TH1D*)getHistogram(0), "division_" + makeString<int>(i) + getHistogram(i)->GetName()) );
266  divPlotter.add(divHist);
267  }
268 
269  //if there is a scale factor it means that be are adding this underneath another plot.
270  //We therefore adjust all the margins and scale the labels to be the same in both sets
271  //of plots
272 
273  if (scaleFactor != 1.0){
274  this-> _bMargin = 0.0001;
275  divPlotter._tMargin = 0.0001;
276  divPlotter._bMargin = divPlotter._bMargin * scaleFactor;
277  divPlotter._xAxisLabelSize = divPlotter._xAxisLabelSize * scaleFactor;
278  divPlotter._yAxisLabelSize = divPlotter._yAxisLabelSize * scaleFactor;
279  divPlotter._xAxisTitleSize = divPlotter._xAxisTitleSize * scaleFactor;
280  divPlotter._yAxisTitleSize = divPlotter._yAxisTitleSize * scaleFactor;
281  divPlotter.setMax(5.0);
282  divPlotter.setMin(-5.0);
283  }
284 
285 
286 
287  divPlotter.addHorizontalBox(0.0, 2.0, 17);
288  divPlotter.addHorizontalLine(0.0, 2);
289  divPlotter.plot("", plotOptions, pad);
290 
291 
292  if (plotDirectory != "") pad->Print(plotDirectory + s_imageformat);
293 
294 }
static TString s_imageformat
Definition: Plotter.h:71
std::vector< TObject * > _histograms
Definition: Plotter.h:38
TPad * _canvas
Definition: Plotter.h:33
double _bMargin
Definition: Plotter.h:44
TH1 * getHistogram(int i)
Definition: RootPlotter.cpp:16
TH1D gPullTH1D(TH1D const *hist1, TH1D const *hist2, TString name)

◆ plotRatio()

void RootPlotter1D::plotRatio ( TString  plotDirectory,
TString  plotOptions = "",
TPad *  pad = 0,
double  scaleFactor = 1.0,
double *  returnMin = 0,
double *  returnMax = 0 
)
Todo:
this stuff never really worked

Definition at line 191 of file RootPlotter1D.cpp.

191  {
192 
193  if (pad == 0) pad = _canvas;
194  pad->cd();
195  TH1D* divHist0 = new TH1D( gDivideTH1D((TH1D*)getHistogram(1), (TH1D*)getHistogram(0), (TString)"division_1" + getHistogram(0)->GetName() ));
196  divHist0->GetXaxis()->SetTitle( getHistogram(0)->GetXaxis()->GetTitle() );
197  divHist0->GetYaxis()->SetTitle( getHistogram(0)->GetYaxis()->GetTitle() );
198 
199  //if there is a scale factor it means that be are adding this underneath another plot.
200  //We therefore adjust the histogram ticks to be the same in both
201 
202  if (scaleFactor != 1.0){
203  divHist0->GetXaxis()->SetTickLength(divHist0->GetXaxis()->GetTickLength()*scaleFactor);
204  divHist0->GetYaxis()->SetNdivisions(502);
205  }
206 
207  RootPlotter1D divPlotter(divHist0);
208  divPlotter.setHistogramOwnership(true);
209 
210  for (unsigned int i = 2; i < _histograms.size(); i++) {
211  TH1D* divHist = new TH1D( gDivideTH1D((TH1D*)getHistogram(i), (TH1D*)getHistogram(0), "division_" + makeString<int>(i) + getHistogram(i)->GetName()) );
212  divPlotter.add(divHist);
213  }
214 
215  //if there is a scale factor it means that be are adding this underneath another plot.
216  //We therefore adjust all the margins and scale the labels to be the same in both sets
217  //of plots
218 
219  if (scaleFactor != 1.0){
220  this-> _bMargin = 0.015;
221  divPlotter._tMargin = 0.07;
222  divPlotter._bMargin = divPlotter._bMargin * scaleFactor;
223  divPlotter._xAxisLabelSize = divPlotter._xAxisLabelSize * scaleFactor;
224  divPlotter._yAxisLabelSize = divPlotter._yAxisLabelSize * scaleFactor;
225  divPlotter._xAxisTitleSize = divPlotter._xAxisTitleSize * scaleFactor;
226  divPlotter._yAxisTitleSize = divPlotter._yAxisTitleSize * scaleFactor;
227  }
228 
229  double min = divPlotter.getRatioMin(&divPlotter);
230  double max = divPlotter.getRatioMax(&divPlotter);
231 
232  if ( fabs(min-1) > fabs(max-1) ) max = 1 + fabs(min-1);
233 
234  divPlotter.setMin(2.0-max);
235  divPlotter.setMax(max);
236 
237  if(returnMin != 0) *returnMin = 2.0-max;
238  if(returnMax != 0) *returnMax = max;
239 
240  divPlotter.addHorizontalLine(1.0, 2);
241  divPlotter.plot("", plotOptions, pad);
242 
243 
244  if (plotDirectory != "") pad->Print(plotDirectory + s_imageformat);
245 }
static TString s_imageformat
Definition: Plotter.h:71
std::vector< TObject * > _histograms
Definition: Plotter.h:38
TPad * _canvas
Definition: Plotter.h:33
double _bMargin
Definition: Plotter.h:44
TH1D gDivideTH1D(TH1D const *hist1, TH1D const *hist2, TString name)
TH1 * getHistogram(int i)
Definition: RootPlotter.cpp:16

◆ plotWithPulls()

void RootPlotter1D::plotWithPulls ( TString  plotDirectory,
TString  plotOptions = "",
TPad *  pad = 0 
)
Todo:
this stuff never really worked

Definition at line 296 of file RootPlotter1D.cpp.

296  {
297  double splitHeight = 0.3;
298  double scaleFactor = (1.0 - splitHeight) / splitHeight;
299 
300  if (pad == 0) pad = _canvas;
301 
302  TString upperPadName = (TString)_canvas->GetName() + "_upper";
303  TString lowerPadName = (TString)_canvas->GetName() + "_lower";
304  TPad* upperPad = new TPad(upperPadName, upperPadName, 0.0, splitHeight, 1.0, 1.0);
305  TPad* lowerPad = new TPad(lowerPadName, lowerPadName, 0.0, 0.0, 1.0, splitHeight);
306 
307  plotPulls("", plotOptions,lowerPad, scaleFactor);
308  plot ("", plotOptions,upperPad);
309 
310  pad->cd();
311  upperPad->Draw();
312  lowerPad->Draw();
313  if (plotDirectory != "") pad->Print(plotDirectory + s_imageformat);
314 }
static TString s_imageformat
Definition: Plotter.h:71
TPad * _canvas
Definition: Plotter.h:33
void plotPulls(TString plotDirectory, TString plotOptions="", TPad *pad=0, double scaleFactor=1.0)
virtual void plot(TString plotDirectory, TString plotOptions="", TPad *pad=0, double scaleFactor=1.0)

◆ plotWithRatio()

void RootPlotter1D::plotWithRatio ( TString  plotDirectory,
TString  plotOptions = "",
TPad *  pad = 0 
)
Todo:
this stuff never really worked

Definition at line 169 of file RootPlotter1D.cpp.

169  {
170 
171  double splitHeight = 0.3;
172  double scaleFactor = (1.0 - splitHeight) / splitHeight;
173 
174  if (pad == 0) pad = _canvas;
175 
176  TString upperPadName = (TString)_canvas->GetName() + "_upper";
177  TString lowerPadName = (TString)_canvas->GetName() + "_lower";
178  TPad* upperPad = new TPad(upperPadName, upperPadName, 0.0, splitHeight, 1.0, 1.0);
179  TPad* lowerPad = new TPad(lowerPadName, lowerPadName, 0.0, 0.0, 1.0, splitHeight);
180 
181  plotRatio("", "",lowerPad, scaleFactor);
182  plot ("", plotOptions,upperPad );
183 
184  pad->cd();
185  upperPad->Draw();
186  lowerPad->Draw();
187  if (plotDirectory != "") pad->Print(plotDirectory + s_imageformat);
188 }
static TString s_imageformat
Definition: Plotter.h:71
TPad * _canvas
Definition: Plotter.h:33
void plotRatio(TString plotDirectory, TString plotOptions="", TPad *pad=0, double scaleFactor=1.0, double *returnMin=0, double *returnMax=0)
virtual void plot(TString plotDirectory, TString plotOptions="", TPad *pad=0, double scaleFactor=1.0)

◆ setHistogramStyle()

void RootPlotter1D::setHistogramStyle ( TH1 *  histogram,
bool  setMinMax = 1 
)
protectedvirtual

Set the style of a TH1D

Implements RootPlotter.

Definition at line 23 of file RootPlotter1D.cpp.

23  {
24 
25  VERBOSE_LOG << histogram << " " << histogram->GetName();
26 
27  histogram->SetTitle("");
28 
29  histogram->GetXaxis()->SetTitleSize(_xAxisTitleSize);
30  histogram->GetYaxis()->SetTitleSize(_yAxisTitleSize);
31 
32  if ( histogram->GetXaxis()->GetLabelSize() != 0.0 )
33  histogram->GetXaxis()->SetLabelSize(_xAxisLabelSize);
34  if ( histogram->GetYaxis()->GetLabelSize() != 0.0 )
35  histogram->GetYaxis()->SetLabelSize(_yAxisLabelSize);
36 
37 
38  histogram->GetXaxis()->SetTickLength(_xAxisTickLength);
39  histogram->GetXaxis()->SetTickLength(_yAxisTickLength);
40 
41  if ( histogram->GetXaxis()->GetLabelOffset() != 999 )
42  histogram->GetXaxis()->SetLabelOffset(_xAxisLabelOffset);
43  if ( histogram->GetYaxis()->GetLabelOffset() != 999 )
44  histogram->GetYaxis()->SetLabelOffset(_yAxisLabelOffset);
45 
46 
47  histogram->GetXaxis()->SetTitleOffset(_xAxisTitleOffset);
48  histogram->GetYaxis()->SetTitleOffset(_yAxisTitleOffset);
49 
50  histogram->GetXaxis()->SetTitle(_xAxisName);
51  histogram->GetYaxis()->SetTitle(_yAxisName);
52 
53  double nBins = (double)histogram->GetNbinsX();
54  double markerSize = 15.0/nBins;
55  if (markerSize > 0.3) markerSize = 0.3;
56  histogram->SetMarkerSize(markerSize);
57 
58  if (setMinMax) histogram->SetMaximum(getGlobalMax());
59  if (setMinMax) histogram->SetMinimum(getGlobalMin());
60 
61  if (_bMargin < 0.01) histogram->GetXaxis()->SetNoExponent();
62 
63  VERBOSE_LOG << "Global Min = " << getGlobalMin();
64  VERBOSE_LOG << "Global Max = " << getGlobalMax();
65 
66 }
double _yAxisTickLength
Definition: Plotter.h:53
virtual double getGlobalMin()
double _yAxisLabelOffset
Definition: Plotter.h:50
double _xAxisLabelOffset
Definition: Plotter.h:49
double _yAxisTitleSize
Definition: Plotter.h:59
virtual double getGlobalMax()
double _xAxisLabelSize
Definition: Plotter.h:55
double _xAxisTitleSize
Definition: Plotter.h:58
#define VERBOSE_LOG
double _xAxisTitleOffset
Definition: Plotter.h:46
double _xAxisTickLength
Definition: Plotter.h:52
double _bMargin
Definition: Plotter.h:44
TString _yAxisName
Definition: RootPlotter.h:28
TString _xAxisName
Definition: RootPlotter.h:27
double _yAxisTitleOffset
Definition: Plotter.h:47
double _yAxisLabelSize
Definition: Plotter.h:56

◆ setRatioMax()

void RootPlotter1D::setRatioMax ( double  val)
inline
Todo:
this stuff never really worked

Definition at line 56 of file RootPlotter1D.h.

◆ setRatioMin()

void RootPlotter1D::setRatioMin ( double  val)
inline
Todo:
this stuff never really worked

Definition at line 59 of file RootPlotter1D.h.

Member Data Documentation

◆ _ratioMax

double RootPlotter1D::_ratioMax
protected
Todo:
this stuff never really worked

Definition at line 29 of file RootPlotter1D.h.

◆ _ratioMin

double RootPlotter1D::_ratioMin
protected
Todo:
this stuff never really worked

Definition at line 30 of file RootPlotter1D.h.

◆ s_ratioMax

double RootPlotter1D::s_ratioMax = -999.999
static
Todo:
this stuff never really worked

Definition at line 50 of file RootPlotter1D.h.

◆ s_ratioMin

double RootPlotter1D::s_ratioMin = -999.999
static
Todo:
this stuff never really worked

Definition at line 53 of file RootPlotter1D.h.


The documentation for this class was generated from the following files: