CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
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.)
ROOT::Math::SMatrix< double, N, N, ROOT::Math::MatRepSym< double, N >> Matrix
#define N
Definition: blowfish.cc:9
double weight() const
weight
const Matrix & weightMatrix() const
weight matrix