CMS 3D CMS Logo

KalmanVertexTrackCompatibilityEstimator< N > Class Template Reference

Calculates the compatiblity of a track with respect to a vertex using the Kalman filter algorithms. More...

#include <RecoVertex/KalmanVertexFit/interface/KalmanVertexTrackCompatibilityEstimator.h>

Inheritance diagram for KalmanVertexTrackCompatibilityEstimator< N >:

VertexTrackCompatibilityEstimator< N >

List of all members.

Public Types

typedef VertexTrack< N >
::RefCountedLinearizedTrackState 
RefCountedLinearizedTrackState
typedef VertexTrack< N >
::RefCountedRefittedTrackState 
RefCountedRefittedTrackState
typedef CachingVertex< N >
::RefCountedVertexTrack 
RefCountedVertexTrack

Public Member Functions

virtual
KalmanVertexTrackCompatibilityEstimator
< N > * 
clone () const
 Clone method.
virtual float estimate (const reco::Vertex &vertex, const reco::TransientTrack &track) const
virtual float estimate (const CachingVertex< N > &v, const RefCountedLinearizedTrackState track) const
 Methods giving back the compatibility estimation.
virtual float estimate (const CachingVertex< N > &vrt, const RefCountedVertexTrack track) const
 Track-to-vertex compatibility.
 KalmanVertexTrackCompatibilityEstimator ()
virtual ~KalmanVertexTrackCompatibilityEstimator ()

Private Member Functions

float estimateDifference (const CachingVertex< N > &more, const CachingVertex< N > &less, const RefCountedVertexTrack track) const
float estimateFittedTrack (const CachingVertex< N > &v, const RefCountedVertexTrack track) const
float estimateNFittedTrack (const CachingVertex< N > &v, const RefCountedVertexTrack track) const

Private Attributes

KVFHelper< N > helper
KalmanVertexTrackUpdator< N > trackUpdator
KalmanVertexUpdator< N > updator
VertexTrackFactory< N > vTrackFactory


Detailed Description

template<unsigned int N>
class KalmanVertexTrackCompatibilityEstimator< N >

Calculates the compatiblity of a track with respect to a vertex using the Kalman filter algorithms.

The compatibility is computed from the squared standardized residuals between the track and the vertex. If track and vertex errors are Gaussian and correct, this quantity is distributed as chi**2(ndf=2)). Can be used to identify outlying tracks.

Definition at line 25 of file KalmanVertexTrackCompatibilityEstimator.h.


Member Typedef Documentation

template<unsigned int N>
typedef VertexTrack<N>::RefCountedLinearizedTrackState KalmanVertexTrackCompatibilityEstimator< N >::RefCountedLinearizedTrackState

Reimplemented from VertexTrackCompatibilityEstimator< N >.

Definition at line 31 of file KalmanVertexTrackCompatibilityEstimator.h.

template<unsigned int N>
typedef VertexTrack<N>::RefCountedRefittedTrackState KalmanVertexTrackCompatibilityEstimator< N >::RefCountedRefittedTrackState

Definition at line 32 of file KalmanVertexTrackCompatibilityEstimator.h.

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

Reimplemented from VertexTrackCompatibilityEstimator< N >.

Definition at line 30 of file KalmanVertexTrackCompatibilityEstimator.h.


Constructor & Destructor Documentation

template<unsigned int N>
KalmanVertexTrackCompatibilityEstimator< N >::KalmanVertexTrackCompatibilityEstimator (  )  [inline]

Definition at line 34 of file KalmanVertexTrackCompatibilityEstimator.h.

Referenced by KalmanVertexTrackCompatibilityEstimator< N >::clone().

00034 {}

template<unsigned int N>
virtual KalmanVertexTrackCompatibilityEstimator< N >::~KalmanVertexTrackCompatibilityEstimator (  )  [inline, virtual]

Definition at line 36 of file KalmanVertexTrackCompatibilityEstimator.h.

00036 {}


Member Function Documentation

template<unsigned int N>
virtual KalmanVertexTrackCompatibilityEstimator<N>* KalmanVertexTrackCompatibilityEstimator< N >::clone (  )  const [inline, virtual]

