#include <RecoVertex/KalmanVertexFit/interface/KalmanTrackToTrackCovCalculator.h>
Public Types | |
typedef CachingVertex< N > ::RefCountedVertexTrack | RefCountedVertexTrack |
Public Member Functions | |
KalmanTrackToTrackCovCalculator * | clone () const |
KalmanTrackToTrackCovCalculator () | |
CachingVertex< N >::TrackToTrackMap | operator() (const CachingVertex< N > &vertex) const |
Calculates all the track-to-track covariance matrices. |
Definition at line 13 of file KalmanTrackToTrackCovCalculator.h.
typedef CachingVertex<N>::RefCountedVertexTrack KalmanTrackToTrackCovCalculator< N >::RefCountedVertexTrack |
Definition at line 18 of file KalmanTrackToTrackCovCalculator.h.
KalmanTrackToTrackCovCalculator< N >::KalmanTrackToTrackCovCalculator | ( | ) | [inline] |
Definition at line 20 of file KalmanTrackToTrackCovCalculator.h.
Referenced by KalmanTrackToTrackCovCalculator< N >::clone().
KalmanTrackToTrackCovCalculator* KalmanTrackToTrackCovCalculator< N >::clone | ( | void | ) | const [inline, virtual] |
Implements TrackToTrackCovCalculator< N >.
Definition at line 31 of file KalmanTrackToTrackCovCalculator.h.
References KalmanTrackToTrackCovCalculator< N >::KalmanTrackToTrackCovCalculator().
00032 { 00033 return new KalmanTrackToTrackCovCalculator(* this); 00034 }
CachingVertex< N >::TrackToTrackMap KalmanTrackToTrackCovCalculator< N >::operator() | ( | const CachingVertex< N > & | vertex | ) | const [inline, virtual] |
Calculates all the track-to-track covariance matrices.
vertex | The vertex whose track-to-track covariance matrices have to be calculated. |
Implements TrackToTrackCovCalculator< N >.
Definition at line 7 of file KalmanTrackToTrackCovCalculator.cc.
References i, j, N, and tracks.
00008 { 00009 typedef ROOT::Math::SMatrix<double,N,3,ROOT::Math::MatRepStd<double,N,3> > AlgebraicMatrixN3; 00010 typedef ROOT::Math::SMatrix<double,N,N-2,ROOT::Math::MatRepStd<double,N,N-2> > AlgebraicMatrixNM; 00011 typedef ROOT::Math::SMatrix<double,N-2,3,ROOT::Math::MatRepStd<double,N-2,3> > AlgebraicMatrixM3; 00012 typedef ROOT::Math::SMatrix<double,3,N-2,ROOT::Math::MatRepStd<double,3,N-2> > AlgebraicMatrix3M; 00013 typedef ROOT::Math::SMatrix<double,N,N,ROOT::Math::MatRepSym<double,N> > AlgebraicSymMatrixNN; 00014 typedef ROOT::Math::SMatrix<double,N-2,N-2,ROOT::Math::MatRepSym<double,N-2> > AlgebraicSymMatrixMM; 00015 typedef ROOT::Math::SMatrix<double,N-2,N-2,ROOT::Math::MatRepStd<double,N-2,N-2> > AlgebraicMatrixMM; 00016 00017 typename CachingVertex<N>::TrackToTrackMap returnMap; 00018 int ifail = 0; 00019 vector<RefCountedVertexTrack> tracks = vertex.tracks(); 00020 00021 //vertex initial data needed 00022 AlgebraicSymMatrix33 vertexC = vertex.error().matrix_new(); 00023 00024 for(typename vector<RefCountedVertexTrack>::iterator i = tracks.begin(); 00025 i != tracks.end(); i++) 00026 { 00027 const AlgebraicMatrixN3 & leftA = (*i)->linearizedTrack()->positionJacobian(); 00028 const AlgebraicMatrixNM & leftB = (*i)->linearizedTrack()->momentumJacobian(); 00029 AlgebraicSymMatrixNN leftG = (*i)->linearizedTrack()->predictedStateWeight(); 00030 AlgebraicSymMatrixMM leftW = ROOT::Math::SimilarityT(leftB,leftG); 00031 00032 ifail = ! leftW.Invert(); 00033 if(ifail != 0) throw VertexException 00034 ("KalmanTrackToTrackCovarianceCalculator::leftW matrix inversion failed"); 00035 AlgebraicMatrixM3 leftPart = leftW * (ROOT::Math::Transpose(leftB)) * leftG * leftA; 00036 typename CachingVertex<N>::TrackMap internalMap; 00037 for(typename vector<RefCountedVertexTrack>::iterator j = tracks.begin(); j != tracks.end(); j++) 00038 { 00039 00040 if(*i < *j) 00041 { 00042 00043 const AlgebraicMatrixN3 & rightA = (*j)->linearizedTrack()->positionJacobian(); 00044 const AlgebraicMatrixNM & rightB = (*j)->linearizedTrack()->momentumJacobian(); 00045 AlgebraicSymMatrixNN rightG = (*j)->linearizedTrack()->predictedStateWeight(); 00046 AlgebraicSymMatrixMM rightW = ROOT::Math::SimilarityT(rightB,rightG); 00047 00048 ifail = ! rightW.Invert(); 00049 00050 if(ifail != 0) throw VertexException 00051 ("KalmanTrackToTrackCovarianceCalculator::rightW matrix inversion failed"); 00052 AlgebraicMatrix3M rightPart = (ROOT::Math::Transpose(rightA)) * rightG * rightB * rightW; 00053 AlgebraicMatrixMM covariance = leftPart * vertexC * rightPart; 00054 internalMap[(*j)] = AlgebraicSymMatrixMM(covariance.LowerBlock()); 00055 } 00056 } 00057 returnMap[*i] = internalMap; 00058 } 00059 return returnMap; 00060 }