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
KVFHelper< N > Class Template Reference

#include <KVFHelper.h>

Public Types

typedef std::pair< bool, double > BDpair
 
typedef VertexTrack< N >
::RefCountedLinearizedTrackState 
RefCountedLinearizedTrackState
 
typedef VertexTrack< N >
::RefCountedRefittedTrackState 
RefCountedRefittedTrackState
 
typedef CachingVertex< N >
::RefCountedVertexTrack 
RefCountedVertexTrack
 

Public Member Functions

BDpair trackParameterChi2 (const RefCountedLinearizedTrackState linTrack, const RefCountedRefittedTrackState refittedTrackState) const
 
BDpair trackParameterChi2 (const RefCountedVertexTrack track) const
 
double vertexChi2 (const VertexState &vertexA, const VertexState &VertexB) const
 
double vertexChi2 (const CachingVertex< N > &vertexA, const CachingVertex< N > &vertexB) const
 

Detailed Description

template<unsigned int N>
class KVFHelper< N >

Helper class to calculate chi2 increments for the Kalman Filter

Definition at line 11 of file KVFHelper.h.

Member Typedef Documentation

template<unsigned int N>
typedef std::pair<bool, double> KVFHelper< N >::BDpair

Definition at line 18 of file KVFHelper.h.

Definition at line 16 of file KVFHelper.h.

Definition at line 17 of file KVFHelper.h.

template<unsigned int N>
typedef CachingVertex<N>::RefCountedVertexTrack KVFHelper< N >::RefCountedVertexTrack

Definition at line 15 of file KVFHelper.h.

Member Function Documentation

template<unsigned int N>
KVFHelper< N >::BDpair KVFHelper< N >::trackParameterChi2 ( const RefCountedLinearizedTrackState  linTrack,
const RefCountedRefittedTrackState  refittedTrackState 
) const

Methode which calculates the chi**2 between the prior and the fitted track parameters.

Parameters
linTrackThe track as linearized
refittedTrackStateThe refitted track

Definition at line 46 of file KVFHelper.cc.

References relativeConstraints::error.

Referenced by GsfVertexSmoother::createNewComponent().

49 {
50 
51  typedef ROOT::Math::SMatrix<double,N,N,ROOT::Math::MatRepSym<double,N> > AlgebraicSymMatrixNN;
52  typedef ROOT::Math::SVector<double,N> AlgebraicVectorN;
53 
54  AlgebraicVectorN parameterResiduals = linTrack->predictedStateParameters() -
55  linTrack->refittedParamFromEquation(refittedTrackState);
56  linTrack->checkParameters(parameterResiduals);
57  int error;
58  float lChi2 = ROOT::Math::Similarity(parameterResiduals, linTrack->predictedStateWeight(error));
59  if (error != 0) return BDpair(false, -1.);
60  return BDpair(true, lChi2);
61 }
std::pair< bool, double > BDpair
Definition: KVFHelper.h:18
template<unsigned int N>
KVFHelper< N >::BDpair KVFHelper< N >::trackParameterChi2 ( const RefCountedVertexTrack  track) const

Methode which calculates the chi**2 between the prior and the fitted track parameters. The track must have been smoothed before calling this method. If not, an Exception will be thrown.

Definition at line 39 of file KVFHelper.cc.

40 {
41  return trackParameterChi2(track->linearizedTrack(), track->refittedState());
42 }
BDpair trackParameterChi2(const RefCountedLinearizedTrackState linTrack, const RefCountedRefittedTrackState refittedTrackState) const
Definition: KVFHelper.cc:46
template<unsigned int N>
double KVFHelper< N >::vertexChi2 ( const VertexState vertexA,
const VertexState VertexB 
) const

Methode which calculates the chi**2-increment due to the vertices E.g. between the prior and the fitted vertex. The covariance matrix used is that of the first vertex (vertexA). This method will not take into account multiple states, so in case one of the VertexStates is a multi-state vertex, only the mean will be used.

Parameters
vertexA,:The prior vertex state
VertexB,:The fitted vertex state

Definition at line 13 of file KVFHelper.cc.

References GlobalErrorBase< T, ErrorWeightType >::matrix_new(), VertexState::position(), VertexState::weight(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by GsfVertexSmoother::createNewComponent(), and GsfVertexSmoother::priorVertexChi2().

15 {
16 // std::cout <<"Start\n";
17  GlobalPoint inPosition = vertexA.position();
18  GlobalPoint fnPosition = vertexB.position();
19 // std::cout << inPosition<< fnPosition<<std::endl;
20 
21  AlgebraicVector3 oldVertexPositionV;
22  oldVertexPositionV(0) = inPosition.x();
23  oldVertexPositionV(1) = inPosition.y();
24  oldVertexPositionV(2) = inPosition.z();
25 
26  AlgebraicVector3 newVertexPositionV;
27  newVertexPositionV(0) = fnPosition.x();
28  newVertexPositionV(1) = fnPosition.y();
29  newVertexPositionV(2) = fnPosition.z();
30 
31 
32  AlgebraicVector3 positionResidual = newVertexPositionV - oldVertexPositionV;
33 
34  return ROOT::Math::Similarity(positionResidual, vertexA.weight().matrix_new());
35 }
T y() const
Definition: PV3DBase.h:63
GlobalPoint position() const
Definition: VertexState.h:50
const AlgebraicSymMatrix33 & matrix_new() const
T z() const
Definition: PV3DBase.h:64
ROOT::Math::SVector< double, 3 > AlgebraicVector3
GlobalWeight weight() const
Definition: VertexState.h:60
T x() const
Definition: PV3DBase.h:62
template<unsigned int N>
double KVFHelper< N >::vertexChi2 ( const CachingVertex< N > &  vertexA,
const CachingVertex< N > &  vertexB 
) const

Definition at line 5 of file KVFHelper.cc.

References CachingVertex< N >::vertexState().

7 {
8  return vertexChi2(vertexA.vertexState(), vertexB.vertexState());
9 }
VertexState const & vertexState() const
Definition: CachingVertex.h:85
double vertexChi2(const VertexState &vertexA, const VertexState &VertexB) const
Definition: KVFHelper.cc:13