12 : theFitter(vf->
clone()), theUpdator(vu->
clone()),
13 theEstimator(ve->
clone()), theMinProb(0.05)
32 std::vector<TransientVertex>
39 std::vector<TransientVertex>
43 std::vector<TransientVertex>
all;
44 if (tks.size() < 2)
return all;
56 <<
" vertex finding stops here.";
60 std::vector<RefCountedVertexTrack> selected = vtx.
tracks();
63 std::vector<RefCountedVertexTrack> remain;
65 while (!found && selected.size() >= 2) {
68 std::vector<RefCountedVertexTrack>::iterator iWorst =
theWorst(vtx,
72 if (iWorst != selected.end()) {
74 remain.push_back(*iWorst);
75 selected.erase(iWorst);
77 if (selected.size() == 1) {
79 remain.push_back(selected.front());
95 <<
"vertex finding stops here.";
107 int n_tracks_in_vertex = selected.size();
110 for ( std::vector< RefCountedVertexTrack >::const_iterator
t=selected.begin();
111 t!=selected.end() ; ++
t )
113 if ( (**t).weight() < 0.5 )
118 remain.push_back ( *
t );
119 n_tracks_in_vertex--;
123 if ( n_tracks_in_vertex > 1 ) {
128 <<
"found vertex has less than 2 tracks";
135 for (std::vector<RefCountedVertexTrack>::const_iterator
i = remain.begin();
136 i != remain.end();
i++) {
139 ((**i).linearizedTrack().get());
141 throw cms::Exception(
"TrimmedVertexFinder: can't take track from non-perigee track state");
144 tks.push_back(plts->
track());
152 std::vector<TrimmedVertexFinder::RefCountedVertexTrack>::iterator
154 std::vector<RefCountedVertexTrack> &
vtxTracks,
float cut)
const 160 std::vector<RefCountedVertexTrack>::iterator iWorst = vtxTracks.end();
161 float worseChi2 = 0.;
162 for (std::vector<RefCountedVertexTrack>::iterator itr = vtxTracks.begin();
163 itr != vtxTracks.end(); itr++) {
166 if (!newV.
isValid())
return itr;
168 if (!result.first)
return itr;
169 float chi2 = result.second;
176 if (vtx.
tracks().size() == 2) ndf = 1;
179 if (prob < cut && chi2 >= worseChi2) {
virtual CachingVertex< N > remove(const CachingVertex< N > &v, const typename CachingVertex< N >::RefCountedVertexTrack t) const =0
std::vector< RefCountedVertexTrack > tracks() const
virtual reco::TransientTrack track() const
TrimmedVertexFinder * clone() const
VertexUpdator< 5 > * theUpdator
VertexTrackCompatibilityEstimator< 5 > * theEstimator
float ChiSquaredProbability(double chiSquared, double nrDOF)
virtual CachingVertex< N > vertex(const std::vector< reco::TransientTrack > &tracks) const =0
std::vector< RefCountedVertexTrack >::iterator theWorst(const CachingVertex< 5 > &vtx, std::vector< RefCountedVertexTrack > &vtxTracks, float cut) const
std::vector< TransientVertex > vertices(std::vector< reco::TransientTrack > &remain) const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
VertexFitter< 5 > * theFitter
TrimmedVertexFinder(const VertexFitter< 5 > *vf, const VertexUpdator< 5 > *vu, const VertexTrackCompatibilityEstimator< 5 > *ve)