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>
15 public:
16  using Vector = ROOT::Math::SVector<double, N>;
17  using Matrix = ROOT::Math::SMatrix<double, N, N, ROOT::Math::MatRepSym<double, N>>;
18 
19 public:
21 
22  SingleGaussianState(const Vector& aMean, const Matrix& aCovariance, double aWeight = 1.)
23  : theCovariance(aCovariance), theMean(aMean), theWeight(aWeight) {}
24 
26  inline double weight() const { return theWeight; }
28  inline const Vector& mean() const { return theMean; }
30  inline const Matrix& covariance() const { return theCovariance; }
32  const Matrix& weightMatrix() const;
34  inline unsigned int dimension() const { return N; }
36  void rescaleWeight(double scale) { theWeight *= scale; }
37 
38 private:
41  double theWeight;
42 
43  mutable Matrix theWeightMatrix = ROOT::Math::SMatrixNoInit();
44  mutable bool theHasWeightMatrix = false;
45 };
46 
47 #include "TrackingTools/GsfTools/interface/SingleGaussianState.icc"
48 
49 #endif
ROOT::Math::SMatrix< double, N, N, ROOT::Math::MatRepSym< double, N > > Matrix
const Matrix & weightMatrix() const
weight matrix
unsigned int dimension() const
size of parameter vector
void rescaleWeight(double scale)
change weight
const Matrix & covariance() const
covariance matrix
ROOT::Math::SVector< double, N > Vector
SingleGaussianState(const Vector &aMean, const Matrix &aCovariance, double aWeight=1.)
double weight() const
weight
#define N
Definition: blowfish.cc:9
const Vector & mean() const
parameter vector