#include <RecoVertex/VertexTools/interface/NbSharedTracks.h>
Public Member Functions | |
NbSharedTracks () | |
int | sharedTracks (const reco::Vertex &v1, const reco::Vertex &v2) const |
~NbSharedTracks () |
Definition at line 17 of file NbSharedTracks.h.
reco::NbSharedTracks::NbSharedTracks | ( | ) | [inline] |
reco::NbSharedTracks::~NbSharedTracks | ( | ) | [inline] |
int reco::NbSharedTracks::sharedTracks | ( | const reco::Vertex & | v1, | |
const reco::Vertex & | v2 | |||
) | const |
Definition at line 9 of file NbSharedTracks.cc.
References reco::Vertex::tracks_begin(), and reco::Vertex::tracks_end().
00010 { 00011 00012 int nSharedTracks = 0; 00013 00014 // for first vertex 00015 Vertex::trackRef_iterator v1TrackIter; 00016 Vertex::trackRef_iterator v1TrackBegin = v1.tracks_begin(); 00017 Vertex::trackRef_iterator v1TrackEnd = v1.tracks_end(); 00018 00019 00020 // for second vertex 00021 Vertex::trackRef_iterator v2TrackIter; 00022 Vertex::trackRef_iterator v2TrackBegin = v2.tracks_begin(); 00023 Vertex::trackRef_iterator v2TrackEnd = v2.tracks_end(); 00024 00025 for (v1TrackIter = v1TrackBegin; v1TrackIter != v1TrackEnd; v1TrackIter++) { 00026 for (v2TrackIter = v2TrackBegin; v2TrackIter != v2TrackEnd; v2TrackIter++) { 00027 if ( (*v1TrackIter) == (*v2TrackIter) ) { 00028 nSharedTracks++; 00029 } // if 00030 } // for v2TrackIter 00031 } //for v1TrackIter 00032 00033 00034 return nSharedTracks; 00035 } // int sharedTracks