CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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> class SingleGaussianState {
14 public:
15  typedef ROOT::Math::SVector<double, N> Vector;
16  typedef ROOT::Math::SMatrix<double,N,N,ROOT::Math::MatRepSym<double,N> > Matrix;
17 
18 public:
21 // ++instances_;++maxInstances_;
22  }
23 
24 // SingleGaussianState(const SingleGaussianState<N>& rhs) :
25 // theWeight(rhs.theWeight), theMean(rhs.theMean), theCovariance(rhs.theCovariance),
26 // theHasWeightMatrix(rhs.theHasWeightMatrix), theWeightMatrix(rhs.theWeightMatrix) {
27 // ++instances_;++maxInstances_;
28 // }
29 
31  const Matrix& aCovariance,
32  double aWeight = 1.) :
33  theCovariance(aCovariance), theMean(aMean), theWeight(aWeight),
35 // ++instances_;++maxInstances_;
36  }
37 
39 // --instances_;
40  }
41 
42  // /**
43 // * Creates a new single-state with the given information.
44 // * For this base class, no information is passed from the initial
45 // * instance.
46 // */
47 // SingleGaussianState
48 // createState(const AlgebraicVector & aMean,
49 // const AlgebraicSymMatrix & aCovariance, double aWeight = 1) const;
50 
52  inline double weight() const {return theWeight;}
54  inline const Vector & mean() const {return theMean;}
56  inline const Matrix & covariance() const {return theCovariance;}
58  const Matrix & weightMatrix() const;
60  inline unsigned int dimension () const {return N;}
62  void rescaleWeight (double scale) {theWeight *= scale;}
63 
64 // protected:
65 private:
68  double theWeight;
69 
70  mutable Matrix theWeightMatrix = ROOT::Math::SMatrixNoInit();
71  mutable bool theHasWeightMatrix;
72 
73 // public:
74 // static int instances_;
75 // static int maxInstances_;
76 // static int constructsWeightMatrix_;
77 };
78 
79 #include "TrackingTools/GsfTools/interface/SingleGaussianState.icc"
80 
81 // template <unsigned int N> int SingleGaussianState<N>::instances_ = 0;
82 // template <unsigned int N> int SingleGaussianState<N>::maxInstances_ = 0;
83 // template <unsigned int N> int SingleGaussianState<N>::constructsWeightMatrix_ = 0;
84 #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
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
ROOT::Math::SVector< double, N > Vector
volatile std::atomic< bool > shutdown_flag false
double weight() const
weight
const Matrix & weightMatrix() const
weight matrix