CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MultiGaussianState.h
Go to the documentation of this file.
1 #ifndef MultiGaussianState_H
2 #define MultiGaussianState_H
3 
5 #include "boost/shared_ptr.hpp"
6 
7 #include <vector>
8 
9 // #include <iostream>
10 // #include <signal.h>
12 
17 template <unsigned int N>
19 public:
23  typedef boost::shared_ptr<SingleState> SingleStatePtr;
24 // typedef std::vector< boost::shared_ptr<const SingleState> > SingleStateContainer;
25  typedef std::vector< SingleStatePtr > SingleStateContainer;
26 
27 public:
28 
30 // ++instances_;++maxInstances_;
31 // std::cout << "MultiGaussianState() " << N << " " << instances_ << std::endl;
32  }
33 
36 // theComponents[0]->rescaleWeight(1.);
37 // ++instances_;++maxInstances_;
38 // std::cout << "MultiGaussianState(const SingleStateContainer&) " << N << " "
39 // << instances_ << std::endl;
40  }
41 
42 // MultiGaussianState(const MultiGaussianState<N>& rhs) :
43 // theComponents(rhs.theComponents), theCombinedState(rhs.theCombinedState),
44 // theCombinedStateUp2Date(rhs.theCombinedStateUp2Date) {
45 // ++instances_;++maxInstances_;
46 // std::cout << "MultiGaussianState(const MultiGaussianState<N>&) " << N << " "
47 // << instances_ << std::endl;
48 // }
49 
51 // --instances_;
52 // std::cout << "~MultiGaussianState " << N << " " << instances_ << std::endl;
53  }
54 
55 // /**
56 // * Creates a new multi-state with the given components.
57 // * For this base class, no information is passed from the initial
58 // * instance.
59 // */
60 // virtual MultiGaussianState createState(
61 // const std::vector<SingleGaussianState> & stateV) const {
62 // return MultiGaussianState(stateV);
63 // }
64 
65 // /**
66 // * Creates a new single-state with the given information.
67 // * For this base class, no information is passed from the initial
68 // * instance.
69 // */
70 // virtual SingleGaussianState createSingleState (
71 // const AlgebraicVector & aMean, const AlgebraicSymMatrix & aCovariance,
72 // double aWeight = 1.) const {
73 // return SingleGaussianState(aMean, aCovariance, aWeight);
74 // }
75 
77  double weight() const;
79  const Vector & mean() const;
81  const Matrix & covariance() const;
83  const Matrix & weightMatrix() const;
85  inline const SingleStateContainer& components() const {return theComponents;}
87  int dimension () const {
88  return N;
89  }
91  void setWeight (double newWeight);
93  void rescaleWeight (double scale);
94 
95 // protected:
96 private:
98  void checkCombinedState() const;
99 
100 // std::vector<SingleState> theComponents;
101 // should become a vector of pointers to const SingleState ...
105 
106 // public:
107 // static int instances_;
108 // static int maxInstances_;
109 // static int constructsCombinedState_;
110 };
111 
112 #include "TrackingTools/GsfTools/interface/MultiGaussianState.icc"
113 
114 // template <unsigned int N> int MultiGaussianState<N>::instances_ = 0;
115 // template <unsigned int N> int MultiGaussianState<N>::maxInstances_ = 0;
116 // template <unsigned int N> int MultiGaussianState<N>::constructsCombinedState_ = 0;
117 
118 #endif
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:28
const SingleStateContainer & components() const
access to components (single Gaussian states)
const Matrix & covariance() const
combined covariance matrix
const SingleStateContainer theComponents
Mixture of multi-variate gaussian states.
MultiGaussianState(const SingleStateContainer &stateV)
std::vector< SingleStatePtr > SingleStateContainer
void checkCombinedState() const
calculation of the combined state (on demand)
SingleStatePtr theCombinedState
const Vector & mean() const
combined mean
ROOT::Math::SMatrix< double, N, N, ROOT::Math::MatRepSym< double, N > > Matrix
SingleGaussianState< N > SingleState
const Matrix & weightMatrix() const
combined weight matrix
#define N
Definition: blowfish.cc:9
void rescaleWeight(double scale)
rescale weight
double weight() const
combined weight
ROOT::Math::SVector< double, N > Vector
SingleGaussianState< N >::Vector Vector
SingleGaussianState< N >::Matrix Matrix
void setWeight(double newWeight)
renormalize weight
boost::shared_ptr< SingleState > SingleStatePtr
int dimension() const
dimension of parameter vector