#include <WeightCalc.h>
|
virtual void | Configure (fhicl::ParameterSet const &pset, CLHEP::HepRandomEngine &)=0 |
|
virtual std::vector
< std::vector< double > > | GetWeight (art::Event &e)=0 |
|
void | SetName (std::string name) |
|
std::string | GetName () |
|
|
static std::vector
< std::vector< double > > | MultiGaussianSmearing (std::vector< double > const ¢ralValues, std::vector< std::vector< double >> const &inputCovarianceMatrix, int n_multisims, CLHEP::RandGaussQ &GaussRandom) |
| Applies Gaussian smearing to a set of data. More...
|
|
static std::vector< double > | MultiGaussianSmearing (std::vector< double > const ¢ralValue, TMatrixD *const &inputCovarianceMatrix, std::vector< double > rand) |
| Over load of the above function that only returns a single varied parameter set. More...
|
|
static std::vector< double > | MultiGaussianSmearing (std::vector< double > const ¢ralValue, TMatrixD *const &LowerTriangleCovarianceMatrix, bool isDecomposed, std::vector< double > rand) |
|
virtual void evwgh::WeightCalc::Configure |
( |
fhicl::ParameterSet const & |
pset, |
|
|
CLHEP::HepRandomEngine & |
|
|
) |
| |
|
pure virtual |
std::string evwgh::WeightCalc::GetName |
( |
| ) |
|
|
inline |
virtual std::vector<std::vector<double> > evwgh::WeightCalc::GetWeight |
( |
art::Event & |
e | ) |
|
|
pure virtual |
static std::vector<std::vector<double> > evwgh::WeightCalc::MultiGaussianSmearing |
( |
std::vector< double > const & |
centralValues, |
|
|
std::vector< std::vector< double >> const & |
inputCovarianceMatrix, |
|
|
int |
n_multisims, |
|
|
CLHEP::RandGaussQ & |
GaussRandom |
|
) |
| |
|
static |
Applies Gaussian smearing to a set of data.
- Parameters
-
centralValues | the values to be smeared |
inputCovarianceMatrix | covariance matrix for smearing |
n_multisims | number of sets of smeared values to be produced |
- Returns
- a set of n_multisims value sets smeared from the central value
If centralValues is of dimension N, inputCovarianceMatrix needs to be NxN, and each of the returned data sets will be also of dimension N.
std::vector< double > evwgh::WeightCalc::MultiGaussianSmearing |
( |
std::vector< double > const & |
centralValue, |
|
|
TMatrixD *const & |
inputCovarianceMatrix, |
|
|
std::vector< double > |
rand |
|
) |
| |
|
static |
Over load of the above function that only returns a single varied parameter set.
Definition at line 102 of file WeightCalc.cxx.
106 std::vector<double> smearedCentralValues;
117 TDecompChol dc = TDecompChol(*(inputCovarianceMatrix));
120 throw art::Exception(art::errors::StdException)
121 <<
"Cannot decompose covariance matrix to begin smearing.";
122 return smearedCentralValues;
127 TMatrixD U = dc.GetU();
130 for(
unsigned int col = 0; col < centralValue.size(); ++col)
133 double weightFromU = 0.;
135 for(
unsigned int row = 0;
row < col+1; ++
row)
137 weightFromU += U(
row,col)*rand[
row];
143 smearedCentralValues.push_back(weightFromU + centralValue[col]);
145 return smearedCentralValues;
std::vector< double > evwgh::WeightCalc::MultiGaussianSmearing |
( |
std::vector< double > const & |
centralValue, |
|
|
TMatrixD *const & |
LowerTriangleCovarianceMatrix, |
|
|
bool |
isDecomposed, |
|
|
std::vector< double > |
rand |
|
) |
| |
|
static |
Definition at line 159 of file WeightCalc.cxx.
163 std::vector<double> smearedCentralValues;
167 throw art::Exception(art::errors::StdException)
168 <<
"Must supply the decomposed lower triangular covariance matrix.";
169 return smearedCentralValues;
173 for(
unsigned int col = 0; col < centralValue.size(); ++col)
176 double weightFromU = 0.;
178 for(
unsigned int row = 0;
row < col+1; ++
row)
180 weightFromU += LowerTriangleCovarianceMatrix[0][
row][col]*rand[
row];
186 smearedCentralValues.push_back(weightFromU + centralValue[col]);
188 return smearedCentralValues;
void evwgh::WeightCalc::SetName |
( |
std::string |
name | ) |
|
|
inline |
std::string evwgh::WeightCalc::fName |
|
private |
The documentation for this class was generated from the following files: