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 }
reco::Vertex::trackRef_iterator
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
Definition: Vertex.h:38
VertexHigherPtSquared::sumPtSquared
double sumPtSquared(const reco::Vertex &v) const
Definition: VertexHigherPtSquared.cc:16
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
findQualityFiles.v
v
Definition: findQualityFiles.py:179
PVValHelper::pT
Definition: PVValidationHelpers.h:71
TransientVertex
Definition: TransientVertex.h:18
TransientVertex::originalTracks
std::vector< reco::TransientTrack > const & originalTracks() const
Definition: TransientVertex.h:200
VertexHigherPtSquared.h
VertexHigherPtSquared::operator()
bool operator()(const TransientVertex &v1, const TransientVertex &v2) const
Definition: VertexHigherPtSquared.cc:5
reco::Vertex
Definition: Vertex.h:35