Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-12-20 03:14:18

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