CMS 3D CMS Logo

Functions
vertexTools Namespace Reference

Functions

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

Function Documentation

◆ computeSharedTracks() [1/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.

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  }

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

◆ computeSharedTracks() [2/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.

44  {
45  return computeSharedTracks(pv, sv.daughterPtrVector(), minTrackWeight, mindist);
46  }

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

◆ 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.

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  }

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

◆ computeSharedTracks() [4/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.

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  }

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

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

◆ computeSharedTracks() [5/9]

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

◆ computeSharedTracks() [6/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.

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  }

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

◆ computeSharedTracks() [7/9]

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

Definition at line 16 of file SharedTracks.cc.

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  }

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

◆ computeSharedTracks() [8/9]

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

Definition at line 4 of file SharedTracks.cc.

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  }

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

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

◆ computeSharedTracks() [9/9]

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

Definition at line 28 of file SharedTracks.cc.

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  }

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

reco::CompositePtrCandidate::daughterPtrVector
virtual const daughters & daughterPtrVector() const
references to daughtes
Definition: CompositePtrCandidate.h:63
vertexTools::computeSharedTracks
double computeSharedTracks(const VertexCompositePtrCandidate &sv2, const std::vector< CandidatePtr > &svTracks, double, float)
Definition: SharedTracks.cc:28
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::Ref< TrackCollection >
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:226
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22