Wrapper to allow access by name into list of BCVariable. More...
#include <BCVariableSet.h>
Public Member Functions | |
virtual bool | Add (const T &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 T & | At (unsigned index) |
Safe access, but slightly less efficient access to parameter. More... | |
virtual const T & | At (unsigned index) const |
Safe access, but slightly less efficient access to parameter. More... | |
virtual T & | Back () |
Access to last pushed variable. More... | |
virtual const T & | Back () 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 T & | Get (const std::string &name) |
Safe access, but slightly less efficient access to parameter. More... | |
virtual const T & | Get (const std::string &name) const |
Safe access, but slightly less efficient access to parameter. More... | |
virtual std::vector< double > | GetRangeCenters () const |
virtual std::vector< double > | GetUniformRandomValues (TRandom *const R) const |
Get vector of uniformly distributed random values. More... | |
virtual unsigned | Index (const std::string &name) const |
Find index of parameter identified by name; return Size() if name not found. More... | |
virtual bool | IsWithinLimits (const std::vector< double > &x) const |
virtual unsigned | MaxNameLength () const |
virtual T & | operator[] (unsigned index) |
Raw and fast access. More... | |
virtual const T & | operator[] (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. | |
virtual void | ValueFromPositionInRange (std::vector< double > &p) const |
Translate from unit interval to values in variable ranges. More... | |
virtual double | Volume () const |
Protected Attributes | |
unsigned | fMaxNameLength |
Maximum length (in characters) of variable names. More... | |
std::vector< T > | fVars |
Vector of BCVariables that forms the set. More... | |
Detailed Description
template<class T>
class BCVariableSet< T >
Wrapper to allow access by name into list of BCVariable.
- Note
- Variables are owned by and will be deleted by BCVariableSet.
Definition at line 35 of file BCVariableSet.h.
Member Function Documentation
|
inlinevirtual |
Add a variable if no variable of same name exists yet.
- Parameters
-
var Variable
- Returns
- Success of action.
Definition at line 56 of file BCVariableSet.h.
|
inlinevirtual |
Add a variable.
- Parameters
-
name Name of variable min minimum value of the variable max maximum value of the variable latexname Optional latexname used for plotting unitstring Unit string to be printed for variable
- Returns
- Success of action.
Definition at line 83 of file BCVariableSet.h.
|
inlinevirtual |
Safe access, but slightly less efficient access to parameter.
- Parameters
-
index Index gets checked.
- Returns
- The pointer at index position or NULL if invalid index.
Definition at line 120 of file BCVariableSet.h.
|
inlinevirtual |
Safe access, but slightly less efficient access to parameter.
- Parameters
-
index Index gets checked.
- Returns
- The pointer at index position or NULL if invalid index.
Definition at line 127 of file BCVariableSet.h.
|
inlinevirtual |
Access to last pushed variable.
Definition at line 146 of file BCVariableSet.h.
|
inlinevirtual |
Access to last pushed variable.
Definition at line 151 of file BCVariableSet.h.
|
inlinevirtual |
Set fill-histograms flag for all 1D histograms for all parameters.
- Parameters
-
flag Filling flag.
Definition at line 210 of file BCVariableSet.h.
|
inlinevirtual |
Set fill-histograms flag for all 2D histograms for all parameters.
- Parameters
-
flag Filling flag.
Definition at line 219 of file BCVariableSet.h.
|
inlinevirtual |
Set fill-histograms flag for 1D and 2D histograms for all parameters.
- Parameters
-
flag Filling flag for both 1D and 2D histograms.
Definition at line 197 of file BCVariableSet.h.
|
inlinevirtual |
Set fill-histograms flag for 1D and 2D histograms for all parameters.
- Parameters
-
flag_1d Filling flag for 1D histograms. flag_2d Filling flag for 2D histograms.
Definition at line 204 of file BCVariableSet.h.
|
inlinevirtual |
Safe access, but slightly less efficient access to parameter.
- Parameters
-
name Look up name in list
- Returns
- The pointer at index position or NULL if invalid index.
Definition at line 134 of file BCVariableSet.h.
|
inlinevirtual |
Safe access, but slightly less efficient access to parameter.
- Parameters
-
name Look up name in list
- Returns
- The pointer at index position or NULL if invalid index.
Definition at line 141 of file BCVariableSet.h.
|
inlinevirtual |
- Returns
- vector of range centers.
Reimplemented in BCParameterSet.
Definition at line 281 of file BCVariableSet.h.
|
inlinevirtual |
Get vector of uniformly distributed random values.
- Parameters
-
R Random number generator to use.
- Returns
- vector of random values uniformly distributed in variable ranges.
Reimplemented in BCParameterSet.
Definition at line 293 of file BCVariableSet.h.
|
inlinevirtual |
Find index of parameter identified by name; return Size() if name not found.
Definition at line 157 of file BCVariableSet.h.
|
inlinevirtual |
- Returns
- Whether values are within limits of variables.
Reimplemented in BCParameterSet.
Definition at line 244 of file BCVariableSet.h.
|
inlinevirtual |
- Returns
- Length of longest parameter name.
Definition at line 227 of file BCVariableSet.h.
|
inlinevirtual |
Raw and fast access.
- Parameters
-
index Index
- Returns
- Variable
Definition at line 106 of file BCVariableSet.h.
|
inlinevirtual |
Raw and fast access.
- Parameters
-
index Index
- Returns
- Variable
Definition at line 113 of file BCVariableSet.h.
|
inlinevirtual |
return positions in ranges of given values from 0 (at lower limit) to 1 (at upper limit) for each variable in the set.
- Parameters
-
x vector of values to report positions of.
- Returns
- vector of positions of values in ranges.
Definition at line 260 of file BCVariableSet.h.
|
inlinevirtual |
Print summary of variable set to logs.
Definition at line 303 of file BCVariableSet.h.
|
inlinevirtual |
Set number of bins for all parameters.
- Parameters
-
nbins Number of bins.
Definition at line 179 of file BCVariableSet.h.
|
inlinevirtual |
Set precision for output of all parameters.
- Parameters
-
n Number of significant digits for printing.
Definition at line 188 of file BCVariableSet.h.
|
inlinevirtual |
Translate from unit interval to values in variable ranges.
- Parameters
-
p vector of positions in the unit interval (0 = lower limit, 1 = upper limit).
Reimplemented in BCParameterSet.
Definition at line 271 of file BCVariableSet.h.
|
inlinevirtual |
- Returns
- Volume of set.
Reimplemented in BCParameterSet.
Definition at line 232 of file BCVariableSet.h.
Member Data Documentation
|
protected |
Maximum length (in characters) of variable names.
Definition at line 318 of file BCVariableSet.h.
|
protected |
Vector of BCVariables that forms the set.
BCVariables are not owned by set, and are not deleted upon deletion of set.
Definition at line 314 of file BCVariableSet.h.
The documentation for this class was generated from the following file:
- /root/bat/BAT/BCVariableSet.h