#include <VertexMerging.h>
Public Member Functions | |
reco::VertexCollection | mergeVertex (reco::VertexCollection &secondaryVertices) |
VertexMerging (const edm::ParameterSet ¶ms) | |
Private Member Functions | |
bool | trackFilter (const reco::TrackRef &track) const |
Private Attributes | |
double | maxFraction |
double | minSignificance |
Definition at line 17 of file VertexMerging.h.
VertexMerging::VertexMerging | ( | const edm::ParameterSet & | params | ) |
Definition at line 4 of file VertexMerging.cc.
: maxFraction(params.getParameter<double>("maxFraction")), minSignificance(params.getParameter<double>("minSignificance")) { }
reco::VertexCollection VertexMerging::mergeVertex | ( | reco::VertexCollection & | secondaryVertices | ) |
Definition at line 37 of file VertexMerging.cc.
References computeSharedTracks(), VertexDistance3D::distance(), maxFraction, minSignificance, and Measurement1D::significance().
{ VertexDistance3D dist; reco::VertexCollection recoVertices; for(std::vector<reco::Vertex>::const_iterator sv = secondaryVertices.begin(); sv != secondaryVertices.end(); ++sv) { recoVertices.push_back(*sv); } for(std::vector<reco::Vertex>::iterator sv = recoVertices.begin(); sv != recoVertices.end(); ++sv) { bool shared=false; for(std::vector<reco::Vertex>::iterator sv2 = recoVertices.begin(); sv2 != recoVertices.end(); ++sv2) { double fr=computeSharedTracks(*sv2, *sv); // std::cout << sv2-recoVertices->begin() << " vs " << sv-recoVertices->begin() << " : " << fr << " " << computeSharedTracks(*sv, *sv2) << " sig " << dist.distance(*sv,*sv2).significance() << std::endl; // std::cout << (fr > maxFraction) << " && " << (dist.distance(*sv,*sv2).significance() < 2) << " && " << (sv-sv2!=0) << " && " << (fr >= computeSharedTracks(*sv2, *sv)) << std::endl; if (fr > maxFraction && dist.distance(*sv,*sv2).significance() < minSignificance && sv-sv2!=0 && fr >= computeSharedTracks(*sv, *sv2) ) { shared=true; // std::cout << "shared " << sv-recoVertices->begin() << " and " << sv2-recoVertices->begin() << " fractions: " << fr << " , " << computeSharedTracks(*sv2, *sv) << " sig: " << dist.distance(*sv,*sv2).significance() << std::endl; } } if(shared) { sv=recoVertices.erase(sv)-1; } // std::cout << "it = " << sv-recoVertices->begin() << " new size is: " << recoVertices->size() << std::endl; } return recoVertices; }
bool VertexMerging::trackFilter | ( | const reco::TrackRef & | track | ) | const [private] |
double VertexMerging::maxFraction [private] |
Definition at line 28 of file VertexMerging.h.
Referenced by mergeVertex().
double VertexMerging::minSignificance [private] |
Definition at line 29 of file VertexMerging.h.
Referenced by mergeVertex().