Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:40

0001 #include "TrackingTools/TrajectoryParametrization/interface/LocalTrajectoryError.h"
0002 #include "DataFormats/Math/interface/invertPosDefMatrix.h"
0003 #include "FWCore/Utilities/interface/Likely.h"
0004 
0005 LocalTrajectoryError::LocalTrajectoryError(float dx, float dy, float dxdir, float dydir, float dpinv)
0006     : theCovarianceMatrix(), theWeightMatrixPtr() {
0007   theCovarianceMatrix(3, 3) = dx * dx;
0008   theCovarianceMatrix(4, 4) = dy * dy;
0009   theCovarianceMatrix(1, 1) = dxdir * dxdir;
0010   theCovarianceMatrix(2, 2) = dydir * dydir;
0011   theCovarianceMatrix(0, 0) = dpinv * dpinv;
0012 }
0013 
0014 const AlgebraicSymMatrix55& LocalTrajectoryError::weightMatrix() const {
0015   if UNLIKELY (theWeightMatrixPtr.get() == nullptr) {
0016     theWeightMatrixPtr.reset(new AlgebraicSymMatrix55());
0017     invertPosDefMatrix(theCovarianceMatrix, *theWeightMatrixPtr);
0018   }
0019   return *theWeightMatrixPtr;
0020 }