CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
KalmanVertexTrackUpdator< N > Class Template Reference

#include <KalmanVertexTrackUpdator.h>

Inheritance diagram for KalmanVertexTrackUpdator< N >:
VertexTrackUpdator< N >

Public Types

typedef ROOT::Math::SMatrix< double, 3, N-2, ROOT::Math::MatRepStd< double, 3, N-2 > > AlgebraicMatrix3M
 
typedef ROOT::Math::SMatrix< double, N+1, N+1, ROOT::Math::MatRepSym< double, N+1 > > AlgebraicSymMatrixOO
 
typedef VertexTrack< N >::RefCountedLinearizedTrackState RefCountedLinearizedTrackState
 
typedef VertexTrack< N >::RefCountedRefittedTrackState RefCountedRefittedTrackState
 
typedef CachingVertex< N >::RefCountedVertexTrack RefCountedVertexTrack
 
typedef std::pair< RefCountedRefittedTrackState, AlgebraicSymMatrixOOtrackMatrixPair
 

Public Member Functions

KalmanVertexTrackUpdator< N > * clone () const override
 
 KalmanVertexTrackUpdator ()
 
trackMatrixPair trackRefit (const VertexState &vertex, RefCountedLinearizedTrackState linTrackState, float weight) const
 
RefCountedVertexTrack update (const CachingVertex< N > &vertex, RefCountedVertexTrack track) const override
 
 ~KalmanVertexTrackUpdator () override
 
- Public Member Functions inherited from VertexTrackUpdator< N >
virtual CachingVertex< N >::RefCountedVertexTrack update (const CachingVertex< N > &v, typename CachingVertex< N >::RefCountedVertexTrack t) const =0
 
virtual ~VertexTrackUpdator ()
 

Private Attributes

KVFHelper< Nhelper
 
VertexTrackFactory< NtheVTFactory
 
KalmanVertexUpdator< Nupdator
 

Detailed Description

template<unsigned int N>
class KalmanVertexTrackUpdator< N >

Performs the refit of the tracks with the vertex constraint, using the Kalman filter algorithms.

Definition at line 17 of file KalmanVertexTrackUpdator.h.

Member Typedef Documentation

template<unsigned int N>
typedef ROOT::Math::SMatrix<double,3,N-2,ROOT::Math::MatRepStd<double,3,N-2> > KalmanVertexTrackUpdator< N >::AlgebraicMatrix3M

Definition at line 55 of file KalmanVertexTrackUpdator.h.

template<unsigned int N>
typedef ROOT::Math::SMatrix<double,N+1,N+1,ROOT::Math::MatRepSym<double,N+1> > KalmanVertexTrackUpdator< N >::AlgebraicSymMatrixOO

Definition at line 56 of file KalmanVertexTrackUpdator.h.

Definition at line 22 of file KalmanVertexTrackUpdator.h.

Definition at line 23 of file KalmanVertexTrackUpdator.h.

Definition at line 21 of file KalmanVertexTrackUpdator.h.

Definition at line 57 of file KalmanVertexTrackUpdator.h.

Constructor & Destructor Documentation

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

Default constructor

Definition at line 30 of file KalmanVertexTrackUpdator.h.

Referenced by KalmanVertexTrackUpdator< 5 >::clone().

30 {}
template<unsigned int N>
KalmanVertexTrackUpdator< N >::~KalmanVertexTrackUpdator ( )
inlineoverride

Definition at line 32 of file KalmanVertexTrackUpdator.h.

32 {}

Member Function Documentation

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

Clone method

Implements VertexTrackUpdator< N >.

Definition at line 50 of file KalmanVertexTrackUpdator.h.

51  {
52  return new KalmanVertexTrackUpdator(*this);
53  }
template<unsigned int N>
KalmanVertexTrackUpdator< N >::trackMatrixPair KalmanVertexTrackUpdator< N >::trackRefit ( const VertexState vertex,
RefCountedLinearizedTrackState  linTrackState,
float  weight 
) const

Refit of the track with the vertex constraint.

Parameters
vertexThe vertex which has to be used as constraint.
trackThe track to refit.
Returns
The refitted state with the track-to-vertex covariance.

Definition at line 34 of file KalmanVertexTrackUpdator.cc.

