Interface to draw and print ROOT objects. More...
#include <GwollumPlot.h>
Public Member Functions | |
void | AddLegendEntry (const TObject *Obj, const string alabel, const string astyle="LPF") |
Adds a legend entry. | |
void | AddLegendHeader (const string alabel) |
Adds a legend header. | |
void | AddText (const string atext, const double ax, const double ay, const double asize) |
Adds text in the plot. | |
void | Draw (TObject *Obj, string Options="") |
Draws ROOT object. | |
void | DrawLegend (void) |
Draws current legend box. | |
void | Print (const string filename, const double rescale) |
Prints current canvas with a rescaling factor. | |
void | Print (const string filename) |
Prints current canvas. | |
void | ResetLegend (void) |
Resets current legend box. | |
void | ResizePlot (const int aWidth, const int aHeight) |
Resizes current canvas to new dimensions. | |
void | SetGridx (const int value=1) |
Set/Unset grid for X. | |
void | SetGridy (const int value=1) |
Set/Unset grid for Y. | |
void | SetGwollumStyle (void) |
Switch to GWOLLUM style. | |
void | SetLogx (const int value) |
Set Lin/Log scale for X. | |
void | SetLogy (const int value) |
Set Lin/Log scale for Y. | |
void | SetLogz (const int value=1) |
Set Lin/Log scale for Z. | |
void | SetStandardStyle (void) |
Switch to STANDARD style. | |
void | SetWhiteGwollumStyle (void) |
Switch to WHITEGWOLLUM style. | |
Constructors and destructors | |
GwollumPlot (const string aName, const string aStyleName="GWOLLUM") | |
Constructor of the GwollumPlot class. | |
virtual | ~GwollumPlot (void) |
Destructor of the ReadAscii class. | |
Protected Attributes | |
int | randid |
random integer id | |
string | srandid |
random string id | |
TText * | tt |
add text | |
TCanvas * | Wcan |
working canvas | |
TLegend * | Wleg |
plot legends | |
TPad * | Wpad |
working pad | |
TStyle * | Wstyle |
working style |
Interface to draw and print ROOT objects.
The GwollumPlot class provides a single interface to draw and print ROOT objects like histograms, graphs and so on. It also includes different pre-defined plotting styles like the GWOLLUM style. This class mainly includes wrappers for ROOT drawing functions.
Several pre-defined styles are available. At any moment, you can switch from one style to the next.
GwollumPlot::GwollumPlot | ( | const string | aName, | |
const string | aStyleName = "GWOLLUM" | |||
) |
Constructor of the GwollumPlot class.
A unique name must be provided with 'aName'. You can also choose a style between:
This style can be changed later.
aName | name to identify the canvas | |
aStyleName | style name |
GwollumPlot::~GwollumPlot | ( | void | ) | [virtual] |
Destructor of the ReadAscii class.
void GwollumPlot::AddLegendEntry | ( | const TObject * | Obj, | |
const string | alabel, | |||
const string | astyle = "LPF" | |||
) |
Adds a legend entry.
Obj | pointer to ROOT object to which the legend entry applies | |
alabel | label of the legend entry | |
astyle | legend style "L" for line, "P" for point and "F" for fill |
void GwollumPlot::AddLegendHeader | ( | const string | alabel | ) |
Adds a legend header.
alabel | label of the legend header |
void GwollumPlot::AddText | ( | const string | atext, | |
const double | ax, | |||
const double | ay, | |||
const double | asize | |||
) |
Adds text in the plot.
The position of the plot should be given in the pad coordinates (0-1).
atext | text to add | |
ax | X coordinate where to start the text | |
ay | Y coordinate where to start the text | |
astyle | legend style "L" for line, "P" for point and "F" for fill |
void GwollumPlot::Draw | ( | TObject * | Obj, | |
string | Options = "" | |||
) | [inline] |
Draws ROOT object.
Obj | pointer to ROOT object to be drawn | |
Options | drawing options (ROOT options) |
void GwollumPlot::DrawLegend | ( | void | ) |
Draws current legend box.
void GwollumPlot::Print | ( | const string | filename, | |
const double | rescale | |||
) |
Prints current canvas with a rescaling factor.
Typically this function is useful when one wants to produce thumbnails. The size of the working canvas is not changed, only the size of the printed object is modified. The width and height are rescaled by 'rescale'.
filename | file name to save the current canvas | |
rescale | scaling factor |
void GwollumPlot::Print | ( | const string | filename | ) | [inline] |
Prints current canvas.
filename | file name to save the current canvas |
void GwollumPlot::ResetLegend | ( | void | ) | [inline] |
Resets current legend box.
void GwollumPlot::ResizePlot | ( | const int | aWidth, | |
const int | aHeight | |||
) | [inline] |
Resizes current canvas to new dimensions.
Set Width and Height of canvas to aWidth and aHeight respectively. If aWidth and/or aHeight are greater than the current canvas window a scroll bar is automatically generated. Use this function to zoom in a canvas and navigate via the scroll bars.
aWidth | new canvas width | |
aHeight | new canvas height |
void GwollumPlot::SetGridx | ( | const int | value = 1 |
) | [inline] |
Set/Unset grid for X.
value |
void GwollumPlot::SetGridy | ( | const int | value = 1 |
) | [inline] |
Set/Unset grid for Y.
value |
void GwollumPlot::SetGwollumStyle | ( | void | ) |
Switch to GWOLLUM style.
void GwollumPlot::SetLogx | ( | const int | value | ) | [inline] |
Set Lin/Log scale for X.
value = 0 X scale will be linear.
value = 1 X scale will be logarithmic (base 10).
value > 1 reserved for possible support of base e or otherSet logarithmic scale for x axis.
value |
void GwollumPlot::SetLogy | ( | const int | value | ) | [inline] |
Set Lin/Log scale for Y.
value = 0 X scale will be linear.
value = 1 X scale will be logarithmic (base 10).
value > 1 reserved for possible support of base e or otherSet logarithmic scale for y axis.
value |
void GwollumPlot::SetLogz | ( | const int | value = 1 |
) | [inline] |
Set Lin/Log scale for Z.
value |
void GwollumPlot::SetStandardStyle | ( | void | ) |
Switch to STANDARD style.
void GwollumPlot::SetWhiteGwollumStyle | ( | void | ) |
Switch to WHITEGWOLLUM style.
int GwollumPlot::randid [protected] |
random integer id
string GwollumPlot::srandid [protected] |
random string id
TText* GwollumPlot::tt [protected] |
add text
TCanvas* GwollumPlot::Wcan [protected] |
working canvas
TLegend* GwollumPlot::Wleg [protected] |
plot legends
TPad* GwollumPlot::Wpad [protected] |
working pad
TStyle* GwollumPlot::Wstyle [protected] |
working style