#include "WeightCalc.h"
|
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) |
|
Definition at line 18 of file WeightCalc.h.
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.
Referenced by GetName().
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 106 of file WeightCalc.cxx.
References col, and art::errors::StdException.
110 std::vector<double> smearedCentralValues;
121 TDecompChol dc = TDecompChol(*(inputCovarianceMatrix));
125 <<
"Cannot decompose covariance matrix to begin smearing.";
126 return smearedCentralValues;
131 TMatrixD U = dc.GetU();
134 for(
unsigned int col = 0;
col < centralValue.size(); ++
col)
137 double weightFromU = 0.;
139 for(
unsigned int row = 0; row <
col+1; ++row)
141 weightFromU += U(row,col)*rand[row];
147 smearedCentralValues.push_back(weightFromU + centralValue[col]);
149 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 163 of file WeightCalc.cxx.
References col, and art::errors::StdException.
167 std::vector<double> smearedCentralValues;
172 <<
"Must supply the decomposed lower triangular covariance matrix.";
173 return smearedCentralValues;
177 for(
unsigned int col = 0;
col < centralValue.size(); ++
col)
180 double weightFromU = 0.;
182 for(
unsigned int row = 0; row <
col+1; ++row)
184 weightFromU += LowerTriangleCovarianceMatrix[0][row][
col]*rand[row];
190 smearedCentralValues.push_back(weightFromU + centralValue[col]);
192 return smearedCentralValues;
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
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: