WeightCalc.h
Go to the documentation of this file.
1 #ifndef _WEIGHTCALC_H_
2 #define _WEIGHTCALC_H_
3 
5 namespace fhicl { class ParameterSet; }
6 namespace CLHEP {
7  class HepRandomEngine;
8  class RandGaussQ;
9 }
10 
11 #include "TMatrixD.h"
12 #include <string>
13 #include <map>
14 
15 //weight calc base
16 namespace evwgh {
17  typedef std::map<std::string, std::vector<double> > WeightMap_t;
18 
19  class WeightCalc
20  {
21  public:
22  virtual void Configure(fhicl::ParameterSet const& pset,
23  CLHEP::HepRandomEngine&) = 0;
24  virtual std::vector<std::vector<double> > GetWeight(art::Event & e) = 0;
25  void SetName(std::string name) {fName=name;}
26  std::string GetName() {return fName;}
27 
28  /**
29  * @brief Applies Gaussian smearing to a set of data
30  * @param centralValues the values to be smeared
31  * @param inputCovarianceMatrix covariance matrix for smearing
32  * @param n_multisims number of sets of smeared values to be produced
33  * @return a set of n_multisims value sets smeared from the central value
34  *
35  * If centralValues is of dimension N, inputCovarianceMatrix needs to be NxN,
36  * and each of the returned data sets will be also of dimension N.
37  */
38  static std::vector<std::vector<double> > MultiGaussianSmearing(
39  std::vector<double> const& centralValues,
40  std::vector< std::vector<double>> const& inputCovarianceMatrix,
41  int n_multisims, CLHEP::RandGaussQ& GaussRandom);
42 
43  static std::vector<double> MultiGaussianSmearing(
44  std::vector<double> const& centralValue,
45  TMatrixD* const& inputCovarianceMatrix,
46  std::vector<double> rand);
47 
48  static std::vector<double> MultiGaussianSmearing(
49  std::vector<double> const& centralValue,
50  TMatrixD* const& LowerTriangleCovarianceMatrix,
51  bool isDecomposed,
52  std::vector<double> rand);
53 
54 
55  private:
57  };
58 
59 }
60 
61 #endif // _WEIGHTCALC_H_
static QCString name
Definition: declinfo.cpp:673
std::map< std::string, std::vector< double > > WeightMap_t
Definition: WeightCalc.h:17
std::string string
Definition: nybbler.cc:12
struct vector vector
std::string GetName()
Definition: WeightCalc.h:26
const double e
void SetName(std::string name)
Definition: WeightCalc.h:25
std::string fName
Definition: WeightCalc.h:56
void Configure(string mesg)
Definition: gEvServ.cxx:196