LOGO

RestFrames  v1.0.1
RestFrames HEP Event Analysis Software Library
Public Member Functions | List of all members
RestFrames::HistPlot Class Reference

Detailed Description

Definition at line 44 of file HistPlot.hh.

Inheritance diagram for RestFrames::HistPlot:
Inheritance graph
[legend]

Public Member Functions

 HistPlot (const std::string &sname, const std::string &stitle)
 Standard constructor. More...
 
virtual void Clear ()
 Clears HistPlot from all connections to other objects.
 
HistPlotVar const & GetNewVar (const std::string &name, const std::string &title, double minval, double maxval, const std::string &unit="")
 Defines new variable for plotting. More...
 
HistPlotCategory const & GetNewCategory (const std::string &name, const std::string &title)
 Defines new category for plotting. More...
 
void AddPlot (const HistPlotVar &var, RestFrames::RFList< const HistPlotCategory > cats=RestFrames::RFList< const RestFrames::HistPlotCategory >(), bool invert_colors=false)
 Defines new 1D plot. More...
 
void AddPlot (const HistPlotVar &varX, const HistPlotVar &varY, RestFrames::RFList< const HistPlotCategory > cats=RestFrames::RFList< const RestFrames::HistPlotCategory >(), bool invert_colors=false)
 Defines new 2D plot. More...
 
void Fill (double weight=1.)
 Fills an entry for every variable according to each's current value. More...
 
void Fill (const HistPlotCategory &cat, double weight=1.)
 Fills an entry for every variable corresponding to a category according to each's current value. More...
 
void Draw (bool invert_colors=false)
 Draws every histogram.
 
void SetPlotLabel (const std::string &label)
 Changes the text at the top of the plot. More...
 
void SetPlotTitle (const std::string &title)
 Sets plot's title. More...
 
void SetScaleLabel (const std::string &label)
 Sets the label of the normalization of plot. More...
 
void SetScale (double scale=-1)
 Sets the normalization of plot. More...
 
void SetRebin (int rebin=4)
 Reduces the number of bins by a factor. More...
 
void WriteHist (const std::string &filename)
 Stores all histograms in root file. More...
 
- Public Member Functions inherited from RestFrames::RFPlot
 RFPlot (const std::string &sname, const std::string &stitle)
 Standard constructor. More...
 
void WriteOutput (const std::string &filename)
 Stores all plots in root file. More...
 
- Public Member Functions inherited from RestFrames::RFBase
 RFBase (const std::string &sname, const std::string &stitle, int key)
 Standard constructor. More...
 
 RFBase ()
 Empty constructor.
 
bool IsEmpty () const
 Checks whether this is default (empty) instance of class.
 
bool operator! () const
 Tests whether key is the same as this.
 
void Print (LogType type) const
 Print information associated with object.
 
virtual std::string PrintString (LogType type) const
 String of information associated with object.
 
RFKey GetKey () const
 gets object identification key
 
std::string GetName () const
 Returns object name.
 
std::string GetTitle () const
 Returns object title.
 
bool IsSame (const RFKey &key) const
 Tests whether key is the same as this.
 
bool IsSame (const RFBase &obj) const
 Tests whether obj is the same as this.
 
bool operator== (const RFKey &key) const
 Tests whether key is the same as this.
 
bool operator== (const RFBase &obj) const
 Tests whether obj is the same as this.
 
bool operator!= (const RFKey &key) const
 Tests whether key is the same as this.
 
bool operator!= (const RFBase &obj) const
 Tests whether obj is the same as this.
 

Additional Inherited Members

- Static Public Member Functions inherited from RestFrames::RFBase
static RFBaseEmpty ()
 Returns empty RFBase. More...
 
- Static Public Attributes inherited from RestFrames::RFPlot
static const TColor rf_blue0
 
static const TColor rf_blue1
 
static const TColor rf_blue2
 
static const TColor rf_blue3
 
static const TColor rf_blue4
 
static const TColor rf_green0
 
static const TColor rf_green1
 
static const TColor rf_green2
 
static const TColor rf_green3
 
static const TColor rf_green4
 
static const TColor rf_red0
 
static const TColor rf_red1
 
static const TColor rf_red2
 
static const TColor rf_red3
 
static const TColor rf_red4
 
static const TColor rf_yellow0
 
static const TColor rf_yellow1
 
static const TColor rf_yellow2
 
static const TColor rf_yellow3
 
static const TColor rf_yellow4
 
static const TColor rf_cyan0
 
static const TColor rf_cyan1
 
static const TColor rf_cyan2
 
static const TColor rf_cyan3
 
static const TColor rf_cyan4
 
static const TColor rf_lime0
 
static const TColor rf_lime1
 
static const TColor rf_lime2
 
static const TColor rf_lime3
 
static const TColor rf_lime4
 
static const TColor rf_purple0
 
static const TColor rf_purple1
 
static const TColor rf_purple2
 
static const TColor rf_purple3
 
static const TColor rf_purple4
 
static const TColor rf_orange0
 
static const TColor rf_orange1
 
static const TColor rf_orange2
 
static const TColor rf_orange3
 
static const TColor rf_orange4
 
- Protected Member Functions inherited from RestFrames::RFPlot
void AddCanvas (TCanvas *can)
 
void AddTObject (TObject *obj)
 
int GetNCanvases ()
 
std::string GetUniqueName (const std::string &name)
 
