#include <RecoVertex/GaussianSumVertexFit/interface/GsfVertexTrackCompatibilityEstimator.h>
Public Types | |
typedef CachingVertex < 5 >::RefCountedVertexTrack | RefCountedVertexTrack |
Public Member Functions | |
virtual GsfVertexTrackCompatibilityEstimator * | clone () const |
Clone method. | |
virtual float | estimate (const reco::Vertex &vertex, const reco::TransientTrack &track) const |
virtual float | estimate (const CachingVertex< 5 > &v, const RefCountedLinearizedTrackState track) const |
virtual float | estimate (const CachingVertex< 5 > &vrt, const RefCountedVertexTrack track) const |
Track-to-vertex compatibility. | |
GsfVertexTrackCompatibilityEstimator () | |
virtual | ~GsfVertexTrackCompatibilityEstimator () |
Private Member Functions | |
float | estimateFittedTrack (const CachingVertex< 5 > &v, const RefCountedVertexTrack track) const |
float | estimateNFittedTrack (const CachingVertex< 5 > &v, const RefCountedVertexTrack track) const |
Private Attributes | |
MultiPerigeeLTSFactory | lTrackFactory |
GsfVertexUpdator | updator |
VertexTrackFactory< 5 > | vTrackFactory |
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.
typedef CachingVertex<5>::RefCountedVertexTrack GsfVertexTrackCompatibilityEstimator::RefCountedVertexTrack |
Reimplemented from VertexTrackCompatibilityEstimator< 5 >.
Definition at line 30 of file GsfVertexTrackCompatibilityEstimator.h.
GsfVertexTrackCompatibilityEstimator::GsfVertexTrackCompatibilityEstimator | ( | ) | [inline] |
virtual GsfVertexTrackCompatibilityEstimator::~GsfVertexTrackCompatibilityEstimator | ( | ) | [inline, virtual] |
virtual GsfVertexTrackCompatibilityEstimator* GsfVertexTrackCompatibilityEstimator::clone | ( | void | ) | const [inline, virtual] |
Clone method.
Implements VertexTrackCompatibilityEstimator< 5 >.
Definition at line 52 of file GsfVertexTrackCompatibilityEstimator.h.
References GsfVertexTrackCompatibilityEstimator().
00053 { 00054 return new GsfVertexTrackCompatibilityEstimator(* this); 00055 }
float GsfVertexTrackCompatibilityEstimator::estimate | ( | const reco::Vertex & | vertex, | |
const reco::TransientTrack & | track | |||
) | const [virtual] |
Implements VertexTrackCompatibilityEstimator< 5 >.
Definition at line 49 of file GsfVertexTrackCompatibilityEstimator.cc.
References reco::Vertex::chi2(), RecoVertex::convertError(), reco::Vertex::covariance(), err, estimateFittedTrack(), estimateNFittedTrack(), find(), MultiPerigeeLTSFactory::linearizedTrackState(), lTrackFactory, reco::Vertex::position(), reco::TransientTrack::trackBaseRef(), reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), VertexTrackFactory< N >::vertexTrack(), and vTrackFactory.
00051 { 00052 // GlobalPoint linP(vertex.position().x(), vertex.position().z(),vertex.position().z()); 00053 GlobalPoint linP(Basic3DVector<float> (vertex.position())); 00054 00055 RefCountedLinearizedTrackState linTrack = 00056 lTrackFactory.linearizedTrackState(linP, track); 00057 GlobalError err(RecoVertex::convertError(vertex.covariance())); 00058 VertexState vState(linP, err); 00059 RefCountedVertexTrack vertexTrack = vTrackFactory.vertexTrack(linTrack, vState); 00060 00061 vector<RefCountedVertexTrack> initialTracks(1, vertexTrack); 00062 CachingVertex<5> cachingVertex(linP, err, initialTracks, 00063 vertex.chi2()); 00064 // FIXME: this should work also for tracks without a persistent ref. 00065 // const TrackTransientTrack* ttt = dynamic_cast<const TrackTransientTrack*>(track.basicTransientTrack()); 00066 // if ((ttt!=0) && 00067 if (find(vertex.tracks_begin(), vertex.tracks_end(), track.trackBaseRef()) != vertex.tracks_end()) 00068 { 00069 return estimateFittedTrack(cachingVertex, vertexTrack); 00070 } else { 00071 return estimateNFittedTrack(cachingVertex, vertexTrack); 00072 } 00073 }
virtual float GsfVertexTrackCompatibilityEstimator::estimate | ( | const CachingVertex< 5 > & | v, | |
const RefCountedLinearizedTrackState | track | |||
) | const [virtual] |
float GsfVertexTrackCompatibilityEstimator::estimate | ( | const CachingVertex< 5 > & | vrt, | |
const RefCountedVertexTrack | track | |||
) | const [virtual] |
Track-to-vertex compatibility.
The track weight is taken into account.
track | The track for which the chi**2 has to be estimated. | |
v | The vertex against which the chi**2 has to be estimated. |
Definition at line 23 of file GsfVertexTrackCompatibilityEstimator.cc.
References estimateFittedTrack(), estimateNFittedTrack(), CachingVertex< N >::tracks(), and tracks.
00025 { 00026 //checking if the track passed really belongs to the vertex 00027 vector<RefCountedVertexTrack> tracks = vertex.tracks(); 00028 vector<RefCountedVertexTrack>::iterator pos 00029 = find_if(tracks.begin(), tracks.end(), VertexTrackEqual<5>(tr)); 00030 if (pos != tracks.end()) { 00031 return estimateFittedTrack(vertex,*pos); 00032 } else { 00033 return estimateNFittedTrack(vertex,tr); 00034 } 00035 }
float GsfVertexTrackCompatibilityEstimator::estimateFittedTrack | ( | const CachingVertex< 5 > & | v, | |
const RefCountedVertexTrack | track | |||
) | const [private] |
Definition at line 82 of file GsfVertexTrackCompatibilityEstimator.cc.
Referenced by estimate().
00083 { 00084 //remove track from the vertex using the vertex updator 00085 // Using the update instead of the remove methode, we can specify a weight which 00086 // is different than then one which the vertex track has been defined with. 00087 if (track->refittedStateAvailable()) return track->smoothedChi2(); 00088 throw VertexException 00089 ("GsfVertexTrackCompatibilityEstimator::vertex has to be smmothed."); 00090 00091 // CachingVertex rVert = updator.remove(v, track); 00092 // RefCountedVertexTrack newSmoothedTrack = trackUpdator.update(v, track); 00093 // return estimateDifference(v,rVert,newSmoothedTrack); 00094 }
float GsfVertexTrackCompatibilityEstimator::estimateNFittedTrack | ( | const CachingVertex< 5 > & | v, | |
const RefCountedVertexTrack | track | |||
) | const [private] |
Definition at line 99 of file GsfVertexTrackCompatibilityEstimator.cc.
References GsfVertexUpdator::add(), CachingVertex< N >::totalChiSquared(), and updator.
Referenced by estimate().
00100 { 00101 // Using the update instead of the add methode, we can specify a weight which 00102 // is different than then one which the vertex track has been defined with. 00103 CachingVertex<5> rVert = updator.add(v, track); 00104 return (rVert.totalChiSquared()-v.totalChiSquared()); 00105 }
Definition at line 63 of file GsfVertexTrackCompatibilityEstimator.h.
Referenced by estimateNFittedTrack().