CMS 3D CMS Logo

Functions
vertexTools Namespace Reference

Functions

double computeSharedTracks (const Vertex &pv, const std::vector< TrackRef > &svTracks, double minTrackWeight, float)
 
double computeSharedTracks (const reco::Vertex &pv, const std::vector< reco::TrackRef > &svTracks, double minTrackWeight=0.5, float unused=0)
 
double computeSharedTracks (const reco::Vertex &pv, const std::vector< reco::CandidatePtr > &svTracks, double minTrackWeight=0.5, float mindist=2.0)
 
double computeSharedTracks (const Vertex &pv, const std::vector< CandidatePtr > &svTracks, double minTrackWeight, float maxsigma)
 
double computeSharedTracks (const reco::Vertex &pv, const reco::VertexCompositePtrCandidate &sv, double minTrackWeight=0.5, float mindist=2.0)
 
double computeSharedTracks (const reco::Vertex &pv, const reco::Vertex &sv, double minTrackWeight=0.5, float mindist=2.0)
 
double computeSharedTracks (const reco::VertexCompositePtrCandidate &sv, const reco::VertexCompositePtrCandidate &sv2, double minTrackWeight=0.5, float mindist=2.0)
 
double computeSharedTracks (const VertexCompositePtrCandidate &sv2, const std::vector< CandidatePtr > &svTracks, double, float)
 
double computeSharedTracks (const reco::VertexCompositePtrCandidate &sv2, const std::vector< reco::CandidatePtr > &svTracks, double unused1=0, float unused2=0)
 

Function Documentation

◆ computeSharedTracks() [1/9]

double vertexTools::computeSharedTracks ( const Vertex pv,
const std::vector< TrackRef > &  svTracks,
double  minTrackWeight,
float   
)

Definition at line 4 of file SharedTracks.cc.

References submitPVResolutionJobs::count, and MetAnalyzer::pv().

Referenced by computeSharedTracks(), reco::VertexFilter::operator()(), and TemplatedVertexMerger< VTX >::produce().

4  {
5  std::set<TrackRef> pvTracks;
6  for (std::vector<TrackBaseRef>::const_iterator iter = pv.tracks_begin(); iter != pv.tracks_end(); iter++)
7  if (pv.trackWeight(*iter) >= minTrackWeight)
8  pvTracks.insert(iter->castTo<TrackRef>());
9 
10  unsigned int count = 0;
11  for (std::vector<TrackRef>::const_iterator iter = svTracks.begin(); iter != svTracks.end(); iter++)
12  count += pvTracks.count(*iter);
13 
14  return (double)count / (double)svTracks.size();
15  }
def pv(vc)
Definition: MetAnalyzer.py:7

◆ computeSharedTracks() [2/9]

double vertexTools::computeSharedTracks ( const reco::Vertex pv,
const std::vector< reco::TrackRef > &  svTracks,
double  minTrackWeight = 0.5,
float  unused = 0 
)

Definition at line 4 of file SharedTracks.cc.

References submitPVResolutionJobs::count, and MetAnalyzer::pv().

Referenced by computeSharedTracks(), reco::VertexFilter::operator()(), and TemplatedVertexMerger< VTX >::produce().

4  {
5  std::set<TrackRef> pvTracks;
6  for (std::vector<TrackBaseRef>::const_iterator iter = pv.tracks_begin(); iter != pv.tracks_end(); iter++)
7  if (pv.trackWeight(*iter) >= minTrackWeight)
8  pvTracks.insert(iter->castTo<TrackRef>());
9 
10  unsigned int count = 0;
11  for (std::vector<TrackRef>::const_iterator iter = svTracks.begin(); iter != svTracks.end(); iter++)
12  count += pvTracks.count(*iter);
13 
14  return (double)count / (double)svTracks.size();
15  }
def pv(vc)
Definition: MetAnalyzer.py:7

◆ computeSharedTracks() [3/9]

double vertexTools::computeSharedTracks ( const reco::Vertex pv,
const std::vector< reco::CandidatePtr > &  svTracks,
double  minTrackWeight = 0.5,
float  mindist = 2.0 
)

Definition at line 16 of file SharedTracks.cc.

References funct::abs(), submitPVResolutionJobs::count, and MetAnalyzer::pv().

19  {
20  unsigned int count = 0;
21  for (std::vector<CandidatePtr>::const_iterator iter = svTracks.begin(); iter != svTracks.end(); iter++) {
22  if (std::abs((*iter)->bestTrack()->dz() - pv.z()) / (*iter)->bestTrack()->dzError() < maxsigma &&
23  std::abs((*iter)->bestTrack()->dxy(pv.position()) / (*iter)->bestTrack()->dxyError()) < maxsigma)
24  count++;
25  }
26  return (double)count / (double)svTracks.size();
27  }
def pv(vc)
Definition: MetAnalyzer.py:7
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ computeSharedTracks() [4/9]

double vertexTools::computeSharedTracks ( const Vertex pv,
const std::vector< CandidatePtr > &  svTracks,
double  minTrackWeight,
float  maxsigma 
)

Definition at line 16 of file SharedTracks.cc.

