CMS 3D CMS Logo

Functions
VertexMerging.cc File Reference
#include "RecoVertex/AdaptiveVertexFinder/interface/VertexMerging.h"

Go to the source code of this file.

Functions

static double computeSharedTracks (const reco::Vertex &pv, const reco::Vertex &sv)
 

Function Documentation

◆ computeSharedTracks()

static double computeSharedTracks ( const reco::Vertex pv,
const reco::Vertex sv 
)
static

Definition at line 7 of file VertexMerging.cc.

References submitPVResolutionJobs::count, MetAnalyzer::pv(), pfDeepBoostedJetPreprocessParams_cfi::sv, and dqmMemoryStats::total.

Referenced by VertexMerging::mergeVertex().

7  {
8  std::set<reco::TrackRef> pvTracks;
9  for (std::vector<reco::TrackBaseRef>::const_iterator iter = pv.tracks_begin(); iter != pv.tracks_end(); iter++) {
10  if (pv.trackWeight(*iter) >= 0.5)
11  pvTracks.insert(iter->castTo<reco::TrackRef>());
12  }
13 
14  unsigned int count = 0, total = 0;
15  for (std::vector<reco::TrackBaseRef>::const_iterator iter = sv.tracks_begin(); iter != sv.tracks_end(); iter++) {
16  if (sv.trackWeight(*iter) >= 0.5) {
17  total++;
18  count += pvTracks.count(iter->castTo<reco::TrackRef>());
19  }
20  }
21 
22  return (double)count / (double)total;
23 }
def pv(vc)
Definition: MetAnalyzer.py:7