17 |
|
RCS file: /cvs_server/repositories/CMSSW/CMSSW/RecoVertex/GaussianSumVertexFit/src/GsfVertexTrackCompatibilityEstimator.cc,v |
18 |
|
retrieving revision 1.5 |
19 |
|
diff -r1.5 GsfVertexTrackCompatibilityEstimator.cc |
20 |
< |
73a74,115 |
20 |
> |
53a54,55 |
21 |
> |
> const TrajectoryStateOnSurface &tsos = track.stateOnSurface(linP); |
22 |
> |
> if (!tsos.isValid()) return BDpair(false,-1.); |
23 |
> |
55c57 |
24 |
> |
< lTrackFactory.linearizedTrackState(linP, track); |
25 |
> |
--- |
26 |
> |
> lTrackFactory.linearizedTrackState(linP, track, tsos); |
27 |
> |
73a76,122 |
28 |
|
> std::pair<bool, double> |
29 |
|
> GsfVertexTrackCompatibilityEstimator::estimate(const reco::Vertex & vertex, |
30 |
|
> const reco::TransientTrack & track, const reco::TransientTrack & ckfTrack) const |
32 |
|
> // GlobalPoint linP(vertex.position().x(), vertex.position().z(),vertex.position().z()); |
33 |
|
> GlobalPoint linP(Basic3DVector<float> (vertex.position())); |
34 |
|
> |
35 |
+ |
> const TrajectoryStateOnSurface &tsos = track.stateOnSurface(linP); |
36 |
+ |
> if (!tsos.isValid()) return BDpair(false,-1.); |
37 |
|
> RefCountedLinearizedTrackState linTrack = |
38 |
< |
> lTrackFactory.linearizedTrackState(linP, track); |
38 |
> |
> lTrackFactory.linearizedTrackState(linP, track, tsos); |
39 |
|
> GlobalError err(vertex.covariance()); |
40 |
|
> VertexState vState(linP, err); |
41 |
|
> RefCountedVertexTrack vertexTrack = vTrackFactory.vertexTrack(linTrack, vState); |
42 |
|
> |
43 |
|
> LinearizedTrackStateFactory lTrackFactoryCkf; |
44 |
+ |
> const TrajectoryStateOnSurface &tsosCkf = ckfTrack.impactPointState(); |
45 |
+ |
> if (!tsosCkf.isValid()) return BDpair(false,-1.); |
46 |
|
> RefCountedLinearizedTrackState linTrackCkf = |
47 |
< |
> lTrackFactoryCkf.linearizedTrackState(linP, ckfTrack); |
47 |
> |
> lTrackFactoryCkf.linearizedTrackState(linP, ckfTrack, tsosCkf); |
48 |
|
> RefCountedVertexTrack vertexTrackCkf = vTrackFactory.vertexTrack(linTrackCkf, vState); |
49 |
|
> |
50 |
|
> |
58 |
|
> //remove ckf track corresponding to the gsf track from vertex before computing gsf track compatibility |
59 |
|
> if (find(vertex.tracks_begin(), vertex.tracks_end(), ckfTrack.trackBaseRef()) != vertex.tracks_end()) { |
60 |
|
> cachingVertex = kalmanUpdater.remove(cachingVertex, vertexTrackCkf); |
61 |
+ |
> if (!cachingVertex.isValid()) return BDpair(false,-1.); |
62 |
|
> } |
63 |
|
> |
64 |
|
> // FIXME: this should work also for tracks without a persistent ref. |