CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions
KalmanTrackToTrackCovCalculator< N > Class Template Reference

#include <KalmanTrackToTrackCovCalculator.h>

Inheritance diagram for KalmanTrackToTrackCovCalculator< N >:
TrackToTrackCovCalculator< N >

Public Types

typedef CachingVertex< N >::RefCountedVertexTrack RefCountedVertexTrack
 

Public Member Functions

KalmanTrackToTrackCovCalculatorclone () const
 
 KalmanTrackToTrackCovCalculator ()
 
CachingVertex< N >::TrackToTrackMap operator() (const CachingVertex< N > &vertex) const
 
- Public Member Functions inherited from TrackToTrackCovCalculator< N >
 TrackToTrackCovCalculator ()
 
virtual ~TrackToTrackCovCalculator ()
 

Detailed Description

template<unsigned int N>
class KalmanTrackToTrackCovCalculator< N >

Calculates all the track-to-track covariance matrices using the Kalman filter algorithms after the vertex has been fit and the tracks refit.

Definition at line 13 of file KalmanTrackToTrackCovCalculator.h.

Member Typedef Documentation

Definition at line 18 of file KalmanTrackToTrackCovCalculator.h.

Constructor & Destructor Documentation

template<unsigned int N>
KalmanTrackToTrackCovCalculator< N >::KalmanTrackToTrackCovCalculator ( )
inline

Member Function Documentation

template<unsigned int N>
KalmanTrackToTrackCovCalculator* KalmanTrackToTrackCovCalculator< N >::clone ( void  ) const
inlinevirtual
template<unsigned int N>
CachingVertex< N >::TrackToTrackMap KalmanTrackToTrackCovCalculator< N >::operator() ( const CachingVertex< N > &  vertex) const
virtual

Calculates all the track-to-track covariance matrices

Parameters
vertexThe vertex whose track-to-track covariance matrices have to be calculated.
Returns
The map containing the covariance matrices.

Implements TrackToTrackCovCalculator< N >.

Definition at line 7 of file KalmanTrackToTrackCovCalculator.cc.

References mps_fire::i, N, and l1t::tracks.

Referenced by KalmanTrackToTrackCovCalculator< N >::KalmanTrackToTrackCovCalculator().

8 {
9  typedef ROOT::Math::SMatrix<double,N,3,ROOT::Math::MatRepStd<double,N,3> > AlgebraicMatrixN3;
10  typedef ROOT::Math::SMatrix<double,N,N-2,ROOT::Math::MatRepStd<double,N,N-2> > AlgebraicMatrixNM;
11  typedef ROOT::Math::SMatrix<double,N-2,3,ROOT::Math::MatRepStd<double,N-2,3> > AlgebraicMatrixM3;
12  typedef ROOT::Math::SMatrix<double,3,N-2,ROOT::Math::MatRepStd<double,3,N-2> > AlgebraicMatrix3M;
13  typedef ROOT::Math::SMatrix<double,N,N,ROOT::Math::MatRepSym<double,N> > AlgebraicSymMatrixNN;
14  typedef ROOT::Math::SMatrix<double,N-2,N-2,ROOT::Math::MatRepSym<double,N-2> > AlgebraicSymMatrixMM;
15  typedef ROOT::Math::SMatrix<double,N-2,N-2,ROOT::Math::MatRepStd<double,N-2,N-2> > AlgebraicMatrixMM;
16 
17  typename CachingVertex<N>::TrackToTrackMap returnMap;
18  int ifail = 0;
19  std::vector<RefCountedVertexTrack> tracks = vertex.tracks();
20 
21 //vertex initial data needed
22  AlgebraicSymMatrix33 vertexC = vertex.error().matrix();
23 
24  for(typename std::vector<RefCountedVertexTrack>::iterator i = tracks.begin();
25  i != tracks.end(); i++)
26  {
27  const AlgebraicMatrixN3 & leftA = (*i)->linearizedTrack()->positionJacobian();
28  const AlgebraicMatrixNM & leftB = (*i)->linearizedTrack()->momentumJacobian();
29  AlgebraicSymMatrixNN leftG = (*i)->linearizedTrack()->predictedStateWeight(ifail);
30  AlgebraicSymMatrixMM leftW = ROOT::Math::SimilarityT(leftB,leftG);
31 
32  ifail = ! leftW.Invert();
33  if(ifail != 0) throw VertexException
34  ("KalmanTrackToTrackCovarianceCalculator::leftW matrix inversion failed");
35  AlgebraicMatrixM3 leftPart = leftW * (ROOT::Math::Transpose(leftB)) * leftG * leftA;
36  typename CachingVertex<N>::TrackMap internalMap;
37  for(typename std::vector<RefCountedVertexTrack>::iterator j = tracks.begin(); j != tracks.end(); j++)
38  {
39 
40  if(*i < *j)
41  {
42 
43  const AlgebraicMatrixN3 & rightA = (*j)->linearizedTrack()->positionJacobian();
44  const AlgebraicMatrixNM & rightB = (*j)->linearizedTrack()->momentumJacobian();
45  AlgebraicSymMatrixNN rightG = (*j)->linearizedTrack()->predictedStateWeight(ifail);
46  AlgebraicSymMatrixMM rightW = ROOT::Math::SimilarityT(rightB,rightG);
47 
48  ifail = ! rightW.Invert();
49 
50  if(ifail != 0) throw VertexException
51  ("KalmanTrackToTrackCovarianceCalculator::rightW matrix inversion failed");
52  AlgebraicMatrix3M rightPart = (ROOT::Math::Transpose(rightA)) * rightG * rightB * rightW;
53  internalMap[(*j)] = leftPart * vertexC * rightPart;
54  }
55  }
56  returnMap[*i] = internalMap;
57  }
58  return returnMap;
59 }
std::vector< RefCountedVertexTrack > tracks() const
Common base class.
const AlgebraicSymMatrix33 matrix() const
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
std::map< RefCountedVertexTrack, AlgebraicMatrixMM > TrackMap
Definition: CachingVertex.h:32
#define N
Definition: blowfish.cc:9
std::map< RefCountedVertexTrack, TrackMap > TrackToTrackMap
Definition: CachingVertex.h:33
GlobalError error() const