CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 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 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 VertexCompositePtrCandidate &sv2, const std::vector< CandidatePtr > &svTracks, double, float)
 

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 prof2calltree::count, getDQMSummary::iter, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), and reco::Vertex::trackWeight().

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

6  {
7  std::set<TrackRef> pvTracks;
8  for(std::vector<TrackBaseRef>::const_iterator iter = pv.tracks_begin();
9  iter != pv.tracks_end(); iter++)
10  if (pv.trackWeight(*iter) >= minTrackWeight)
11  pvTracks.insert(iter->castTo<TrackRef>());
12 
13  unsigned int count = 0;
14  for(std::vector<TrackRef>::const_iterator iter = svTracks.begin();
15  iter != svTracks.end(); iter++)
16  count += pvTracks.count(*iter);
17 
18  return (double)count/(double)svTracks.size();
19  }
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:44
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:39
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 prof2calltree::count, getDQMSummary::iter, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), and reco::Vertex::trackWeight().

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

6  {
7  std::set<TrackRef> pvTracks;
8  for(std::vector<TrackBaseRef>::const_iterator iter = pv.tracks_begin();
9  iter != pv.tracks_end(); iter++)
10  if (pv.trackWeight(*iter) >= minTrackWeight)
11  pvTracks.insert(iter->castTo<TrackRef>());
12 
13  unsigned int count = 0;
14  for(std::vector<TrackRef>::const_iterator iter = svTracks.begin();
15  iter != svTracks.end(); iter++)
16  count += pvTracks.count(*iter);
17 
18  return (double)count/(double)svTracks.size();
19  }
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:44
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:39
double vertexTools::computeSharedTracks ( const reco::Vertex pv,
const std::vector< reco::CandidatePtr > &  svTracks,
double  minTrackWeight = 0.5,
float  mindist = 2.0 
)

Definition at line 20 of file SharedTracks.cc.

References funct::abs(), prof2calltree::count, getDQMSummary::iter, reco::Vertex::position(), and reco::Vertex::z().

22  {
23  unsigned int count = 0;
24  for(std::vector<CandidatePtr>::const_iterator iter = svTracks.begin();
25  iter != svTracks.end(); iter++)
26  {
27  if( std::abs((*iter)->bestTrack()->dz()-pv.z())/(*iter)->bestTrack()->dzError() < maxsigma &&
28  std::abs((*iter)->bestTrack()->dxy(pv.position())/(*iter)->bestTrack()->dxyError()) < maxsigma
29  )
30  count++;
31  }
32  return (double)count/(double)svTracks.size();
33  }
const Point & position() const
position
Definition: Vertex.h:106
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double z() const
y coordinate
Definition: Vertex.h:112
double vertexTools::computeSharedTracks ( const reco::Vertex pv,
const reco::VertexCompositePtrCandidate sv,
double  minTrackWeight = 0.5,
float  mindist = 2.0 
)

Definition at line 47 of file SharedTracks.cc.

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

48  {
49  return computeSharedTracks(pv,sv.daughterPtrVector(),minTrackWeight,mindist);
50  }
static double computeSharedTracks(const reco::Vertex &pv, const reco::Vertex &sv)
const daughters & daughterPtrVector() const
references to daughtes
double vertexTools::computeSharedTracks ( const reco::Vertex pv,
const reco::Vertex sv,
double  minTrackWeight = 0.5,
float  mindist = 2.0 
)

Definition at line 51 of file SharedTracks.cc.

References computeSharedTracks(), getDQMSummary::iter, reco::Vertex::tracks_begin(), reco::Vertex::tracks_end(), and reco::Vertex::trackWeight().

52  {
53  std::vector<TrackRef> svTracks;
54  for(std::vector<TrackBaseRef>::const_iterator iter = sv.tracks_begin();
55  iter != sv.tracks_end(); iter++)
56  if (sv.trackWeight(*iter) >= minTrackWeight)
57  svTracks.push_back(iter->castTo<TrackRef>());
58  return computeSharedTracks(pv,svTracks,minTrackWeight);
59 
60  }
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:44
static double computeSharedTracks(const reco::Vertex &pv, const reco::Vertex &sv)
float trackWeight(const TrackBaseRef &r) const
returns the weight with which a Track has contributed to the vertex-fit.
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:39
double vertexTools::computeSharedTracks ( const reco::VertexCompositePtrCandidate sv,
const reco::VertexCompositePtrCandidate sv2,
double  minTrackWeight = 0.5,
float  mindist = 2.0 
)

Definition at line 61 of file SharedTracks.cc.

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

62  {
63  return computeSharedTracks(sv,sv2.daughterPtrVector());
64  }
static double computeSharedTracks(const reco::Vertex &pv, const reco::Vertex &sv)
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 34 of file SharedTracks.cc.

References prof2calltree::count, reco::CompositePtrCandidate::daughterPtrVector(), spr::find(), and getDQMSummary::iter.

35  {
36  unsigned int count = 0;
37  for(std::vector<CandidatePtr>::const_iterator iter = svTracks.begin();
38  iter != svTracks.end(); iter++)
39  {
40  if(std::find(sv2.daughterPtrVector().begin(),sv2.daughterPtrVector().end(),*iter)!= sv2.daughterPtrVector().end())
41  count++;
42  }
43  return (double)count/(double)svTracks.size();
44  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const daughters & daughterPtrVector() const
references to daughtes
double vertexTools::computeSharedTracks ( const Vertex pv,
const std::vector< CandidatePtr > &  svTracks,
double  minTrackWeight,
float  maxsigma 
)

Definition at line 20 of file SharedTracks.cc.

References funct::abs(), prof2calltree::count, getDQMSummary::iter, reco::Vertex::position(), and reco::Vertex::z().

22  {
23  unsigned int count = 0;
24  for(std::vector<CandidatePtr>::const_iterator iter = svTracks.begin();
25  iter != svTracks.end(); iter++)
26  {
27  if( std::abs((*iter)->bestTrack()->dz()-pv.z())/(*iter)->bestTrack()->dzError() < maxsigma &&
28  std::abs((*iter)->bestTrack()->dxy(pv.position())/(*iter)->bestTrack()->dxyError()) < maxsigma
29  )
30  count++;
31  }
32  return (double)count/(double)svTracks.size();
33  }
const Point & position() const
position
Definition: Vertex.h:106
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double z() const
y coordinate
Definition: Vertex.h:112
double vertexTools::computeSharedTracks ( const VertexCompositePtrCandidate sv2,
const std::vector< CandidatePtr > &  svTracks,
double  ,
float   
)

Definition at line 34 of file SharedTracks.cc.

References prof2calltree::count, reco::CompositePtrCandidate::daughterPtrVector(), spr::find(), and getDQMSummary::iter.

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