CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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,
AlgebraicSymMatrixOO
trackMatrixPair
 

Public Member Functions

KalmanVertexTrackUpdator< N > * clone () const
 
 KalmanVertexTrackUpdator ()
 
trackMatrixPair trackRefit (const VertexState &vertex, RefCountedLinearizedTrackState linTrackState, float weight) const
 
RefCountedVertexTrack update (const CachingVertex< N > &vertex, RefCountedVertexTrack track) const
 
virtual ~KalmanVertexTrackUpdator ()
 
- 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>
virtual KalmanVertexTrackUpdator< N >::~KalmanVertexTrackUpdator ( )
inlinevirtual

Definition at line 32 of file KalmanVertexTrackUpdator.h.

32 {}

Member Function Documentation

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

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_new(), 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_new();
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_new());
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.
T y() const
Definition: PV3DBase.h:63
GlobalPoint position() const
Definition: VertexState.h:50
const AlgebraicSymMatrix33 & matrix_new() const
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:60
#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:55
T x() const
Definition: PV3DBase.h:62
template<unsigned int N>
CachingVertex< N >::RefCountedVertexTrack KalmanVertexTrackUpdator< N >::update ( const CachingVertex< N > &  vertex,
RefCountedVertexTrack  track 
) 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 VertexTrack containing the refitted track and the track-to-vertex covariance.

Definition at line 15 of file KalmanVertexTrackUpdator.cc.

References query::result, HLT_25ns14e33_v1_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(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

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 }
VertexState const & vertexState() const
Definition: CachingVertex.h:85
std::pair< RefCountedRefittedTrackState, AlgebraicSymMatrixOO > trackMatrixPair
tuple result
Definition: query.py:137
VertexTrackFactory< N > theVTFactory
GlobalWeight weight() const
Definition: VertexState.h:60
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.