CMS 3D CMS Logo

VertexHigherPtSquared.cc
Go to the documentation of this file.
2 
3 using namespace reco;
4 
6  // return (sumPtSquared(v1) > sumPtSquared(v2)); V-01-05-02
7  const std::vector<reco::TransientTrack>& tks1 = v1.originalTracks();
8  const std::vector<reco::TransientTrack>& tks2 = v2.originalTracks();
9  return (sumPtSquared(tks1) > sumPtSquared(tks2));
10 }
11 
12 bool VertexHigherPtSquared::operator()(const Vertex& v1, const Vertex& v2) const {
13  return (sumPtSquared(v1) > sumPtSquared(v2));
14 }
15 
17  double sum = 0.;
18  double pT;
19  for (Vertex::trackRef_iterator it = v.tracks_begin(); it != v.tracks_end(); it++) {
20  pT = (**it).pt();
21  double epT = (**it).ptError();
22  pT = pT > epT ? pT - epT : 0;
23 
24  sum += pT * pT;
25  }
26  return sum;
27 }
28 
29 double VertexHigherPtSquared::sumPtSquared(const std::vector<reco::TransientTrack>& tks) const {
30  double sum = 0.;
31  for (std::vector<reco::TransientTrack>::const_iterator it = tks.begin(); it != tks.end(); it++) {
32  double pT = (it->track()).pt();
33  double epT = (it->track()).ptError();
34  pT = pT > epT ? pT - epT : 0;
35 
36  sum += pT * pT;
37  }
38  return sum;
39 }
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:73
std::vector< reco::TransientTrack > const & originalTracks() const
double sumPtSquared(const reco::Vertex &v) const
bool operator()(const TransientVertex &v1, const TransientVertex &v2) const
fixed size matrix
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:71
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:37