All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
larsim/larsim/EventWeight/Base/WeightCalc.h
Go to the documentation of this file.
1 #ifndef _WEIGHTCALC_H_
2 #define _WEIGHTCALC_H_
3 
4 #include "art/Framework/Principal/fwd.h"
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:
56  std::string fName;
57  };
58 
59 }
60 
61 #endif // _WEIGHTCALC_H_
std::map< std::string, std::vector< double > > WeightMap_t
virtual void Configure(fhicl::ParameterSet const &pset, CLHEP::HepRandomEngine &)=0
static std::vector< std::vector< double > > MultiGaussianSmearing(std::vector< double > const &centralValues, std::vector< std::vector< double >> const &inputCovarianceMatrix, int n_multisims, CLHEP::RandGaussQ &GaussRandom)
Applies Gaussian smearing to a set of data.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
do i e
then echo fcl name
virtual std::vector< std::vector< double > > GetWeight(art::Event &e)=0