Clone method.

Implements VertexTrackCompatibilityEstimator< N >.

Definition at line 54 of file KalmanVertexTrackCompatibilityEstimator.h.

References KalmanVertexTrackCompatibilityEstimator< N >::KalmanVertexTrackCompatibilityEstimator().

00055   {
00056     return new KalmanVertexTrackCompatibilityEstimator(* this);
00057   }

template<unsigned int N>
float KalmanVertexTrackCompatibilityEstimator< N >::estimate ( const reco::Vertex vertex,
const reco::TransientTrack track 
) const [inline, virtual]

Implements VertexTrackCompatibilityEstimator< N >.

Definition at line 36 of file KalmanVertexTrackCompatibilityEstimator.cc.

References reco::Vertex::chi2(), RecoVertex::convertError(), reco::Vertex::covariance(), err, KalmanVertexTrackCompatibilityEstimator< N >::estimateFittedTrack(), KalmanVertexTrackCompatibilityEstimator< N >::estimateNFittedTrack(), find(), LinearizedTrackStateFactory::linearizedTrackState(), reco::Vertex::position(), reco::TransientTrack::trackBaseRef(), reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), and KalmanVertexTrackCompatibilityEstimator< N >::vTrackFactory.

00038 {       
00039 //   GlobalPoint linP(vertex.position().x(), vertex.position().z(),vertex.position().z());
00040     GlobalPoint linP(Basic3DVector<float> (vertex.position()));
00041 
00042   LinearizedTrackStateFactory lTrackFactory;
00043   RefCountedLinearizedTrackState linTrack = 
00044                         lTrackFactory.linearizedTrackState(linP, track);
00045   GlobalError err(RecoVertex::convertError(vertex.covariance()));
00046   VertexState vState(linP, err);
00047   RefCountedVertexTrack vertexTrack = vTrackFactory.vertexTrack(linTrack, vState);
00048 
00049   vector<RefCountedVertexTrack> initialTracks(1, vertexTrack);
00050   CachingVertex<N> cachingVertex(linP, err, initialTracks,
00051                             vertex.chi2());
00052   // FIXME: this should work also for tracks without a persistent ref.
00053 //   return estimateNFittedTrack(cachingVertex, vertexTrack);
00054   if (find(vertex.tracks_begin(), vertex.tracks_end(), track.trackBaseRef()) != vertex.tracks_end())
00055   {
00056     return estimateFittedTrack(cachingVertex, vertexTrack);
00057   } else {
00058     return estimateNFittedTrack(cachingVertex, vertexTrack);
00059   }
00060 }

template<unsigned int N>
virtual float KalmanVertexTrackCompatibilityEstimator< N >::estimate ( const CachingVertex< N > &  v,
const RefCountedLinearizedTrackState  track 
) const [virtual]

Methods giving back the compatibility estimation.

Implements VertexTrackCompatibilityEstimator< N >.

template<unsigned int N>
float KalmanVertexTrackCompatibilityEstimator< N >::estimate ( const CachingVertex< N > &  vrt,
const RefCountedVertexTrack  track 
) const [inline, virtual]

Track-to-vertex compatibility.

The track weight is taken into account.

Parameters:
track The track for which the chi**2 has to be estimated.
v The vertex against which the chi**2 has to be estimated.
Returns:
The chi**2.

Implements VertexTrackCompatibilityEstimator< N >.

Definition at line 10 of file KalmanVertexTrackCompatibilityEstimator.cc.

References KalmanVertexTrackCompatibilityEstimator< N >::estimateFittedTrack(), KalmanVertexTrackCompatibilityEstimator< N >::estimateNFittedTrack(), CachingVertex< N >::tracks(), and tracks.

Referenced by MultiVertexFitter::updateWeights().

00012 {
00013 //checking if the track passed really belongs to the vertex
00014   vector<RefCountedVertexTrack> tracks = vertex.tracks();
00015   typename vector<RefCountedVertexTrack>::iterator pos 
00016     = find_if(tracks.begin(), tracks.end(), VertexTrackEqual<N>(tr));
00017  if(pos != tracks.end()) {
00018    return estimateFittedTrack(vertex,*pos);
00019  } else {
00020    return estimateNFittedTrack(vertex,tr);
00021  }
00022 } 

template<unsigned int N>
float KalmanVertexTrackCompatibilityEstimator< N >::estimateDifference ( const CachingVertex< N > &  more,
const CachingVertex< N > &  less,
const RefCountedVertexTrack  track 
) const [inline, private]

Definition at line 97 of file KalmanVertexTrackCompatibilityEstimator.cc.

References KalmanVertexTrackCompatibilityEstimator< N >::helper.

00099 {
00100   return helper.vertexChi2(less, more) + helper.trackParameterChi2(track);
00101 }

template<unsigned int N>
float KalmanVertexTrackCompatibilityEstimator< N >::estimateFittedTrack ( const CachingVertex< N > &  v,
const RefCountedVertexTrack  track 
) const [inline, private]

Definition at line 69 of file KalmanVertexTrackCompatibilityEstimator.cc.

References KalmanVertexTrackCompatibilityEstimator< N >::trackUpdator.

Referenced by KalmanVertexTrackCompatibilityEstimator< N >::estimate().

00070 {
00071   //remove track from the vertex using the vertex updator
00072   // Using the update instead of the remove methode, we can specify a weight which
00073   // is different than then one which the vertex track has been defined with.
00074   //CachingVertex rVert = updator.remove(v, track);
00075   RefCountedVertexTrack newSmoothedTrack = trackUpdator.update(v, track);
00076 //   cout << newSmoothedTrack->smoothedChi2()<<" "<<estimateDifference(v,rVert,newSmoothedTrack)<<endl;
00077 //   return estimateDifference(v,rVert,newSmoothedTrack);
00078   return newSmoothedTrack->smoothedChi2();
00079 }

template<unsigned int N>
float KalmanVertexTrackCompatibilityEstimator< N >::estimateNFittedTrack ( const CachingVertex< N > &  v,
const RefCountedVertexTrack  track 
) const [inline, private]

Definition at line 85 of file KalmanVertexTrackCompatibilityEstimator.cc.

References CachingVertex< N >::totalChiSquared(), and KalmanVertexTrackCompatibilityEstimator< N >::updator.

Referenced by KalmanVertexTrackCompatibilityEstimator< N >::estimate().

00086 {
00087   // Using the update instead of the add methode, we can specify a weight which
00088   // is different than then one which the vertex track has been defined with.
00089   CachingVertex<N> rVert = updator.add(v, track);
00090   return (rVert.totalChiSquared()-v.totalChiSquared());
00091 }   


Member Data Documentation

template<unsigned int N>
KVFHelper<N> KalmanVertexTrackCompatibilityEstimator< N >::helper [private]

Definition at line 69 of file KalmanVertexTrackCompatibilityEstimator.h.

Referenced by KalmanVertexTrackCompatibilityEstimator< N >::estimateDifference().

template<unsigned int N>
KalmanVertexTrackUpdator<N> KalmanVertexTrackCompatibilityEstimator< N >::trackUpdator [private]

Definition at line 67 of file KalmanVertexTrackCompatibilityEstimator.h.

Referenced by KalmanVertexTrackCompatibilityEstimator< N >::estimateFittedTrack().

template<unsigned int N>
KalmanVertexUpdator<N> KalmanVertexTrackCompatibilityEstimator< N >::updator [private]

Definition at line 66 of file KalmanVertexTrackCompatibilityEstimator.h.

Referenced by KalmanVertexTrackCompatibilityEstimator< N >::estimateNFittedTrack().

template<unsigned int N>
VertexTrackFactory<N> KalmanVertexTrackCompatibilityEstimator< N >::vTrackFactory [private]

Definition at line 68 of file KalmanVertexTrackCompatibilityEstimator.h.

Referenced by KalmanVertexTrackCompatibilityEstimator< N >::estimate().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:16 2009 for CMSSW by  doxygen 1.5.4