CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/TrackingTools/TrajectoryParametrization/src/LocalTrajectoryError.cc

Go to the documentation of this file.
00001 #include "TrackingTools/TrajectoryParametrization/interface/LocalTrajectoryError.h"
00002 #include "DataFormats/Math/interface/invertPosDefMatrix.h"
00003 
00004 LocalTrajectoryError::LocalTrajectoryError() {}
00005 
00006 LocalTrajectoryError::~LocalTrajectoryError() {}
00007 
00008 LocalTrajectoryError::LocalTrajectoryError(const AlgebraicSymMatrix55& aCovarianceMatrix) :
00009   theCovarianceMatrix(aCovarianceMatrix), theWeightMatrixPtr() { }
00010 
00011 LocalTrajectoryError::LocalTrajectoryError(const AlgebraicSymMatrix& aCovarianceMatrix) :
00012   theCovarianceMatrix(asSMatrix<5>(aCovarianceMatrix)), theWeightMatrixPtr() {}
00013 
00014 
00015 LocalTrajectoryError::
00016 LocalTrajectoryError( float dx, float dy, float dxdir, float dydir,
00017                       float dpinv) : theCovarianceMatrix(), theWeightMatrixPtr()
00018 {
00019   theCovarianceMatrix(3,3) = dx*dx;
00020   theCovarianceMatrix(4,4) = dy*dy;
00021   theCovarianceMatrix(1,1) = dxdir*dxdir;
00022   theCovarianceMatrix(2,2) = dydir*dydir;
00023   theCovarianceMatrix(0,0) = dpinv*dpinv;
00024   
00025 }
00026 
00027 const AlgebraicSymMatrix55 & LocalTrajectoryError::weightMatrix() const {
00028   if (theWeightMatrixPtr.get() == 0) {
00029     theWeightMatrixPtr.reset(new AlgebraicSymMatrix55());
00030     invertPosDefMatrix(theCovarianceMatrix,*theWeightMatrixPtr);
00031   }
00032   return *theWeightMatrixPtr;
00033 }