CMS 3D CMS Logo

Public Types | Public Member Functions

KVFHelper< N > Class Template Reference

#include <KVFHelper.h>

List of all members.

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

Referenced by GsfVertexSmoother::createNewComponent().

{

  typedef ROOT::Math::SMatrix<double,N,N,ROOT::Math::MatRepSym<double,N> > AlgebraicSymMatrixNN;
  typedef ROOT::Math::SVector<double,N> AlgebraicVectorN;

  AlgebraicVectorN parameterResiduals = linTrack->predictedStateParameters() -
        linTrack->refittedParamFromEquation(refittedTrackState);
  linTrack->checkParameters(parameterResiduals);
  int error;
  float lChi2 = ROOT::Math::Similarity(parameterResiduals, linTrack->predictedStateWeight(error));
  if (error != 0) return BDpair(false, -1.);
  return BDpair(true, lChi2);
}
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.

{
  return trackParameterChi2(track->linearizedTrack(), track->refittedState());
}
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().

{
// std::cout <<"Start\n";
  GlobalPoint inPosition = vertexA.position();
  GlobalPoint fnPosition = vertexB.position();
//   std::cout << inPosition<< fnPosition<<std::endl;

  AlgebraicVector3 oldVertexPositionV;
  oldVertexPositionV(0) = inPosition.x();
  oldVertexPositionV(1) = inPosition.y();
  oldVertexPositionV(2) = inPosition.z();

  AlgebraicVector3 newVertexPositionV;
  newVertexPositionV(0) = fnPosition.x();
  newVertexPositionV(1) = fnPosition.y();
  newVertexPositionV(2) = fnPosition.z();


  AlgebraicVector3 positionResidual = newVertexPositionV - oldVertexPositionV;

  return ROOT::Math::Similarity(positionResidual, vertexA.weight().matrix_new());
}
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().

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