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

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

Definition at line 4 of file SharedTracks.cc.

References KineDebug3::count(), reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), and reco::Vertex::trackWeight().

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  }
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:73
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
Definition: Vertex.h:84
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:71
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 KineDebug3::count(), reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), and reco::Vertex::trackWeight().

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  }
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:73
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
Definition: Vertex.h:84
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:71
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(), KineDebug3::count(), reco::Vertex::position(), and reco::Vertex::z().

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  }
const Point & position() const
position
Definition: Vertex.h:113
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double z() const
z coordinate
Definition: Vertex.h:119
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(), KineDebug3::count(), reco::Vertex::position(), and reco::Vertex::z().

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  }
const Point & position() const
position
Definition: Vertex.h:113
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double z() const
z coordinate
Definition: Vertex.h:119
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(), and reco::CompositePtrCandidate::daughterPtrVector().

44  {
45  return computeSharedTracks(pv, sv.daughterPtrVector(), minTrackWeight, mindist);
46  }
virtual const daughters & daughterPtrVector() const
references to daughtes
double computeSharedTracks(const VertexCompositePtrCandidate &sv2, const std::vector< CandidatePtr > &svTracks, double, float)
Definition: SharedTracks.cc:28
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(), reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), and reco::Vertex::trackWeight().

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  }
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:73
double computeSharedTracks(const VertexCompositePtrCandidate &sv2, const std::vector< CandidatePtr > &svTracks, double, float)
Definition: SharedTracks.cc:28
float trackWeight(const TREF &r) const
returns the weight with which a Track has contributed to the vertex-fit.
Definition: Vertex.h:84
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:71
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(), and reco::CompositePtrCandidate::daughterPtrVector().

57  {
58  return computeSharedTracks(sv, sv2.daughterPtrVector());
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
double vertexTools::computeSharedTracks ( const VertexCompositePtrCandidate sv2,
const std::vector< CandidatePtr > &  svTracks,
double  ,
float   
)

Definition at line 28 of file SharedTracks.cc.

References KineDebug3::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  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
virtual const daughters & daughterPtrVector() const
references to daughtes
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 KineDebug3::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  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
virtual const daughters & daughterPtrVector() const
references to daughtes