References funct::abs(), submitPVResolutionJobs::count, and MetAnalyzer::pv().

19  {
20  unsigned int count = 0;
21  for (std::vector<CandidatePtr>::const_iterator iter = svTracks.begin(); iter != svTracks.end(); iter++) {
22  if (std::abs((*iter)->bestTrack()->dz() - pv.z()) / (*iter)->bestTrack()->dzError() < maxsigma &&
23  std::abs((*iter)->bestTrack()->dxy(pv.position()) / (*iter)->bestTrack()->dxyError()) < maxsigma)
24  count++;
25  }
26  return (double)count / (double)svTracks.size();
27  }
def pv(vc)
Definition: MetAnalyzer.py:7
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ computeSharedTracks() [5/9]

double vertexTools::computeSharedTracks ( const reco::Vertex pv,
const reco::VertexCompositePtrCandidate sv,
double  minTrackWeight = 0.5,
float  mindist = 2.0 
)

Definition at line 41 of file SharedTracks.cc.

References computeSharedTracks(), MetAnalyzer::pv(), and pfDeepBoostedJetPreprocessParams_cfi::sv.

44  {
45  return computeSharedTracks(pv, sv.daughterPtrVector(), minTrackWeight, mindist);
46  }
double computeSharedTracks(const VertexCompositePtrCandidate &sv2, const std::vector< CandidatePtr > &svTracks, double, float)
Definition: SharedTracks.cc:28
def pv(vc)
Definition: MetAnalyzer.py:7

◆ computeSharedTracks() [6/9]

double vertexTools::computeSharedTracks ( const reco::Vertex pv,
const reco::Vertex sv,
double  minTrackWeight = 0.5,
float  mindist = 2.0 
)

Definition at line 47 of file SharedTracks.cc.

References computeSharedTracks(), MetAnalyzer::pv(), and pfDeepBoostedJetPreprocessParams_cfi::sv.

47  {
48  std::vector<TrackRef> svTracks;
49  for (std::vector<TrackBaseRef>::const_iterator iter = sv.tracks_begin(); iter != sv.tracks_end(); iter++)
50  if (sv.trackWeight(*iter) >= minTrackWeight)
51  svTracks.push_back(iter->castTo<TrackRef>());
52  return computeSharedTracks(pv, svTracks, minTrackWeight);
53  }
double computeSharedTracks(const VertexCompositePtrCandidate &sv2, const std::vector< CandidatePtr > &svTracks, double, float)
Definition: SharedTracks.cc:28
def pv(vc)
Definition: MetAnalyzer.py:7

◆ computeSharedTracks() [7/9]

double vertexTools::computeSharedTracks ( const reco::VertexCompositePtrCandidate sv,
const reco::VertexCompositePtrCandidate sv2,
double  minTrackWeight = 0.5,
float  mindist = 2.0 
)

Definition at line 54 of file SharedTracks.cc.

References computeSharedTracks(), reco::CompositePtrCandidate::daughterPtrVector(), and pfDeepBoostedJetPreprocessParams_cfi::sv.

57  {
59  }
virtual const daughters & daughterPtrVector() const
references to daughtes
double computeSharedTracks(const VertexCompositePtrCandidate &sv2, const std::vector< CandidatePtr > &svTracks, double, float)
Definition: SharedTracks.cc:28

◆ computeSharedTracks() [8/9]

double vertexTools::computeSharedTracks ( const VertexCompositePtrCandidate sv2,
const std::vector< CandidatePtr > &  svTracks,
double  ,
float   
)

Definition at line 28 of file SharedTracks.cc.

References submitPVResolutionJobs::count, reco::CompositePtrCandidate::daughterPtrVector(), and spr::find().

31  {
32  unsigned int count = 0;
33  for (std::vector<CandidatePtr>::const_iterator iter = svTracks.begin(); iter != svTracks.end(); iter++) {
34  if (std::find(sv2.daughterPtrVector().begin(), sv2.daughterPtrVector().end(), *iter) !=
35  sv2.daughterPtrVector().end())
36  count++;
37  }
38  return (double)count / (double)svTracks.size();
39  }
virtual const daughters & daughterPtrVector() const
references to daughtes
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19

◆ computeSharedTracks() [9/9]

double vertexTools::computeSharedTracks ( const reco::VertexCompositePtrCandidate sv2,
const std::vector< reco::CandidatePtr > &  svTracks,
double  unused1 = 0,
float  unused2 = 0 
)

Definition at line 28 of file SharedTracks.cc.

References submitPVResolutionJobs::count, reco::CompositePtrCandidate::daughterPtrVector(), and spr::find().

31  {
32  unsigned int count = 0;
33  for (std::vector<CandidatePtr>::const_iterator iter = svTracks.begin(); iter != svTracks.end(); iter++) {
34  if (std::find(sv2.daughterPtrVector().begin(), sv2.daughterPtrVector().end(), *iter) !=
35  sv2.daughterPtrVector().end())
36  count++;
37  }
38  return (double)count / (double)svTracks.size();
39  }
virtual const daughters & daughterPtrVector() const
references to daughtes
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19