CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/TrackingTools/GsfTools/interface/SingleGaussianState.h

Go to the documentation of this file.
00001 #ifndef SingleGaussianState_H
00002 #define SingleGaussianState_H
00003 
00004 #include "Math/SVector.h"
00005 #include "Math/SMatrix.h"
00006 
00011 template <unsigned int N> class SingleGaussianState {
00012 public:
00013   typedef ROOT::Math::SVector<double, N> Vector;
00014   typedef ROOT::Math::SMatrix<double,N,N,ROOT::Math::MatRepSym<double,N> > Matrix;
00015   
00016 public:
00017   SingleGaussianState() :
00018     theHasWeightMatrix(false) {
00019 //     ++instances_;++maxInstances_;
00020   }
00021 
00022 //   SingleGaussianState(const SingleGaussianState<N>& rhs) :
00023 //     theWeight(rhs.theWeight), theMean(rhs.theMean), theCovariance(rhs.theCovariance),
00024 //     theHasWeightMatrix(rhs.theHasWeightMatrix), theWeightMatrix(rhs.theWeightMatrix) {
00025 //     ++instances_;++maxInstances_;
00026 //   }
00027   
00028   SingleGaussianState(const Vector& aMean,
00029                          const Matrix& aCovariance, 
00030                          double aWeight = 1.) : 
00031     theCovariance(aCovariance), theMean(aMean), theWeight(aWeight), 
00032     theHasWeightMatrix(false) {
00033 //     ++instances_;++maxInstances_;
00034   }
00035   
00036   ~SingleGaussianState() {
00037 //     --instances_;
00038   }
00039   
00040   //   /**
00041 //    * Creates a new single-state with the given information.
00042 //    * For this base class, no information is passed from the initial 
00043 //    * instance.
00044 //    */
00045 //   SingleGaussianState 
00046 //      createState(const AlgebraicVector & aMean, 
00047 //                     const AlgebraicSymMatrix & aCovariance, double aWeight = 1) const;
00048 
00050   inline double weight() const {return theWeight;}
00052   inline const Vector & mean() const {return theMean;}
00054   inline const Matrix & covariance() const {return theCovariance;}
00056   const Matrix & weightMatrix() const;
00058   inline unsigned int dimension () const {return N;}
00060   void rescaleWeight (double scale) {theWeight *= scale;}
00061 
00062 // protected:
00063 private:
00064   Matrix theCovariance;
00065   Vector theMean;
00066   double theWeight;
00067 
00068   mutable Matrix theWeightMatrix;
00069   mutable bool theHasWeightMatrix;
00070 
00071 // public:
00072 //   static int instances_;
00073 //   static int maxInstances_;
00074 //   static int constructsWeightMatrix_;
00075 };
00076 
00077 #include "TrackingTools/GsfTools/interface/SingleGaussianState.icc"
00078 
00079 // template <unsigned int N> int SingleGaussianState<N>::instances_ = 0;
00080 // template <unsigned int N> int SingleGaussianState<N>::maxInstances_ = 0;
00081 // template <unsigned int N> int SingleGaussianState<N>::constructsWeightMatrix_ = 0;
00082 #endif