A class representing a variable of a model. More...
#include <BCVariable.h>
Public Member Functions | |||||
Constructors and destructors | |||||
BCVariable () | |||||
The default constructor. More... | |||||
BCVariable (const std::string &name, double lowerlimit, double upperlimit, const std::string &latexname="", const std::string &unitstring="") | |||||
A constructor. More... | |||||
virtual | ~BCVariable () | ||||
Destructor. | |||||
Member functions (get) | |||||
virtual const std::string & | GetPrefix () const | ||||
virtual const std::string & | GetName () const | ||||
virtual const std::string & | GetSafeName () const | ||||
virtual const std::string & | GetLatexName () const | ||||
virtual const std::string & | GetUnitString () const | ||||
virtual std::string | GetLatexNameWithUnits () const | ||||
virtual double | GetLowerLimit () const | ||||
virtual double | GetUpperLimit () const | ||||
virtual double | GetRangeWidth () const | ||||
Returns the range width of the variable values. More... | |||||
virtual double | GetRangeCenter () const | ||||
Returns center of variable range. More... | |||||
virtual unsigned | GetPrecision () const | ||||
virtual bool | FillH1 () const | ||||
virtual bool | FillH2 () const | ||||
virtual unsigned | GetNbins () const | ||||
Member functions (set) | |||||
virtual void | SetName (const std::string &name) | ||||
virtual void | SetLatexName (const std::string &latex_name) | ||||
virtual void | SetUnitString (const std::string &unit_string) | ||||
virtual void | SetLowerLimit (double limit) | ||||
Set the lower limit of the variable values. More... | |||||
virtual void | SetUpperLimit (double limit) | ||||
Set the upper limit of the variable values. More... | |||||
virtual void | SetLimits (double lowerlimit=0, double upperlimit=1) | ||||
Set the limits of the variable values. More... | |||||
virtual void | SetPrecision (unsigned precision) | ||||
Set the precision of the output of variable. More... | |||||
virtual void | FillHistograms (bool flag) | ||||
Set the filling of 1D and 2D histograms. More... | |||||
virtual void | FillHistograms (bool fill_1d, bool fill_2d) | ||||
Set the filling of 1D and 2D histograms. More... | |||||
virtual void | FillH1 (bool flag) | ||||
Set the filling of 1D histogram. More... | |||||
virtual void | FillH2 (bool flag) | ||||
Set the filling of 2D histograms. More... | |||||
virtual void | SetNbins (unsigned nbins) | ||||
Member functions (miscellaneous methods) | |||||
virtual bool | IsNamed (const std::string &name) const | ||||
Check if name is that of variable. More... | |||||
virtual bool | IsSafeNamed (const std::string &safename) const | ||||
Check if safe name is that of variable. More... | |||||
virtual double | PositionInRange (double x) const | ||||
return position in range of given value from 0 (at lower limit) to 1 (at upper limit) More... | |||||
virtual double | ValueFromPositionInRange (double p) const | ||||
Translate from unit interval to value in variable range. More... | |||||
virtual void | CalculatePrecision (bool force=false) | ||||
Calculate the necessary precision for outputting this parameter and replace current precision is smaller or if force is set true. More... | |||||
virtual bool | IsAtLimit (double value) const | ||||
virtual bool | IsWithinLimits (double value) const | ||||
virtual void | PrintSummary () const | ||||
Prints a variable summary on the screen. More... | |||||
virtual std::string | OneLineSummary (bool print_prefix=true, int name_length=-1) const | ||||
virtual std::string | H1Title () const | ||||
virtual std::string | H2Title (const BCVariable &ordinate) const | ||||
virtual std::string | H3Title (const BCVariable &ordinate_y, const BCVariable &ordinate_z) const | ||||
virtual TH1 * | CreateH1 (const std::string &name) const | ||||
Creates a 1D Histogram for this variable. More... | |||||
name The name of the histogram. | |||||
Creates a 3D Histogram for this variable as the abcissa and a second as the ordinate.
| |||||
virtual TH2 * | CreateH2 (const std::string &name, const BCVariable &ordinate) const | ||||
virtual TH3 * | CreateH3 (const std::string &name, const BCVariable &ordinate_y, const BCVariable &ordinate_z) const | ||||
virtual double | GetUniformRandomValue (TRandom *const R) const | ||||
Get random value uniformly distributed in range. More... | |||||
Protected Attributes | |
bool | fFillH1 |
Flag to store MCMC samples in 1D histogram. | |
bool | fFillH2 |
Flag to store MCMC samples in 2D histograms. | |
std::string | fLatexName |
The latex name of the variable. | |
double | fLowerLimit |
The lower limit of the variable value. | |
std::string | fName |
The name of the variable. | |
unsigned | fNbins |
The number of equal-size bins used in histograms involving this variable. | |
unsigned | fPrecision |
Necessary precision for output. | |
std::string | fPrefix |
prefix for output | |
std::string | fSafeName |
Safe name of the variable for use in ROOT object naming. | |
std::string | fUnitString |
Unit string for variable. | |
double | fUpperLimit |
The upper limit of the variable value. | |
Detailed Description
A class representing a variable of a model.
- Version
- 1.0
- Date
- 08.2008
This class represents a variable of a model. It contains information about the name and the range of the variable.
Definition at line 35 of file BCVariable.h.
Constructor & Destructor Documentation
BCVariable::BCVariable | ( | ) |
The default constructor.
Definition at line 23 of file BCVariable.cxx.
BCVariable::BCVariable | ( | const std::string & | name, |
double | lowerlimit, | ||
double | upperlimit, | ||
const std::string & | latexname = "" , |
||
const std::string & | unitstring = "" |
||
) |
A constructor.
- Parameters
-
name The name of the variable. lowerlimit The lower limit of the variable values. upperlimit The upper limit of the variable values. latexname The latex name of the variable used in axis labeling. unitstring Unit string to be printed for variable.
Definition at line 36 of file BCVariable.cxx.
Member Function Documentation
|
virtual |
Calculate the necessary precision for outputting this parameter and replace current precision is smaller or if force is set true.
- Parameters
-
force replace current precision even if calculated precision is lower than current precision.
Definition at line 70 of file BCVariable.cxx.
|
virtual |
Creates a 1D Histogram for this variable.
- Note
- The caller is responsible for deletion of the returned object.
- Parameters
-
name Name of the histogram.
- Returns
- pointer to histogram object.
Definition at line 132 of file BCVariable.cxx.
|
inlinevirtual |
- Returns
- whether to fill 1D histogram.
Definition at line 124 of file BCVariable.h.
|
inlinevirtual |
Set the filling of 1D histogram.
Definition at line 195 of file BCVariable.h.
|
inlinevirtual |
- Returns
- whether to fill 2D histograms.
Definition at line 129 of file BCVariable.h.
|
inlinevirtual |
Set the filling of 2D histograms.
Definition at line 200 of file BCVariable.h.
|
inlinevirtual |
Set the filling of 1D and 2D histograms.
- Parameters
-
flag Toggles filling of 1D and 2D histograms.
Definition at line 183 of file BCVariable.h.
|
inlinevirtual |
Set the filling of 1D and 2D histograms.
- Parameters
-
fill_1d Toggles filling of 1D histogram. fill_2d Toggles filling of 2D histograms.
Definition at line 190 of file BCVariable.h.
|
inlinevirtual |
- Returns
- latex name if set, else identical to GetName().
Definition at line 82 of file BCVariable.h.
|
inlinevirtual |
- Returns
- latex name with unit string
Definition at line 92 of file BCVariable.h.
|
inlinevirtual |
- Returns
- The lower limit of the variable values.
Definition at line 97 of file BCVariable.h.
|
inlinevirtual |
- Returns
- The name of the variable.
Definition at line 72 of file BCVariable.h.
|
inlinevirtual |
- Returns
- Number of bins on axis in 1D and 2D histograms.
Definition at line 134 of file BCVariable.h.
|
inlinevirtual |
- Returns
- precision of output
Definition at line 119 of file BCVariable.h.
|
inlinevirtual |
- Returns
- Prefix for name of type of variable ("Parameter", "Observable")
Definition at line 67 of file BCVariable.h.
|
inlinevirtual |
Returns center of variable range.
Definition at line 114 of file BCVariable.h.
|
inlinevirtual |
Returns the range width of the variable values.
It is always a positive value.
- Returns
- The range width of the variable values.
Definition at line 109 of file BCVariable.h.
|
inlinevirtual |
- Returns
- Safe name of the variable.
Definition at line 77 of file BCVariable.h.
|
virtual |
Get random value uniformly distributed in range.
- Parameters
-
R random number generator to use
Definition at line 159 of file BCVariable.cxx.
|
inlinevirtual |
- Returns
- unit string
Definition at line 87 of file BCVariable.h.
|
inlinevirtual |
- Returns
- The upper limit of the variable values.
Definition at line 102 of file BCVariable.h.
|
virtual |
- Returns
- title appropriate for TH1
Definition at line 109 of file BCVariable.cxx.
|
virtual |
- Returns
- title appropriate for TH2
- Parameters
-
ordinate The variable to be used for the ordinate.
Definition at line 115 of file BCVariable.cxx.
|
virtual |
- Returns
- title appropriate for TH3
- Parameters
-
ordinate_y The variable to be used for the y ordinate. ordinate_z The variable to be used for the z ordinate.
Definition at line 123 of file BCVariable.cxx.
|
virtual |
- Returns
- Whether value is at upper or lower limit.
Definition at line 78 of file BCVariable.cxx.
|
inlinevirtual |
Check if name is that of variable.
- Parameters
-
name Name to check against variable name.
Definition at line 214 of file BCVariable.h.
|
inlinevirtual |
Check if safe name is that of variable.
- Parameters
-
safename Safe name to check against variable name.
Definition at line 220 of file BCVariable.h.
|
inlinevirtual |
- Returns
- Whether value is within limits.
Definition at line 250 of file BCVariable.h.
|
virtual |
- Returns
- A one line summary of the variable.
- Parameters
-
print_prefix Whether to print prefix before variable name. name_length Number of characters to pad name to (if positive)
Reimplemented in BCParameter.
Definition at line 98 of file BCVariable.cxx.
|
inlinevirtual |
return position in range of given value from 0 (at lower limit) to 1 (at upper limit)
- Parameters
-
x Value to report position of.
- Returns
- Position of value in range.
Definition at line 228 of file BCVariable.h.
|
virtual |
Prints a variable summary on the screen.
Definition at line 89 of file BCVariable.cxx.
|
inlinevirtual |
- Parameters
-
latex_name Latex-formatted name of Variable.
Definition at line 148 of file BCVariable.h.
|
virtual |
Set the limits of the variable values.
- Parameters
-
lowerlimit The lower limit of the variable values. upperlimit The upper limit of the variable values.
Reimplemented in BCParameter.
Definition at line 59 of file BCVariable.cxx.
|
inlinevirtual |
Set the lower limit of the variable values.
- Parameters
-
limit The lower limit of the variable values.
Definition at line 159 of file BCVariable.h.
|
virtual |
- Parameters
-
name The name of the variable.
Definition at line 52 of file BCVariable.cxx.
|
inlinevirtual |
Set the precision of the output of variable.
- Parameters
-
precision The precision of the variable for output.
Definition at line 177 of file BCVariable.h.
|
inlinevirtual |
- Parameters
-
unit_string String to printed to mark units of variable when needed.
Definition at line 153 of file BCVariable.h.
|
inlinevirtual |
Set the upper limit of the variable values.
- Parameters
-
limit The upper limit of the variable values.
Definition at line 165 of file BCVariable.h.
|
inlinevirtual |
Translate from unit interval to value in variable range.
- Parameters
-
p Position in unit interval (0 = lower limit, 1 = upper limit).
- Returns
- Value of variable at position in range.
Definition at line 235 of file BCVariable.h.
The documentation for this class was generated from the following files:
- /root/bat/BAT/BCVariable.h
- /root/bat/src/BCVariable.cxx