test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
VertexHigherPtSquared.cc
Go to the documentation of this file.
2 
3 using namespace reco;
4 
5 bool
7  const TransientVertex & v2) const
8 {
9  // return (sumPtSquared(v1) > sumPtSquared(v2)); V-01-05-02
10  const std::vector<reco::TransientTrack> & tks1 = v1.originalTracks();
11  const std::vector<reco::TransientTrack> & tks2 = v2.originalTracks();
12  return (sumPtSquared(tks1) > sumPtSquared(tks2));
13 }
14 
15 
16 bool
18  const Vertex & v2) const
19 {
20  return (sumPtSquared(v1) > sumPtSquared(v2));
21 }
22 
23 
24 
25 
27 {
28  double sum = 0.;
29  double pT;
30  for (Vertex::trackRef_iterator it = v.tracks_begin(); it != v.tracks_end(); it++) {
31  pT = (**it).pt();
32  double epT=(**it).ptError();
33  pT=pT>epT ? pT-epT : 0;
34 
35  sum += pT*pT;
36  }
37  return sum;
38 }
39 
40 
41 double VertexHigherPtSquared::sumPtSquared(const std::vector<reco::TransientTrack> & tks) const
42 {
43  double sum = 0.;
44  for (std::vector<reco::TransientTrack>::const_iterator it = tks.begin();
45  it != tks.end(); it++) {
46  double pT = (it->track()).pt();
47  double epT=(it->track()).ptError();
48  pT=pT>epT ? pT-epT : 0;
49 
50  sum += pT*pT;
51  }
52  return sum;
53 }
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:44
std::vector< reco::TransientTrack > const & originalTracks() const
double sumPtSquared(const reco::Vertex &v) const
bool operator()(const TransientVertex &v1, const TransientVertex &v2) const
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:37
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:39