BCParameterSet Class Reference

Wrapper to allow access by name into list of BCParameter. More...

#include <BCParameterSet.h>

Inheritance diagram for BCParameterSet:
[legend]
Collaboration diagram for BCParameterSet:
[legend]

Public Member Functions

virtual bool ApplyFixedValues (std::vector< double > &x) const
 Change values to fixed values for fixed parameters. More...
 
virtual bool ArePriorsSet (bool ignore_fixed=true) const
 Check whether all parameters have factorized priors set. More...
 
 BCParameterSet ()
 Constructor.
 
virtual std::vector< double > GetFixedValues (bool include_unfixed=true) const
 Get vector of fixed values. More...
 
virtual double GetLogPrior (const std::vector< double > &parameters) const
 Get log of prior; assumes independent priors given for all parameters in set. More...
 
virtual unsigned int GetNFixedParameters () const
 
virtual unsigned int GetNFreeParameters () const
 
virtual std::vector< double > GetRandomValuesAccordingToPriors (TRandom *const R) const
 Get vector values distributed randomly by the parameter priors. More...
 
virtual std::vector< double > GetRangeCenters () const
 Get range centers, leaving fixed parameters at fixed values. More...
 
virtual std::vector< double > GetUniformRandomValues (TRandom *const R) const
 Get vector of values uniformly distributed in parameter ranges (or at fixed values, if fixed) More...
 
virtual bool IsAtFixedValues (const std::vector< double > &x) const
 Check if fixed parameters in vector of values are at fixed values. More...
 
virtual bool IsWithinLimits (const std::vector< double > &x) const
 Check if vector of values is within limits. More...
 
virtual void SetPriorConstantAll ()
 Set all priors to constant. More...
 
virtual void ValueFromPositionInRange (std::vector< double > &p) const
 Translate from unit interval to values in variable ranges, fixing fixed parameters along the way. More...
 
virtual double Volume () const
 
virtual ~BCParameterSet ()
 Destructor.
 
- Public Member Functions inherited from BCVariableSet< BCParameter >
virtual bool Add (const BCParameter &var)
 Add a variable if no variable of same name exists yet. More...
 
virtual bool Add (const std::string &name, double min, double max, const std::string &latexname="", const std::string &unitstring="")
 Add a variable. More...
 
virtual BCParameterAt (unsigned index)
 Safe access, but slightly less efficient access to parameter. More...
 
virtual const BCParameterAt (unsigned index) const
 Safe access, but slightly less efficient access to parameter. More...
 
virtual BCParameterBack ()
 Access to last pushed variable. More...
 
virtual const BCParameterBack () const
 Access to last pushed variable. More...
 
 BCVariableSet ()
 Constructor.
 
virtual bool Empty () const
 Whether container is empty.
 
virtual void FillH1 (bool flag)
 Set fill-histograms flag for all 1D histograms for all parameters. More...
 
virtual void FillH2 (bool flag)
 Set fill-histograms flag for all 2D histograms for all parameters. More...
 
virtual void FillHistograms (bool flag)
 Set fill-histograms flag for 1D and 2D histograms for all parameters. More...
 
virtual void FillHistograms (bool flag_1d, bool flag_2d)
 Set fill-histograms flag for 1D and 2D histograms for all parameters. More...
 
virtual BCParameterGet (const std::string &name)
 Safe access, but slightly less efficient access to parameter. More...
 
virtual const BCParameterGet (const std::string &name) const
 Safe access, but slightly less efficient access to parameter. More...
 
virtual unsigned Index (const std::string &name) const
 Find index of parameter identified by name; return Size() if name not found. More...
 
virtual unsigned MaxNameLength () const
 
virtual BCParameteroperator[] (unsigned index)
 Raw and fast access. More...
 
virtual const BCParameteroperator[] (unsigned index) const
 Raw and fast access. More...
 
virtual std::vector< double > PositionInRange (const std::vector< double > &x) const
 return positions in ranges of given values from 0 (at lower limit) to 1 (at upper limit) for each variable in the set. More...
 
virtual void PrintSummary () const
 Print summary of variable set to logs. More...
 
virtual void SetNBins (unsigned nbins)
 Set number of bins for all parameters. More...
 
virtual void SetPrecision (unsigned n)
 Set precision for output of all parameters. More...
 
virtual unsigned Size () const
 Number of variables contained.
 

Additional Inherited Members

- Protected Attributes inherited from BCVariableSet< BCParameter >
unsigned fMaxNameLength
 Maximum length (in characters) of variable names. More...
 
