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 |
73a74,115
|
21 |
> std::pair<bool, double>
|
22 |
> GsfVertexTrackCompatibilityEstimator::estimate(const reco::Vertex & vertex,
|
23 |
> const reco::TransientTrack & track, const reco::TransientTrack & ckfTrack) const
|
24 |
> {
|
25 |
> // GlobalPoint linP(vertex.position().x(), vertex.position().z(),vertex.position().z());
|
26 |
> GlobalPoint linP(Basic3DVector<float> (vertex.position()));
|
27 |
>
|
28 |
> RefCountedLinearizedTrackState linTrack =
|
29 |
> lTrackFactory.linearizedTrackState(linP, track);
|
30 |
> GlobalError err(vertex.covariance());
|
31 |
> VertexState vState(linP, err);
|
32 |
> RefCountedVertexTrack vertexTrack = vTrackFactory.vertexTrack(linTrack, vState);
|
33 |
>
|
34 |
> LinearizedTrackStateFactory lTrackFactoryCkf;
|
35 |
> RefCountedLinearizedTrackState linTrackCkf =
|
36 |
> lTrackFactoryCkf.linearizedTrackState(linP, ckfTrack);
|
37 |
> RefCountedVertexTrack vertexTrackCkf = vTrackFactory.vertexTrack(linTrackCkf, vState);
|
38 |
>
|
39 |
>
|
40 |
> vector<RefCountedVertexTrack> initialTracks;
|
41 |
> initialTracks.push_back(vertexTrack);
|
42 |
> initialTracks.push_back(vertexTrackCkf);
|
43 |
>
|
44 |
> CachingVertex<5> cachingVertex(linP, err, initialTracks,
|
45 |
> vertex.chi2());
|
46 |
>
|
47 |
> //remove ckf track corresponding to the gsf track from vertex before computing gsf track compatibility
|
48 |
> if (find(vertex.tracks_begin(), vertex.tracks_end(), ckfTrack.trackBaseRef()) != vertex.tracks_end()) {
|
49 |
> cachingVertex = kalmanUpdater.remove(cachingVertex, vertexTrackCkf);
|
50 |
> }
|
51 |
>
|
52 |
> // FIXME: this should work also for tracks without a persistent ref.
|
53 |
> // const TrackTransientTrack* ttt = dynamic_cast<const TrackTransientTrack*>(track.basicTransientTrack());
|
54 |
> // if ((ttt!=0) &&
|
55 |
> if (find(vertex.tracks_begin(), vertex.tracks_end(), track.trackBaseRef()) != vertex.tracks_end())
|
56 |
> {
|
57 |
> return estimateFittedTrack(cachingVertex, vertexTrack);
|
58 |
> } else {
|
59 |
> return estimateNFittedTrack(cachingVertex, vertexTrack);
|
60 |
> }
|
61 |
> }
|
62 |
>
|