1 |
bendavid |
1.1 |
Index: RecoVertex/GaussianSumVertexFit/interface/GsfVertexTrackCompatibilityEstimator.h
|
2 |
|
|
===================================================================
|
3 |
|
|
RCS file: /cvs_server/repositories/CMSSW/CMSSW/RecoVertex/GaussianSumVertexFit/interface/GsfVertexTrackCompatibilityEstimator.h,v
|
4 |
|
|
retrieving revision 1.3
|
5 |
|
|
diff -r1.3 GsfVertexTrackCompatibilityEstimator.h
|
6 |
|
|
12a13
|
7 |
|
|
> #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexUpdator.h"
|
8 |
|
|
51a53,56
|
9 |
|
|
> virtual BDpair estimate(const reco::Vertex & vertex,
|
10 |
|
|
> const reco::TransientTrack & track,
|
11 |
|
|
> const reco::TransientTrack & ckfTrack) const;
|
12 |
|
|
>
|
13 |
|
|
63a69
|
14 |
|
|
> KalmanVertexUpdator<5> kalmanUpdater;
|
15 |
|
|
Index: RecoVertex/GaussianSumVertexFit/src/GsfVertexTrackCompatibilityEstimator.cc
|
16 |
|
|
===================================================================
|
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 |
bendavid |
1.2 |
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 |
bendavid |
1.1 |
> std::pair<bool, double>
|
29 |
|
|
> GsfVertexTrackCompatibilityEstimator::estimate(const reco::Vertex & vertex,
|
30 |
|
|
> const reco::TransientTrack & track, const reco::TransientTrack & ckfTrack) const
|
31 |
|
|
> {
|
32 |
|
|
> // GlobalPoint linP(vertex.position().x(), vertex.position().z(),vertex.position().z());
|
33 |
|
|
> GlobalPoint linP(Basic3DVector<float> (vertex.position()));
|
34 |
|
|
>
|
35 |
bendavid |
1.2 |
> const TrajectoryStateOnSurface &tsos = track.stateOnSurface(linP);
|
36 |
|
|
> if (!tsos.isValid()) return BDpair(false,-1.);
|
37 |
bendavid |
1.1 |
> RefCountedLinearizedTrackState linTrack =
|
38 |
bendavid |
1.2 |
> lTrackFactory.linearizedTrackState(linP, track, tsos);
|
39 |
bendavid |
1.1 |
> GlobalError err(vertex.covariance());
|
40 |
|
|
> VertexState vState(linP, err);
|
41 |
|
|
> RefCountedVertexTrack vertexTrack = vTrackFactory.vertexTrack(linTrack, vState);
|
42 |
|
|
>
|
43 |
|
|
> LinearizedTrackStateFactory lTrackFactoryCkf;
|
44 |
bendavid |
1.2 |
> const TrajectoryStateOnSurface &tsosCkf = ckfTrack.impactPointState();
|
45 |
|
|
> if (!tsosCkf.isValid()) return BDpair(false,-1.);
|
46 |
bendavid |
1.1 |
> RefCountedLinearizedTrackState linTrackCkf =
|
47 |
bendavid |
1.2 |
> lTrackFactoryCkf.linearizedTrackState(linP, ckfTrack, tsosCkf);
|
48 |
bendavid |
1.1 |
> RefCountedVertexTrack vertexTrackCkf = vTrackFactory.vertexTrack(linTrackCkf, vState);
|
49 |
|
|
>
|
50 |
|
|
>
|
51 |
|
|
> vector<RefCountedVertexTrack> initialTracks;
|
52 |
|
|
> initialTracks.push_back(vertexTrack);
|
53 |
|
|
> initialTracks.push_back(vertexTrackCkf);
|
54 |
|
|
>
|
55 |
|
|
> CachingVertex<5> cachingVertex(linP, err, initialTracks,
|
56 |
|
|
> vertex.chi2());
|
57 |
|
|
>
|
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 |
bendavid |
1.2 |
> if (!cachingVertex.isValid()) return BDpair(false,-1.);
|
62 |
bendavid |
1.1 |
> }
|
63 |
|
|
>
|
64 |
|
|
> // FIXME: this should work also for tracks without a persistent ref.
|
65 |
|
|
> // const TrackTransientTrack* ttt = dynamic_cast<const TrackTransientTrack*>(track.basicTransientTrack());
|
66 |
|
|
> // if ((ttt!=0) &&
|
67 |
|
|
> if (find(vertex.tracks_begin(), vertex.tracks_end(), track.trackBaseRef()) != vertex.tracks_end())
|
68 |
|
|
> {
|
69 |
|
|
> return estimateFittedTrack(cachingVertex, vertexTrack);
|
70 |
|
|
> } else {
|
71 |
|
|
> return estimateNFittedTrack(cachingVertex, vertexTrack);
|
72 |
|
|
> }
|
73 |
|
|
> }
|
74 |
|
|
>
|