#include <GsfVertexTrackCompatibilityEstimator.h>
Public Types | |
typedef CachingVertex < 5 >::RefCountedVertexTrack | RefCountedVertexTrack |
Public Member Functions | |
virtual GsfVertexTrackCompatibilityEstimator * | clone () const |
virtual BDpair | estimate (const CachingVertex< 5 > &v, const RefCountedLinearizedTrackState track, unsigned int hint=UINT_MAX) const |
virtual BDpair | estimate (const reco::Vertex &vertex, const reco::TransientTrack &track) const |
virtual BDpair | estimate (const CachingVertex< 5 > &vrt, const RefCountedVertexTrack track, unsigned int hint=UINT_MAX) 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 |
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.
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] |
Definition at line 34 of file GsfVertexTrackCompatibilityEstimator.h.
{}
virtual GsfVertexTrackCompatibilityEstimator* GsfVertexTrackCompatibilityEstimator::clone | ( | void | ) | const [inline, virtual] |
Clone method
Implements VertexTrackCompatibilityEstimator< 5 >.
Definition at line 54 of file GsfVertexTrackCompatibilityEstimator.h.
References GsfVertexTrackCompatibilityEstimator().
{ return new GsfVertexTrackCompatibilityEstimator(* this); }
std::pair< bool, double > GsfVertexTrackCompatibilityEstimator::estimate | ( | const CachingVertex< 5 > & | vrt, |
const RefCountedVertexTrack | track, | ||
unsigned int | hint = UINT_MAX |
||
) | 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 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, | ||
unsigned int | hint = UINT_MAX |
||
) | 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 49 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 82 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 100 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()); }
Definition at line 67 of file GsfVertexTrackCompatibilityEstimator.h.
Definition at line 65 of file GsfVertexTrackCompatibilityEstimator.h.
Definition at line 68 of file GsfVertexTrackCompatibilityEstimator.h.