#include <KalmanVertexTrackCompatibilityEstimator.h>
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.
typedef std::pair<bool, double> KalmanVertexTrackCompatibilityEstimator< N >::BDpair |
Reimplemented from VertexTrackCompatibilityEstimator< N >.
Definition at line 33 of file KalmanVertexTrackCompatibilityEstimator.h.
typedef VertexTrack<N>::RefCountedLinearizedTrackState KalmanVertexTrackCompatibilityEstimator< N >::RefCountedLinearizedTrackState |
Reimplemented from VertexTrackCompatibilityEstimator< N >.
Definition at line 31 of file KalmanVertexTrackCompatibilityEstimator.h.
typedef VertexTrack<N>::RefCountedRefittedTrackState KalmanVertexTrackCompatibilityEstimator< N >::RefCountedRefittedTrackState |
Definition at line 32 of file KalmanVertexTrackCompatibilityEstimator.h.
typedef CachingVertex<N>::RefCountedVertexTrack KalmanVertexTrackCompatibilityEstimator< N >::RefCountedVertexTrack |
Reimplemented from VertexTrackCompatibilityEstimator< N >.
Definition at line 30 of file KalmanVertexTrackCompatibilityEstimator.h.
KalmanVertexTrackCompatibilityEstimator< N >::KalmanVertexTrackCompatibilityEstimator | ( | ) | [inline] |
Definition at line 35 of file KalmanVertexTrackCompatibilityEstimator.h.
Referenced by KalmanVertexTrackCompatibilityEstimator< N >::clone().
{}
virtual KalmanVertexTrackCompatibilityEstimator< N >::~KalmanVertexTrackCompatibilityEstimator | ( | ) | [inline, virtual] |
Definition at line 37 of file KalmanVertexTrackCompatibilityEstimator.h.
{}
virtual KalmanVertexTrackCompatibilityEstimator<N>* KalmanVertexTrackCompatibilityEstimator< N >::clone | ( | ) | const [inline, virtual] |
Clone method
Implements VertexTrackCompatibilityEstimator< N >.
Definition at line 57 of file KalmanVertexTrackCompatibilityEstimator.h.
References KalmanVertexTrackCompatibilityEstimator< N >::KalmanVertexTrackCompatibilityEstimator().
{ return new KalmanVertexTrackCompatibilityEstimator(* this); }
KalmanVertexTrackCompatibilityEstimator< N >::BDpair KalmanVertexTrackCompatibilityEstimator< N >::estimate | ( | const CachingVertex< N > & | 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. |
Implements VertexTrackCompatibilityEstimator< N >.
Definition at line 10 of file KalmanVertexTrackCompatibilityEstimator.cc.
References pos, testEve_cfg::tracks, and CachingVertex< N >::tracksRef().
Referenced by MultiVertexFitter::updateWeights().
{ //checking if the track passed really belongs to the vertex const std::vector<RefCountedVertexTrack> &tracks = vertex.tracksRef(); if ( tracks.size()==0) return estimateNFittedTrack(vertex,tr); if (hint<tracks.size() ) { VertexTrackEqual<N> d(tr); if ( d(tracks[hint])) return estimateFittedTrack(vertex,tracks[hint]); } typename std::vector<RefCountedVertexTrack>::const_iterator pos = find_if(tracks.begin(), tracks.end(), VertexTrackEqual<N>(tr)); if(pos != tracks.end()) { return estimateFittedTrack(vertex,*pos); } else { return estimateNFittedTrack(vertex,tr); } }
KalmanVertexTrackCompatibilityEstimator< N >::BDpair KalmanVertexTrackCompatibilityEstimator< N >::estimate | ( | const CachingVertex< N > & | v, |
const RefCountedLinearizedTrackState | track, | ||
unsigned int | hint = UINT_MAX |
||
) | const [virtual] |
Methods giving back the compatibility estimation
Implements VertexTrackCompatibilityEstimator< N >.
Definition at line 39 of file KalmanVertexTrackCompatibilityEstimator.cc.
References CachingVertex< N >::vertexState().
{ RefCountedVertexTrack vertexTrack = vTrackFactory.vertexTrack(track, vertex.vertexState()); return estimate(vertex, vertexTrack,hint); }
KalmanVertexTrackCompatibilityEstimator< N >::BDpair KalmanVertexTrackCompatibilityEstimator< N >::estimate | ( | const reco::Vertex & | vertex, |
const reco::TransientTrack & | track | ||
) | const [virtual] |
Implements VertexTrackCompatibilityEstimator< N >.
Definition at line 51 of file KalmanVertexTrackCompatibilityEstimator.cc.
References reco::Vertex::chi2(), reco::Vertex::covariance(), spr::find(), LinearizedTrackStateFactory::linearizedTrackState(), 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())); LinearizedTrackStateFactory lTrackFactory; 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<N> cachingVertex(linP, err, initialTracks, vertex.chi2()); // FIXME: this should work also for tracks without a persistent ref. // return estimateNFittedTrack(cachingVertex, vertexTrack); if (find(vertex.tracks_begin(), vertex.tracks_end(), track.trackBaseRef()) != vertex.tracks_end()) { return estimateFittedTrack(cachingVertex, vertexTrack); } else { return estimateNFittedTrack(cachingVertex, vertexTrack); } }
KalmanVertexTrackCompatibilityEstimator< N >::BDpair KalmanVertexTrackCompatibilityEstimator< N >::estimateDifference | ( | const CachingVertex< N > & | more, |
const CachingVertex< N > & | less, | ||
const RefCountedVertexTrack | track | ||
) | const [private] |
KalmanVertexTrackCompatibilityEstimator< N >::BDpair KalmanVertexTrackCompatibilityEstimator< N >::estimateFittedTrack | ( | const CachingVertex< N > & | v, |
const RefCountedVertexTrack | track | ||
) | const [private] |
Definition at line 85 of file KalmanVertexTrackCompatibilityEstimator.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. //CachingVertex rVert = updator.remove(v, track); RefCountedVertexTrack newSmoothedTrack = trackUpdator.update(v, track); // std::cout << newSmoothedTrack->smoothedChi2()<<" "<<estimateDifference(v,rVert,newSmoothedTrack)<<std::endl; // return estimateDifference(v,rVert,newSmoothedTrack); return BDpair(true, newSmoothedTrack->smoothedChi2()); }
KalmanVertexTrackCompatibilityEstimator< N >::BDpair KalmanVertexTrackCompatibilityEstimator< N >::estimateNFittedTrack | ( | const CachingVertex< N > & | v, |
const RefCountedVertexTrack | track | ||
) | const [private] |
Definition at line 102 of file KalmanVertexTrackCompatibilityEstimator.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<N> rVert = updator.add(v, track); if (!rVert.isValid()) return BDpair(false,-1.); return BDpair(true, rVert.totalChiSquared()-v.totalChiSquared()); }
KVFHelper<N> KalmanVertexTrackCompatibilityEstimator< N >::helper [private] |
Definition at line 72 of file KalmanVertexTrackCompatibilityEstimator.h.
KalmanVertexTrackUpdator<N> KalmanVertexTrackCompatibilityEstimator< N >::trackUpdator [private] |
Definition at line 70 of file KalmanVertexTrackCompatibilityEstimator.h.
KalmanVertexUpdator<N> KalmanVertexTrackCompatibilityEstimator< N >::updator [private] |
Definition at line 69 of file KalmanVertexTrackCompatibilityEstimator.h.
VertexTrackFactory<N> KalmanVertexTrackCompatibilityEstimator< N >::vTrackFactory [private] |
Definition at line 71 of file KalmanVertexTrackCompatibilityEstimator.h.