CMS 3D CMS Logo

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 CachingVertex< N > &vertexA, const CachingVertex< N > &vertexB) const
 
double vertexChi2 (const VertexState &vertexA, const VertexState &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

◆ BDpair

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

Definition at line 16 of file KVFHelper.h.

◆ RefCountedLinearizedTrackState

Definition at line 14 of file KVFHelper.h.

◆ RefCountedRefittedTrackState

Definition at line 15 of file KVFHelper.h.

◆ RefCountedVertexTrack

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

Definition at line 13 of file KVFHelper.h.

Member Function Documentation

◆ trackParameterChi2() [1/2]

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 37 of file KVFHelper.cc.

38  {
39  typedef ROOT::Math::SMatrix<double, N, N, ROOT::Math::MatRepSym<double, N> > AlgebraicSymMatrixNN;
40  typedef ROOT::Math::SVector<double, N> AlgebraicVectorN;
41 
42  AlgebraicVectorN parameterResiduals =
43  linTrack->predictedStateParameters() - linTrack->refittedParamFromEquation(refittedTrackState);
44  linTrack->checkParameters(parameterResiduals);
45  int error;
46  float lChi2 = ROOT::Math::Similarity(parameterResiduals, linTrack->predictedStateWeight(error));
47  if (error != 0)
48  return BDpair(false, -1.);
49  return BDpair(true, lChi2);
50 }

◆ trackParameterChi2() [2/2]

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 32 of file KVFHelper.cc.

32  {
33  return trackParameterChi2(track->linearizedTrack(), track->refittedState());
34 }

◆ vertexChi2() [1/2]

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.

5  {
6  return vertexChi2(vertexA.vertexState(), vertexB.vertexState());
7 }

◆ vertexChi2() [2/2]

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
vertexAThe prior vertex state
VertexBThe fitted vertex state

Definition at line 10 of file KVFHelper.cc.

10  {
11  // std::cout <<"Start\n";
12  GlobalPoint inPosition = vertexA.position();
13  GlobalPoint fnPosition = vertexB.position();
14  // std::cout << inPosition<< fnPosition<<std::endl;
15 
16  AlgebraicVector3 oldVertexPositionV;
17  oldVertexPositionV(0) = inPosition.x();
18  oldVertexPositionV(1) = inPosition.y();
19  oldVertexPositionV(2) = inPosition.z();
20 
21  AlgebraicVector3 newVertexPositionV;
22  newVertexPositionV(0) = fnPosition.x();
23  newVertexPositionV(1) = fnPosition.y();
24  newVertexPositionV(2) = fnPosition.z();
25 
26  AlgebraicVector3 positionResidual = newVertexPositionV - oldVertexPositionV;
27 
28  return ROOT::Math::Similarity(positionResidual, vertexA.weight().matrix());
29 }
AlgebraicVector3
ROOT::Math::SVector< double, 3 > AlgebraicVector3
Definition: AlgebraicROOTObjects.h:12
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
KVFHelper::vertexChi2
double vertexChi2(const VertexState &vertexA, const VertexState &VertexB) const
Definition: KVFHelper.cc:10
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
CachingVertex::vertexState
const VertexState & vertexState() const
Definition: CachingVertex.h:137
GlobalErrorBase::matrix
const AlgebraicSymMatrix33 matrix() const
Definition: GlobalErrorBase.h:121
relativeConstraints.error
error
Definition: relativeConstraints.py:53
KVFHelper::trackParameterChi2
BDpair trackParameterChi2(const RefCountedLinearizedTrackState linTrack, const RefCountedRefittedTrackState refittedTrackState) const
Definition: KVFHelper.cc:37
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
KVFHelper::BDpair
std::pair< bool, double > BDpair
Definition: KVFHelper.h:16
Point3DBase< float, GlobalTag >
VertexState::weight
GlobalWeight weight() const
Definition: VertexState.h:69
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
VertexState::position
GlobalPoint position() const
Definition: VertexState.h:62