CMS 3D CMS Logo

SingleGaussianState.h
Go to the documentation of this file.
1 #ifndef SingleGaussianState_H
2 #define SingleGaussianState_H
3 
4 #define SMATRIX_USE_CONSTEXPR
5 
6 #include "Math/SVector.h"
7 #include "Math/SMatrix.h"
8 
13 template <unsigned int N> class SingleGaussianState {
14 public:
15  using Vector = ROOT::Math::SVector<double, N>;
16  using Matrix = ROOT::Math::SMatrix<double,N,N,ROOT::Math::MatRepSym<double,N>>;
17 
18 public:
20 
22  const Matrix& aCovariance,
23  double aWeight = 1.) :
24  theCovariance(aCovariance), theMean(aMean), theWeight(aWeight) {}
25 
27  inline double weight() const {return theWeight;}
29  inline const Vector & mean() const {return theMean;}
31  inline const Matrix & covariance() const {return theCovariance;}
33  const Matrix & weightMatrix() const;
35  inline unsigned int dimension () const {return N;}
37  void rescaleWeight (double scale) {theWeight *= scale;}
38 
39 private:
42  double theWeight;
43 
44  mutable Matrix theWeightMatrix = ROOT::Math::SMatrixNoInit();
45  mutable bool theHasWeightMatrix = false;
46 };
47 
48 #include "TrackingTools/GsfTools/interface/SingleGaussianState.icc"
49 
50 #endif
void rescaleWeight(double scale)
change weight
const Vector & mean() const
parameter vector
unsigned int dimension() const
size of parameter vector
const Matrix & covariance() const
covariance matrix
ROOT::Math::SVector< double, N > Vector
SingleGaussianState(const Vector &aMean, const Matrix &aCovariance, double aWeight=1.)
#define N
Definition: blowfish.cc:9
ROOT::Math::SMatrix< double, N, N, ROOT::Math::MatRepSym< double, N >> Matrix
double weight() const
weight
const Matrix & weightMatrix() const
weight matrix