CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 override
 
 KalmanTrackToTrackCovCalculator ()
 
CachingVertex< N >::TrackToTrackMap operator() (const CachingVertex< N > &vertex) const override
 
- 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 15 of file KalmanTrackToTrackCovCalculator.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file KalmanTrackToTrackCovCalculator.h.

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

17 {}

Member Function Documentation

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

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 5 of file KalmanTrackToTrackCovCalculator.cc.

References CachingVertex< N >::error(), mps_fire::i, dqmiolumiharvest::j, GlobalErrorBase< T, ErrorWeightType >::matrix(), N, tracks, and CachingVertex< N >::tracks().

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