References a, b, VertexState::error(), invertPosDefMatrix(), GlobalErrorBase< T, ErrorWeightType >::matrix(), N, VertexState::position(), alignCSCRings::s, VertexState::weight(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by GsfVertexSmoother::createNewComponent().

37 {
38  typedef ROOT::Math::SVector<double,N> AlgebraicVectorN;
39  typedef ROOT::Math::SVector<double,N-2> AlgebraicVectorM;
40  typedef ROOT::Math::SMatrix<double,N,3,ROOT::Math::MatRepStd<double,N,3> > AlgebraicMatrixN3;
41  typedef ROOT::Math::SMatrix<double,3,N,ROOT::Math::MatRepStd<double,3,N> > AlgebraicMatrix3N;
42  typedef ROOT::Math::SMatrix<double,3,N-2,ROOT::Math::MatRepStd<double,3,N-2> > AlgebraicMatrix3M;
43  typedef ROOT::Math::SMatrix<double,N,N-2,ROOT::Math::MatRepStd<double,N,N-2> > AlgebraicMatrixNM;
44  typedef ROOT::Math::SMatrix<double,N-2,3,ROOT::Math::MatRepStd<double,N-2,3> > AlgebraicMatrixM3;
45  typedef ROOT::Math::SMatrix<double,N,N,ROOT::Math::MatRepSym<double,N> > AlgebraicSymMatrixNN;
46 // typedef ROOT::Math::SMatrix<double,N+1,N+1,ROOT::Math::MatRepSym<double,N+1> > AlgebraicSymMatrixOO;
47  typedef ROOT::Math::SMatrix<double,N+1,N+1,ROOT::Math::MatRepStd<double,N+1,N+1> > AlgebraicMatrixOO;
48  typedef ROOT::Math::SMatrix<double,N-2,N-2,ROOT::Math::MatRepSym<double,N-2> > AlgebraicSymMatrixMM;
49 
50  //Vertex position
51  GlobalPoint vertexPosition = vertex.position();
52 
53  AlgebraicVector3 vertexCoord;
54  vertexCoord(0) = vertexPosition.x();
55  vertexCoord(1) = vertexPosition.y();
56  vertexCoord(2) = vertexPosition.z();
57  const AlgebraicSymMatrix33 vertexErrorMatrix = vertex.error().matrix();
58 
59 //track information
60  const AlgebraicMatrixN3 a = linTrackState->positionJacobian();
61  const AlgebraicMatrixNM b = linTrackState->momentumJacobian();
62 
63 // AlgebraicVectorN trackParameters =
64 // linTrackState->predictedStateParameters();
65 
66  int ifail;
67  AlgebraicSymMatrixNN trackParametersWeight =
68  linTrackState->predictedStateWeight(ifail);
69 
70  AlgebraicSymMatrixMM s = ROOT::Math::SimilarityT(b,trackParametersWeight);
71 
72  if (!invertPosDefMatrix(s))
73  throw VertexException
74  ("KalmanVertexTrackUpdator::S matrix inversion failed");
75 
76  // NN NM MM
77  AlgebraicMatrixNM twbs = trackParametersWeight * b * s;
78 
79 
80  AlgebraicVectorN vv =
81  linTrackState->predictedStateParameters() - linTrackState->constantTerm() - a*vertexCoord;
82  // MM MN NN
83  // AlgebraicVectorM newTrackMomentumP = s * (ROOT::Math::Transpose(b)) * trackParametersWeight * vv;
84  AlgebraicVectorM newTrackMomentumP = ROOT::Math::Transpose(twbs) * vv;
85 
86  //AlgebraicMatrix3M refittedPositionMomentumConvariance =
87  // 33 3N NN NM MM
88  // -vertexErrorMatrix * (ROOT::Math::Transpose(a)) * trackParametersWeight * b * s;
89 
90  AlgebraicMatrix3N tmpM1 = -vertexErrorMatrix * (ROOT::Math::Transpose(a));
91  AlgebraicMatrix3M refittedPositionMomentumConvariance = tmpM1 * twbs;
92 
93  AlgebraicSymMatrixMM refittedMomentumConvariance = s/weight +
94  ROOT::Math::SimilarityT(refittedPositionMomentumConvariance, vertex.weight().matrix());
95 
96 
97  // int matrixSize = 3+3; //refittedMomentumConvariance.num_col();
98  AlgebraicMatrixOO covMatrix; //(matrixSize, matrixSize);
99  covMatrix.Place_at(refittedPositionMomentumConvariance, 0, 3);
100  covMatrix.Place_at(ROOT::Math::Transpose(refittedPositionMomentumConvariance), 3, 0);
101  covMatrix.Place_at(vertexErrorMatrix, 0, 0);
102  covMatrix.Place_at(refittedMomentumConvariance, 3 ,3);
103 
104  AlgebraicSymMatrixOO covSymMatrix(covMatrix.LowerBlock());
105 
106  RefCountedRefittedTrackState refittedTrackState = linTrackState->
107  createRefittedTrackState(vertexPosition, newTrackMomentumP, covSymMatrix);
108 
109  return trackMatrixPair(refittedTrackState, covSymMatrix);
110 // (refittedTrackState, refittedPositionMomentumConvariance);
111 }
Common base class.
const AlgebraicSymMatrix33 matrix() const
T y() const
Definition: PV3DBase.h:63
Definition: weight.py:1
GlobalPoint position() const
Definition: VertexState.h:69
ROOT::Math::SMatrix< double, N+1, N+1, ROOT::Math::MatRepSym< double, N+1 > > AlgebraicSymMatrixOO
std::pair< RefCountedRefittedTrackState, AlgebraicSymMatrixOO > trackMatrixPair
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
T z() const
Definition: PV3DBase.h:64
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
ROOT::Math::SVector< double, 3 > AlgebraicVector3
GlobalWeight weight() const
Definition: VertexState.h:85
#define N
Definition: blowfish.cc:9
ROOT::Math::SMatrix< double, 3, N-2, ROOT::Math::MatRepStd< double, 3, N-2 > > AlgebraicMatrix3M
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
VertexTrack< N >::RefCountedRefittedTrackState RefCountedRefittedTrackState
GlobalError error() const
Definition: VertexState.h:74
T x() const
Definition: PV3DBase.h:62
template<unsigned int N>
CachingVertex< N >::RefCountedVertexTrack KalmanVertexTrackUpdator< N >::update ( const CachingVertex< N > &  vertex,
RefCountedVertexTrack  track 
) const
override

Refit of the track with the vertex constraint.

Parameters
vertexThe vertex which has to be used as constraint.
trackThe track to refit.
Returns
The VertexTrack containing the refitted track and the track-to-vertex covariance.

Definition at line 15 of file KalmanVertexTrackUpdator.cc.

References mps_fire::result, gsfElectronCkfTrackCandidateMaker_cff::updator, and CachingVertex< N >::vertexState().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), Vispa.Gui.PortConnection.PointToPointConnection::updateConnection(), and KalmanVertexTrackUpdator< 5 >::~KalmanVertexTrackUpdator().

