#include <WeightCalc.h>
Definition at line 19 of file WeightCalc.h.
virtual void evwgh::WeightCalc::Configure |
( |
fhicl::ParameterSet const & |
pset, |
|
|
CLHEP::HepRandomEngine & |
|
|
) |
| |
|
pure virtual |
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));
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;
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
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;
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;
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
The documentation for this class was generated from the following files: