CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

GsfVertexTrackCompatibilityEstimator Class Reference

#include <GsfVertexTrackCompatibilityEstimator.h>

Inheritance diagram for GsfVertexTrackCompatibilityEstimator:
VertexTrackCompatibilityEstimator< 5 >

List of all members.

Public Types

typedef CachingVertex
< 5 >::RefCountedVertexTrack 
RefCountedVertexTrack

Public Member Functions

virtual
GsfVertexTrackCompatibilityEstimator
clone () const
virtual BDpair estimate (const CachingVertex< 5 > &v, const RefCountedLinearizedTrackState track) const
virtual BDpair estimate (const reco::Vertex &vertex, const reco::TransientTrack &track) const
virtual BDpair estimate (const CachingVertex< 5 > &vrt, const RefCountedVertexTrack track) const
 GsfVertexTrackCompatibilityEstimator ()
virtual ~GsfVertexTrackCompatibilityEstimator ()

Private Member Functions

BDpair estimateFittedTrack (const CachingVertex< 5 > &v, const RefCountedVertexTrack track) const
BDpair estimateNFittedTrack (const CachingVertex< 5 > &v, const RefCountedVertexTrack track) const

Private Attributes

MultiPerigeeLTSFactory lTrackFactory
GsfVertexUpdator updator
VertexTrackFactory< 5 > vTrackFactory

Detailed Description

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 GsfVertexTrackCompatibilityEstimator.h.


Member Typedef Documentation

Reimplemented from VertexTrackCompatibilityEstimator< 5 >.

Definition at line 30 of file GsfVertexTrackCompatibilityEstimator.h.


Constructor & Destructor Documentation

GsfVertexTrackCompatibilityEstimator::GsfVertexTrackCompatibilityEstimator ( ) [inline]

Definition at line 32 of file GsfVertexTrackCompatibilityEstimator.h.

Referenced by clone().

{}
virtual GsfVertexTrackCompatibilityEstimator::~GsfVertexTrackCompatibilityEstimator ( ) [inline, virtual]

Definition at line 34 of file GsfVertexTrackCompatibilityEstimator.h.

{}

Member Function Documentation

virtual GsfVertexTrackCompatibilityEstimator* GsfVertexTrackCompatibilityEstimator::clone ( void  ) const [inline, virtual]
std::pair< bool, double > GsfVertexTrackCompatibilityEstimator::estimate ( const CachingVertex< 5 > &  vrt,
const RefCountedVertexTrack  track 
) const [virtual]

Track-to-vertex compatibility. The track weight is taken into account.

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

Definition at line 22 of file GsfVertexTrackCompatibilityEstimator.cc.

References pos, CachingVertex< N >::tracks(), and testEve_cfg::tracks.

{
//checking if the track passed really belongs to the vertex
  std::vector<RefCountedVertexTrack> tracks = vertex.tracks();
  std::vector<RefCountedVertexTrack>::iterator pos 
    = find_if(tracks.begin(), tracks.end(), VertexTrackEqual<5>(tr));
 if (pos != tracks.end()) {
   return estimateFittedTrack(vertex,*pos);
 } else {
   return estimateNFittedTrack(vertex,tr);
 }
} 
std::pair< bool, double > GsfVertexTrackCompatibilityEstimator::estimate ( const CachingVertex< 5 > &  v,
const RefCountedLinearizedTrackState  track 
) const [virtual]

Definition at line 38 of file GsfVertexTrackCompatibilityEstimator.cc.

References CachingVertex< N >::vertexState().

{
  RefCountedVertexTrack vertexTrack = vTrackFactory.vertexTrack(track,
                                                 vertex.vertexState());
  return estimate(vertex, vertexTrack);
}
std::pair< bool, double > GsfVertexTrackCompatibilityEstimator::estimate ( const reco::Vertex vertex,
const reco::TransientTrack track 
) const [virtual]

Implements VertexTrackCompatibilityEstimator< 5 >.

Definition at line 48 of file GsfVertexTrackCompatibilityEstimator.cc.

References reco::Vertex::chi2(), reco::Vertex::covariance(), spr::find(), reco::Vertex::position(), reco::TransientTrack::trackBaseRef(), reco::Vertex::tracks_begin(), and reco::Vertex::tracks_end().

{       
//   GlobalPoint linP(vertex.position().x(), vertex.position().z(),vertex.position().z());
    GlobalPoint linP(Basic3DVector<float> (vertex.position()));

  RefCountedLinearizedTrackState linTrack = 
                        lTrackFactory.linearizedTrackState(linP, track);
  GlobalError err(vertex.covariance());
  VertexState vState(linP, err);
  RefCountedVertexTrack vertexTrack = vTrackFactory.vertexTrack(linTrack, vState);

  std::vector<RefCountedVertexTrack> initialTracks(1, vertexTrack);
  CachingVertex<5> cachingVertex(linP, err, initialTracks,
                            vertex.chi2());
  // FIXME: this should work also for tracks without a persistent ref.
//   const TrackTransientTrack* ttt = dynamic_cast<const TrackTransientTrack*>(track.basicTransientTrack());
//   if ((ttt!=0) && 
  if (find(vertex.tracks_begin(), vertex.tracks_end(), track.trackBaseRef()) != vertex.tracks_end())
  {
    return estimateFittedTrack(cachingVertex, vertexTrack);
  } else {
    return estimateNFittedTrack(cachingVertex, vertexTrack);
  }
}
std::pair< bool, double > GsfVertexTrackCompatibilityEstimator::estimateFittedTrack ( const CachingVertex< 5 > &  v,
const RefCountedVertexTrack  track 
) const [private]

Definition at line 81 of file GsfVertexTrackCompatibilityEstimator.cc.

{
  //remove track from the vertex using the vertex updator
  // Using the update instead of the remove methode, we can specify a weight which
  // is different than then one which the vertex track has been defined with.
  if (track->refittedStateAvailable()) return BDpair(true, track->smoothedChi2());
  throw VertexException
    ("GsfVertexTrackCompatibilityEstimator::vertex has to be smoothed.");

//   CachingVertex rVert = updator.remove(v, track);
//   RefCountedVertexTrack newSmoothedTrack = trackUpdator.update(v, track);
//   return estimateDifference(v,rVert,newSmoothedTrack);
}
std::pair< bool, double > GsfVertexTrackCompatibilityEstimator::estimateNFittedTrack ( const CachingVertex< 5 > &  v,
const RefCountedVertexTrack  track 
) const [private]

Definition at line 99 of file GsfVertexTrackCompatibilityEstimator.cc.

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

{
  // Using the update instead of the add methode, we can specify a weight which
  // is different than then one which the vertex track has been defined with.
  CachingVertex<5> rVert = updator.add(v, track);
  if (!rVert.isValid()) return BDpair(false,-1.);
  return BDpair(true, rVert.totalChiSquared()-v.totalChiSquared());
}   

Member Data Documentation

Definition at line 65 of file GsfVertexTrackCompatibilityEstimator.h.

Definition at line 63 of file GsfVertexTrackCompatibilityEstimator.h.

Definition at line 66 of file GsfVertexTrackCompatibilityEstimator.h.