std::vector< BCParameterfVars
 Vector of BCVariables that forms the set. More...
 

Detailed Description

Wrapper to allow access by name into list of BCParameter.

Author
Frederik Beaujean
Daniel Greenwald
Note
Parameters are not owned, and will not be deleted by BCParameterSet.

Definition at line 30 of file BCParameterSet.h.

Member Function Documentation

bool BCParameterSet::ApplyFixedValues ( std::vector< double > &  x) const
virtual

Change values to fixed values for fixed parameters.

Parameters
xVector of parameter values to adjust.

Definition at line 153 of file BCParameterSet.cxx.

bool BCParameterSet::ArePriorsSet ( bool  ignore_fixed = true) const
virtual

Check whether all parameters have factorized priors set.

Parameters
ignore_fixedWhether to ignore fixed parameters.
Returns
Whether all parameters have factorized priors set.

Definition at line 81 of file BCParameterSet.cxx.

std::vector< double > BCParameterSet::GetFixedValues ( bool  include_unfixed = true) const
virtual

Get vector of fixed values.

Parameters
include_unfixedFlag for whether to return fixed values (true) or infinity (false) for unfixed parameters.
Returns
vector of fixed values for all parameters.

Definition at line 71 of file BCParameterSet.cxx.

double BCParameterSet::GetLogPrior ( const std::vector< double > &  parameters) const
virtual

Get log of prior; assumes independent priors given for all parameters in set.

Parameters
parametersvector of parameters to return prior at.
Returns
log of prior at parameter set value.

Definition at line 55 of file BCParameterSet.cxx.

unsigned int BCParameterSet::GetNFixedParameters ( ) const
virtual
Returns
The number of fixed parameters.

Definition at line 23 of file BCParameterSet.cxx.

virtual unsigned int BCParameterSet::GetNFreeParameters ( ) const
inlinevirtual
Returns
The number of free parameters.

Definition at line 48 of file BCParameterSet.h.

std::vector< double > BCParameterSet::GetRandomValuesAccordingToPriors ( TRandom *const  R) const
virtual

Get vector values distributed randomly by the parameter priors.

Parameters with unset priors will have infinite values. Fixed parameters will be at fixed values. One should first call BCParameterSet::ArePriorsSet to be safe.

Parameters
RRandom number generator to use.
Returns
vector of random values distributed according to priors.

Definition at line 144 of file BCParameterSet.cxx.

std::vector< double > BCParameterSet::GetRangeCenters ( ) const
virtual

Get range centers, leaving fixed parameters at fixed values.

Returns
vector of range centers & fixed values.

Reimplemented from BCVariableSet< BCParameter >.

Definition at line 126 of file BCParameterSet.cxx.

std::vector< double > BCParameterSet::GetUniformRandomValues ( TRandom *const  R) const
virtual

Get vector of values uniformly distributed in parameter ranges (or at fixed values, if fixed)

Returns
vector of uniformly distributed random values.

Reimplemented from BCVariableSet< BCParameter >.

Definition at line 135 of file BCParameterSet.cxx.

bool BCParameterSet::IsAtFixedValues ( const std::vector< double > &  x) const
virtual

Check if fixed parameters in vector of values are at fixed values.

Parameters
xValues to check.
Returns
Whether values are at fixed values.

Definition at line 106 of file BCParameterSet.cxx.

bool BCParameterSet::IsWithinLimits ( const std::vector< double > &  x) const
virtual

Check if vector of values is within limits.

Check if fixed parameters are at fixed values.

Parameters
xValues to check
Returns
Whether values are within limits of variables.

Reimplemented from BCVariableSet< BCParameter >.

Definition at line 92 of file BCParameterSet.cxx.

void BCParameterSet::SetPriorConstantAll ( )
virtual

Set all priors to constant.

Definition at line 48 of file BCParameterSet.cxx.

void BCParameterSet::ValueFromPositionInRange ( std::vector< double > &  p) const
virtual

Translate from unit interval to values in variable ranges, fixing fixed parameters along the way.

Parameters
pvector of positions in the unit interval (0 = lower limit, 1 = upper limit).

Reimplemented from BCVariableSet< BCParameter >.

Definition at line 117 of file BCParameterSet.cxx.

double BCParameterSet::Volume ( ) const
virtual
Returns
volume of the set.

Reimplemented from BCVariableSet< BCParameter >.

Definition at line 33 of file BCParameterSet.cxx.


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