A class representing a parameter of a model. More...
#include <BCParameter.h>
Public Member Functions | |
Constructors and destructors | |
BCParameter () | |
The default constructor. More... | |
BCParameter (const BCParameter &other) | |
Copy constructor. More... | |
BCParameter (const std::string &name, double lowerlimit, double upperlimit, const std::string &latexname="", const std::string &unitstring="") | |
A constructor. More... | |
virtual | ~BCParameter () |
Destructor. More... | |
Member functions (get) | |
virtual bool | Fixed () const |
virtual double | GetFixedValue () const |
virtual BCPrior * | GetPrior () |
virtual const BCPrior * | GetPrior () const |
virtual double | GetPrior (double x) const |
virtual double | GetLogPrior (double x) const |
Get log of value of prior at parameter value. More... | |
virtual double | GetPriorMode () const |
virtual double | GetPriorMean () const |
virtual double | GetPriorVariance () const |
virtual double | GetRandomValueAccordingToPrior (TRandom *const rng) const |
Member functions (set) | |
virtual void | SetLimits (double lowerlimit=0, double upperlimit=1) |
Set the limits of the parameter values. More... | |
virtual bool | Fix (double value) |
Fix parameter to value (set prior to delta). More... | |
virtual bool | Unfix () |
Unfix parameter. More... | |
virtual void | SetPrior (BCPrior *const prior) |
Set prior. More... | |
virtual void | SetPriorConstant () |
Set constant prior. More... | |
Member functions (miscellaneous methods) | |
std::string | OneLineSummary (bool print_prefix=true, int name_length=-1) const |
Public Member Functions inherited from BCVariable | |
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. | |
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 |
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 | 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) |
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 | 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... | |
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... | |
operators and swap | |
BCParameter & | operator= (BCParameter other) |
Copy operator. | |
void | swap (BCParameter &A, BCParameter &B) |
swap | |
Additional Inherited Members | |
Protected Attributes inherited from BCVariable | |
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 parameter of a model.
- Version
- 1.0
- Date
- 08.2008
This class represents a parameter of a model. It contains information about the name and the range of the parameter.
Definition at line 34 of file BCParameter.h.
Constructor & Destructor Documentation
BCParameter::BCParameter | ( | ) |
The default constructor.
Definition at line 26 of file BCParameter.cxx.
BCParameter::BCParameter | ( | const BCParameter & | other | ) |
Copy constructor.
Definition at line 36 of file BCParameter.cxx.
BCParameter::BCParameter | ( | const std::string & | name, |
double | lowerlimit, | ||
double | upperlimit, | ||
const std::string & | latexname = "" , |
||
const std::string & | unitstring = "" |
||
) |
A constructor.
- Parameters
-
name The name of the parameter. lowerlimit The lower limit of the parameter values. upperlimit The upper limit of the parameter values. latexname The latex name of the parameter used in axis labeling. unitstring Unit string to be printed for parameter.
Definition at line 47 of file BCParameter.cxx.
|
virtual |
Destructor.
Definition at line 59 of file BCParameter.cxx.
Member Function Documentation
|
inlinevirtual |
Fix parameter to value (set prior to delta).
- Parameters
-
value value to fix parameter to.
Definition at line 141 of file BCParameter.h.
|
inlinevirtual |
- Returns
- Whether parameter is fixed to a value.
Definition at line 81 of file BCParameter.h.
|
inlinevirtual |
- Returns
- Value parameter may be fixed to.
Definition at line 86 of file BCParameter.h.
|
virtual |
Get log of value of prior at parameter value.
- Parameters
-
x Value of parameter to return prior of.
- Returns
- log of prior value at parameter value.
Definition at line 91 of file BCParameter.cxx.
|
inlinevirtual |
- Returns
- prior object
Definition at line 91 of file BCParameter.h.
|
inlinevirtual |
- Returns
- prior object
Definition at line 96 of file BCParameter.h.
|
inlinevirtual |
- Returns
- prior evaluated from prior object
Definition at line 101 of file BCParameter.h.
|
virtual |
- Returns
- prior's mean in parameter range. (For absolute mean, get prior object.)
Definition at line 109 of file BCParameter.cxx.
|
virtual |
- Returns
- prior's mode in parameter range. (For absolute mode, get prior object.)
Definition at line 101 of file BCParameter.cxx.
|
virtual |
- Returns
- prior's variance in parameter range. (For absolute variance, get prior object.)
Definition at line 117 of file BCParameter.cxx.
|
virtual |
- Returns
- a random value distributed according to the prior.
- Parameters
-
rng Pointer to the random generator to be used, if needed.
Definition at line 125 of file BCParameter.cxx.
|
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 from BCVariable.
Definition at line 151 of file BCParameter.cxx.
|
virtual |
Set the limits of the parameter values.
- Parameters
-
lowerlimit The lower limit of the variable values. upperlimit The upper limit of the variable values.
Reimplemented from BCVariable.
Definition at line 81 of file BCParameter.cxx.
|
virtual |
|
virtual |
Set constant prior.
Definition at line 145 of file BCParameter.cxx.
|
inlinevirtual |
Unfix parameter.
Definition at line 146 of file BCParameter.h.
The documentation for this class was generated from the following files:
- /root/bat/BAT/BCParameter.h
- /root/bat/src/BCParameter.cxx