6 #include "CLHEP/Random/RandGaussQ.h"
31 std::cerr <<
"EventWeightParameterSet: Unknown reweight type " <<
fRWType << std::endl;
45 std::cerr <<
"EventWeightParameterSet: Unknown reweight type " << rwtype_string << std::endl;
52 std::string
name,
float width,
float mean,
size_t covIndex) {
58 std::string name, std::vector<float> widths,
float mean,
size_t covIndex) {
65 std::cerr <<
"EventWeightParameterSet: Must be configured before sampling." << std::endl;
76 float r = p.
fWidth*CLHEP::RandGaussQ::shoot(&engine, p.
fMean, 1);
77 it.second.push_back(r);
88 for(
size_t j=0; j<p.
fWidths.size(); j++){
99 std::cerr <<
"EventWeightParameterSet: Unknown reweight type " <<
fRWType << std::endl;
107 std::cerr <<
"EventWeightParameterSet: Multivariate Gaussian sampling is not implemented." << std::endl;
void AddParameter(std::string name, float width, float mean=0, size_t covIndex=0)
float fMean
Gaussian mean.
BEGIN_PROLOG could also be cerr
float fWidth
Gaussian sigma.
enum sbn::evwgh::EventWeightParameterSet::rwtype ReweightType
void Configure(std::string name, ReweightType rwtype, size_t nuni=1)
TMatrixD * fCovarianceMatrix
Covariance matrix for correlated throws (optional)
ReweightType fRWType
Type of throws (the same for all parameters in a set)
A single parameter to be reweighted.
void Sample(CLHEP::HepRandomEngine &engine)
std::map< EventWeightParameter, std::vector< float > > fParameterMap
Mapping of definitions to the set of values.
size_t fNuniverses
Number of universes (i.e. random throws)
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
std::string fName
Name of the parameter set.
std::vector< float > fWidths
for multi sigma modes