CepGen 1.2.5
Central exclusive processes event generator
|
A "prettified" generic figure canvas. More...
#include <CepGenAddOns/ROOTWrapper/ROOTCanvas.h>
Public Member Functions | |
ROOTCanvas (const std::string &name, const std::string &title="", bool ratio=false) | |
Build a canvas from its name, title, and attributes. | |
void | SetSize (double size=600) |
Set horizontal canvas width. | |
void | Prettify (TH1 *obj) |
Draw main plot attributes in a pretty manner. | |
void | Prettify (THStack *hs) |
void | Prettify (TMultiGraph *mg) |
std::vector< TH1 * > | RatioPlot (TH1 *denom, const std::vector< TH1 * > &numers, double xmin=-999., double xmax=-999., double ymin=-999., double ymax=-999., Option_t *draw_style="hist") |
std::vector< TGraphErrors * > | RatioPlot (TGraphErrors *denom, const std::vector< TGraphErrors * > &numers, double xmin=-999., double xmax=-999., double ymin=-999., double ymax=-999.) |
void | SetTopLabel (const std::string &lab) |
Specify the text to show on top of the canvas. | |
void | SetGrid (int x=1, int y=1) |
void | SetLogx (int log=1) |
void | SetLogy (int log=1) |
void | SetLogz (int log=1) |
void | SetLegendMode (const std::string &mode) |
Set the placement strategy for the legend. | |
void | SetLegendX1 (double x) |
Set the horizontal coordinate of the low-left part of the legend object. | |
void | SetLegendY1 (double y) |
Set the vertical coordinate of the low-left part of the legend object. | |
void | AddLegendEntry (const TObject *obj, const std::string &title, Option_t *option="lpf") |
Add one new entry to the legend object. | |
void | Save (const std::string &ext, const std::string &out_dir=".") |
Save the canvas in an external file. | |
TLegend * | GetLegend () |
Retrieve the legend object (if produced) | |
void | Place (TLegend *leg, const Option_t *mode="lt") |
template<typename T , typename... Args> | |
T * | Make (Args &&... args) |
Garbage collector-like TObjects producer. | |
Static Public Attributes | |
static const std::vector< int > | colours |
Definition at line 89 of file ROOTCanvas.h.
|
explicit |
[in] | name | Canvas name (and subsequently filename on save) |
[in] | ratio | Divide the canvas into a main and ratio plots subparts? |
Definition at line 96 of file ROOTCanvas.h.
void AddLegendEntry | ( | const TObject * | obj, |
const std::string & | title, | ||
Option_t * | option = "lpf" |
||
) |
Definition at line 420 of file ROOTCanvas.h.
TLegend * GetLegend | ( | ) |
Definition at line 463 of file ROOTCanvas.h.
T * Make | ( | Args &&... | args | ) |
Definition at line 487 of file ROOTCanvas.h.
void Place | ( | TLegend * | leg, |
const Option_t * | mode = "lt" |
||
) |
Definition at line 464 of file ROOTCanvas.h.
void Prettify | ( | TH1 * | obj | ) |
Definition at line 109 of file ROOTCanvas.h.
void Prettify | ( | THStack * | hs | ) |
Definition at line 194 of file ROOTCanvas.h.
void Prettify | ( | TMultiGraph * | mg | ) |
Definition at line 211 of file ROOTCanvas.h.
std::vector< TGraphErrors * > RatioPlot | ( | TGraphErrors * | denom, |
const std::vector< TGraphErrors * > & | numers, | ||
double | xmin = -999. , |
||
double | xmax = -999. , |
||
double | ymin = -999. , |
||
double | ymax = -999. |
||
) |
Definition at line 299 of file ROOTCanvas.h.
std::vector< TH1 * > RatioPlot | ( | TH1 * | denom, |
const std::vector< TH1 * > & | numers, | ||
double | xmin = -999. , |
||
double | xmax = -999. , |
||
double | ymin = -999. , |
||
double | ymax = -999. , |
||
Option_t * | draw_style = "hist" |
||
) |
Definition at line 248 of file ROOTCanvas.h.
void Save | ( | const std::string & | ext, |
const std::string & | out_dir = "." |
||
) |
Definition at line 434 of file ROOTCanvas.h.
void SetGrid | ( | int | x = 1 , |
int | y = 1 |
||
) |
Definition at line 377 of file ROOTCanvas.h.
void SetLegendMode | ( | const std::string & | mode | ) |
Definition at line 404 of file ROOTCanvas.h.
void SetLegendX1 | ( | double | x | ) |
Definition at line 407 of file ROOTCanvas.h.
void SetLegendY1 | ( | double | y | ) |
Definition at line 414 of file ROOTCanvas.h.
void SetLogx | ( | int | log = 1 | ) |
Definition at line 383 of file ROOTCanvas.h.
void SetLogy | ( | int | log = 1 | ) |
Definition at line 390 of file ROOTCanvas.h.
void SetLogz | ( | int | log = 1 | ) |
Definition at line 396 of file ROOTCanvas.h.
void SetSize | ( | double | size = 600 | ) |
Definition at line 106 of file ROOTCanvas.h.
void SetTopLabel | ( | const std::string & | lab | ) |
Definition at line 365 of file ROOTCanvas.h.
|
static |
Definition at line 91 of file ROOTCanvas.h.