Container for a set of reweightable parameters. More...
#include <EventWeightParameterSet.h>
Public Types | |
enum | rwtype { kDefault = -1, kMultisim = 0, kPMNSigma = 1, kFixed = 2, kMultisigma = 3 } |
typedef enum sbn::evwgh::EventWeightParameterSet::rwtype | ReweightType |
Public Member Functions | |
EventWeightParameterSet () | |
void | Configure (std::string name, ReweightType rwtype, size_t nuni=1) |
void | Configure (std::string name, std::string rwtype_string, size_t nuni=1) |
void | AddParameter (std::string name, float width, float mean=0, size_t covIndex=0) |
void | AddParameter (std::string name, std::vector< float > widths, float mean=0, size_t covIndex=0) |
void | SetCovarianceMatrix (TMatrixD *cov) |
void | Sample (CLHEP::HepRandomEngine &engine) |
Public Attributes | |
std::map< EventWeightParameter, std::vector< float > > | fParameterMap |
Mapping of definitions to the set of values. More... | |
TMatrixD * | fCovarianceMatrix |
Covariance matrix for correlated throws (optional) More... | |
std::string | fName |
Name of the parameter set. More... | |
ReweightType | fRWType |
Type of throws (the same for all parameters in a set) More... | |
size_t | fNuniverses |
Number of universes (i.e. random throws) More... | |
Friends | |
bool | operator== (const EventWeightParameterSet &lhs, const EventWeightParameterSet &rhs) |
Container for a set of reweightable parameters.
This class performs the random sampling of reweightable parameters according to user configuration and provides persistence of the sampled values.
Definition at line 61 of file EventWeightParameterSet.h.
typedef enum sbn::evwgh::EventWeightParameterSet::rwtype sbn::evwgh::EventWeightParameterSet::ReweightType |
The type of random throws to perform.
The type of random throws to perform.
Enumerator | |
---|---|
kDefault | |
kMultisim | |
kPMNSigma | |
kFixed | |
kMultisigma |
Definition at line 65 of file EventWeightParameterSet.h.
|
inline |
Default constructor.
Definition at line 75 of file EventWeightParameterSet.h.
void sbn::evwgh::EventWeightParameterSet::AddParameter | ( | std::string | name, |
float | width, | ||
float | mean = 0 , |
||
size_t | covIndex = 0 |
||
) |
Add a new parameter to the set.
name | Name of the parameter |
width | Standard deviation for Gaussian throws |
mean | Optional nonzero mean for Gaussian throws |
covIndex | Optional Index in the (optional) covariance matrix |
Definition at line 51 of file EventWeightParameterSet.cxx.
void sbn::evwgh::EventWeightParameterSet::AddParameter | ( | std::string | name, |
std::vector< float > | widths, | ||
float | mean = 0 , |
||
size_t | covIndex = 0 |
||
) |
Definition at line 57 of file EventWeightParameterSet.cxx.
void sbn::evwgh::EventWeightParameterSet::Configure | ( | std::string | name, |
ReweightType | rwtype, | ||
size_t | nuni = 1 |
||
) |
Configure the parameter set.
name | Name of the parameter set |
rwtype | Specifies the type of random throws to perform |
nuni | Number of random throws (universes) |
Definition at line 12 of file EventWeightParameterSet.cxx.
void sbn::evwgh::EventWeightParameterSet::Configure | ( | std::string | name, |
std::string | rwtype_string, | ||
size_t | nuni = 1 |
||
) |
Configure the parameter set with a string reweight type,
name | Name of the parameter set |
rwtype_string | Specifies the type of random throws to perform |
nuni | Number of random throws (universes) |
Definition at line 38 of file EventWeightParameterSet.cxx.
void sbn::evwgh::EventWeightParameterSet::Sample | ( | CLHEP::HepRandomEngine & | engine | ) |
Perform the random sampling.
This function should be called only after the parameter set has been configured and all parameters have been added. It will perform the random sampling of all parameters to populate the parameter map (fParameterMap) which contains the parameter values for universe for each parameter.
A random number generator engine is provided here, to enable throws with different, fixed user-controlled random seeds for each parameter set.
engine | The random number generator engine to use for sampling. |
Definition at line 63 of file EventWeightParameterSet.cxx.
|
inline |
Specify a covariance matrix for correlated throws.
Note: use the covIndex argument to AddParameter to specify the index in the covariance matrix that corresponds to a particular parameter.
cov | The covariance matrix |
Definition at line 124 of file EventWeightParameterSet.h.
|
friend |
Equality operator, testing equality of all members.
Definition at line 78 of file EventWeightParameterSet.h.
TMatrixD* sbn::evwgh::EventWeightParameterSet::fCovarianceMatrix |
Covariance matrix for correlated throws (optional)
Definition at line 144 of file EventWeightParameterSet.h.
std::string sbn::evwgh::EventWeightParameterSet::fName |
Name of the parameter set.
Definition at line 145 of file EventWeightParameterSet.h.
size_t sbn::evwgh::EventWeightParameterSet::fNuniverses |
Number of universes (i.e. random throws)
Definition at line 147 of file EventWeightParameterSet.h.
std::map<EventWeightParameter, std::vector<float> > sbn::evwgh::EventWeightParameterSet::fParameterMap |
Mapping of definitions to the set of values.
Definition at line 143 of file EventWeightParameterSet.h.
ReweightType sbn::evwgh::EventWeightParameterSet::fRWType |
Type of throws (the same for all parameters in a set)
Definition at line 146 of file EventWeightParameterSet.h.