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 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

◆ RefCountedVertexTrack

Definition at line 15 of file KalmanTrackToTrackCovCalculator.h.

Constructor & Destructor Documentation

◆ KalmanTrackToTrackCovCalculator()

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

Definition at line 17 of file KalmanTrackToTrackCovCalculator.h.

17 {}

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

Member Function Documentation

◆ clone()

template<unsigned int N>
KalmanTrackToTrackCovCalculator* KalmanTrackToTrackCovCalculator< N >::clone ( void  ) const
inlineoverridevirtual

◆ operator()()

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.

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 }

References mps_fire::i, dqmiolumiharvest::j, N, tracks, and bphysicsOniaDQM_cfi::vertex.

AlgebraicSymMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
Definition: AlgebraicROOTObjects.h:21
mps_fire.i
i
Definition: mps_fire.py:428
VertexException
Common base class.
Definition: VertexException.h:12
CachingVertex::TrackMap
std::map< RefCountedVertexTrack, AlgebraicMatrixMM > TrackMap
Definition: CachingVertex.h:27
N
#define N
Definition: blowfish.cc:9
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
KalmanTrackToTrackCovCalculator::KalmanTrackToTrackCovCalculator
KalmanTrackToTrackCovCalculator()
Definition: KalmanTrackToTrackCovCalculator.h:17
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CachingVertex::TrackToTrackMap
std::map< RefCountedVertexTrack, TrackMap > TrackToTrackMap
Definition: CachingVertex.h:28