- Protected Member Functions inherited from RestFrames::RFBase
bool SetBody (bool body) const
 
bool SetMind (bool mind) const
 
bool SetSpirit (bool spirit) const
 
virtual bool IsSoundBody () const
 
virtual bool IsSoundMind () const
 
virtual bool IsSoundSpirit () const
 
void UnSoundBody (const std::string &function) const
 
void UnSoundMind (const std::string &function) const
 
void UnSoundSpirit (const std::string &function) const
 
void AddDependent (RFBase *dep)
 pointer to RFBase object owned by this one
 
- Protected Attributes inherited from RestFrames::RFPlot
TCanvas * m_CanvasPtr
 
- Protected Attributes inherited from RestFrames::RFBase
RFLog m_Log
 
RFBasem_This
 
- Static Protected Attributes inherited from RestFrames::RFBase
static const TVector3 m_Empty3Vector
 
static const TLorentzVector m_Empty4Vector
 

Constructor & Destructor Documentation

◆ HistPlot()

RestFrames::HistPlot::HistPlot ( const std::string &  sname,
const std::string &  stitle 
)

Standard constructor.

Parameters
snameClass instance name used for log statements
stitleClass instance title used in figures

Definition at line 40 of file HistPlot.cc.

Member Function Documentation

◆ AddPlot() [1/2]

void RestFrames::HistPlot::AddPlot ( const HistPlotVar var,
RestFrames::RFList< const HistPlotCategory cats = RestFrames::RFList<const RestFrames::HistPlotCategory>(),
bool  invert_colors = false 
)

Defines new 1D plot.

Parameters
varVariable to plot
catsList of categories to plot
invert_colorsIf true colors will invert, lighter colors will become darker and viceversa

Method will make a 1D plot. If there are different categories in cats it will create a 1D plot for each category

Definition at line 102 of file HistPlot.cc.

◆ AddPlot() [2/2]

void RestFrames::HistPlot::AddPlot ( const HistPlotVar varX,
const HistPlotVar varY,
RestFrames::RFList< const HistPlotCategory cats = RestFrames::RFList<const RestFrames::HistPlotCategory>(),
bool  invert_colors = false 
)

Defines new 2D plot.

Parameters
varXVariable to plot
varYVariable to plot
catsList of categories to plot
invert_colorsIf true colors will invert, lighter colors will become darker and viceversa

Method will make a 2D plot. If there are different categories in cats it will create a 2D plot for each category

Definition at line 165 of file HistPlot.cc.

◆ Fill() [1/2]

void RestFrames::HistPlot::Fill ( const HistPlotCategory cat,
double  weight = 1. 
)

Fills an entry for every variable corresponding to a category according to each's current value.

Parameters
catCategory
weightWeight of the event

Definition at line 255 of file HistPlot.cc.

◆ Fill() [2/2]

void RestFrames::HistPlot::Fill ( double  weight = 1.)

Fills an entry for every variable according to each's current value.

Parameters
weightWeight of the event

Definition at line 242 of file HistPlot.cc.

◆ GetNewCategory()

HistPlotCategory const & RestFrames::HistPlot::GetNewCategory ( const std::string &  name,
const std::string &  title 
)

Defines new category for plotting.

Parameters
nameName of the category
titleHistogram label

Method defines a new category for plotting histograms. Categories are used to separate different group of events.

Returns
Defined category

Definition at line 95 of file HistPlot.cc.

◆ GetNewVar()

HistPlotVar const & RestFrames::HistPlot::GetNewVar ( const std::string &  name,
const std::string &  title,
double  minval,
double  maxval,
const std::string &  unit = "" 
)

Defines new variable for plotting.

Parameters
nameName of the variable
titlex-axis label
minvalMinimum value to plot
maxvalMaximum value to plot
unitUnit of variable

Method is used to define variables to plot on a histogram.

Returns
Variable to plot
Warning
The user does not declare the variable, instead they get it from this class.

Definition at line 86 of file HistPlot.cc.

◆ SetPlotLabel()

void RestFrames::HistPlot::SetPlotLabel ( const std::string &  label)

Changes the text at the top of the plot.

Parameters
labelLabel to be set

Definition at line 568 of file HistPlot.cc.

◆ SetPlotTitle()

void RestFrames::HistPlot::SetPlotTitle ( const std::string &  title)

Sets plot's title.

Parameters
titleTitle to be set

Definition at line 572 of file HistPlot.cc.

◆ SetRebin()

void RestFrames::HistPlot::SetRebin ( int  rebin = 4)

Reduces the number of bins by a factor.

Parameters
rebinFactor to reduce bins by

Definition at line 576 of file HistPlot.cc.

◆ SetScale()

void RestFrames::HistPlot::SetScale ( double  scale = -1)

Sets the normalization of plot.

Parameters
scaleNumber to scale by
Warning
If scale is less/equal to 0. scale will be set to 0

Definition at line 553 of file HistPlot.cc.

◆ SetScaleLabel()

void RestFrames::HistPlot::SetScaleLabel ( const std::string &  label)

Sets the label of the normalization of plot.

\label Label to be set in the y or z axis

Definition at line 564 of file HistPlot.cc.

◆ WriteHist()

void RestFrames::HistPlot::WriteHist ( const std::string &  filename)

Stores all histograms in root file.

Parameters
filenameOutput root file

Definition at line 581 of file HistPlot.cc.

Collaboration diagram for RestFrames::HistPlot:
Collaboration graph
[legend]

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