17 {
18  trackMatrixPair thePair =
19  trackRefit(vertex.vertexState(), track->linearizedTrack(), track->weight() );
20 
21  VertexState rVert = updator.positionUpdate (vertex.vertexState(), track->linearizedTrack(),
22  track->weight(), -1);
23 
24  std::pair<bool, double> result = helper.trackParameterChi2(track->linearizedTrack(), thePair.first);
25  float smoothedChi2 = helper.vertexChi2(rVert, vertex.vertexState()) + result.second;
26 
27  return theVTFactory.vertexTrack(track->linearizedTrack(),
28  vertex.vertexState(), thePair.first, smoothedChi2, thePair.second,
29  track->weight());
30 }
Definition: helper.py:1
VertexState const & vertexState() const
std::pair< RefCountedRefittedTrackState, AlgebraicSymMatrixOO > trackMatrixPair
VertexTrackFactory< N > theVTFactory
trackMatrixPair trackRefit(const VertexState &vertex, RefCountedLinearizedTrackState linTrackState, float weight) const
KalmanVertexUpdator< N > updator

Member Data Documentation

template<unsigned int N>
KVFHelper<N> KalmanVertexTrackUpdator< N >::helper
private

Definition at line 73 of file KalmanVertexTrackUpdator.h.

template<unsigned int N>
VertexTrackFactory<N> KalmanVertexTrackUpdator< N >::theVTFactory
private

Definition at line 72 of file KalmanVertexTrackUpdator.h.

template<unsigned int N>
KalmanVertexUpdator<N> KalmanVertexTrackUpdator< N >::updator
private

Definition at line 74 of file KalmanVertexTrackUpdator.h.