CMS 3D CMS Logo

reco::NbSharedTracks Class Reference

#include <RecoVertex/VertexTools/interface/NbSharedTracks.h>

List of all members.

Public Member Functions

 NbSharedTracks ()
int sharedTracks (const reco::Vertex &v1, const reco::Vertex &v2) const
 ~NbSharedTracks ()


Detailed Description

Definition at line 17 of file NbSharedTracks.h.


Constructor & Destructor Documentation

reco::NbSharedTracks::NbSharedTracks (  )  [inline]

Definition at line 20 of file NbSharedTracks.h.

00020 {};

reco::NbSharedTracks::~NbSharedTracks (  )  [inline]

Definition at line 21 of file NbSharedTracks.h.

00021 {};


Member Function Documentation

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:51:17 2009 for CMSSW by  doxygen 1.5.4