CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/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 #include "FWCore/Utilities/interface/Likely.h"
00004 
00005 
00006 LocalTrajectoryError::
00007 LocalTrajectoryError( float dx, float dy, float dxdir, float dydir,
00008                       float dpinv) : theCovarianceMatrix(), theWeightMatrixPtr()
00009 {
00010   theCovarianceMatrix(3,3) = dx*dx;
00011   theCovarianceMatrix(4,4) = dy*dy;
00012   theCovarianceMatrix(1,1) = dxdir*dxdir;
00013   theCovarianceMatrix(2,2) = dydir*dydir;
00014   theCovarianceMatrix(0,0) = dpinv*dpinv;
00015   
00016 }
00017 
00018 const AlgebraicSymMatrix55 & LocalTrajectoryError::weightMatrix() const {
00019   if unlikely(theWeightMatrixPtr.get() == 0) {
00020     theWeightMatrixPtr.reset(new AlgebraicSymMatrix55());
00021     invertPosDefMatrix(theCovarianceMatrix,*theWeightMatrixPtr);
00022   }
00023   return *theWeightMatrixPtr;
00024 }