All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SmearingUtils.h
Go to the documentation of this file.
1 #ifndef _SBN_SMEARINGUTILS_H_
2 #define _SBN_SMEARINGUTILS_H_
3 
4 /**
5  * Multivariate Gaussian sampling utilities.
6  *
7  * Original author: J. Zennamo.
8  *
9  * Note: In larsim EventWeight, these functions are static members of the
10  * WeightCalc class.
11  */
12 
13 #include "CLHEP/Random/RandGaussQ.h"
14 #include "TMatrixD.h"
15 #include <vector>
16 
17 namespace sbn {
18  namespace evwgh {
19 
20 /**
21  * Apply Gaussian smearing to a set of data.
22  *
23  * If centralValues is of dimension N, inputCovarianceMatrix needs to be NxN,
24  * and each of the returned data sets will be also of dimension N.
25  *
26  * @param centralValues the values to be smeared
27  * @param inputCovarianceMatrix covariance matrix for smearing
28  * @param n_multisims number of sets of smeared values to be produced
29  * @return a set of n_multisims value sets smeared from the central value
30  */
31 std::vector<std::vector<double> > MultiGaussianSmearing(
32  std::vector<double> const& centralValues,
33  std::vector<std::vector<double> > const& inputCovarianceMatrix,
34  int n_multisims,
35  CLHEP::RandGaussQ& GaussRandom);
36 
37 std::vector<double> MultiGaussianSmearing(
38  std::vector<double> const& centralValue,
39  TMatrixD* const& inputCovarianceMatrix,
40  std::vector<float> rand);
41 
42 std::vector<double> MultiGaussianSmearing(
43  std::vector<double> const& centralValue,
44  TMatrixD* const& LowerTriangleCovarianceMatrix,
45  bool isDecomposed,
46  std::vector<float> rand);
47 
48  } // namespace evwgh
49 } // namespace sbn
50 
51 #endif // _SBN_SMEARINGUTILS_H_
52 
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
std::vector< std::vector< double > > MultiGaussianSmearing(std::vector< double > const &centralValue, std::vector< std::vector< double > > const &inputCovarianceMatrix, int n_multisims, CLHEP::RandGaussQ &GaussRandom)