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
SingleGaussianState::theWeight
double theWeight
Definition: SingleGaussianState.h:41
HLT_FULL_cff.scale
scale
Definition: HLT_FULL_cff.py:6637
SingleGaussianState::weight
double weight() const
weight
Definition: SingleGaussianState.h:26
SingleGaussianState::theMean
Vector theMean
Definition: SingleGaussianState.h:40
SingleGaussianState::theCovariance
Matrix theCovariance
Definition: SingleGaussianState.h:39
SingleGaussianState::covariance
const Matrix & covariance() const
covariance matrix
Definition: SingleGaussianState.h:30
N
#define N
Definition: blowfish.cc:9
SingleGaussianState::Matrix
ROOT::Math::SMatrix< double, N, N, ROOT::Math::MatRepSym< double, N > > Matrix
Definition: SingleGaussianState.h:17
SingleGaussianState::SingleGaussianState
SingleGaussianState(const Vector &aMean, const Matrix &aCovariance, double aWeight=1.)
Definition: SingleGaussianState.h:22
SingleGaussianState
Definition: SingleGaussianState.h:14
SingleGaussianState::theHasWeightMatrix
bool theHasWeightMatrix
Definition: SingleGaussianState.h:44
SingleGaussianState::dimension
unsigned int dimension() const
size of parameter vector
Definition: SingleGaussianState.h:34
SingleGaussianState::SingleGaussianState
SingleGaussianState()
Definition: SingleGaussianState.h:20
SingleGaussianState::Vector
ROOT::Math::SVector< double, N > Vector
Definition: SingleGaussianState.h:16
SingleGaussianState::weightMatrix
const Matrix & weightMatrix() const
weight matrix
SingleGaussianState::rescaleWeight
void rescaleWeight(double scale)
change weight
Definition: SingleGaussianState.h:36
SingleGaussianState::theWeightMatrix
Matrix theWeightMatrix
Definition: SingleGaussianState.h:43
SingleGaussianState::mean
const Vector & mean() const
parameter vector
Definition: SingleGaussianState.h:28