#include <VertexHigherPtSquared.h>
Public Member Functions | |
bool | operator() (const TransientVertex &v1, const TransientVertex &v2) const |
bool | operator() (const reco::Vertex &v1, const reco::Vertex &v2) const |
double | sumPtSquared (const reco::Vertex &v) const |
operator for sorting TransientVertex objects in decreasing order of the sum of the squared track pT's
Definition at line 13 of file VertexHigherPtSquared.h.
bool VertexHigherPtSquared::operator() | ( | const TransientVertex & | v1, |
const TransientVertex & | v2 | ||
) | const |
Definition at line 6 of file VertexHigherPtSquared.cc.
{ return (sumPtSquared(v1) > sumPtSquared(v2)); }
bool VertexHigherPtSquared::operator() | ( | const reco::Vertex & | v1, |
const reco::Vertex & | v2 | ||
) | const |
Definition at line 14 of file VertexHigherPtSquared.cc.
{ return (sumPtSquared(v1) > sumPtSquared(v2)); }
double VertexHigherPtSquared::sumPtSquared | ( | const reco::Vertex & | v | ) | const |
Definition at line 23 of file VertexHigherPtSquared.cc.
References reco::Vertex::tracks_begin(), and reco::Vertex::tracks_end().
{ double sum = 0.; double pT; for (Vertex::trackRef_iterator it = v.tracks_begin(); it != v.tracks_end(); it++) { pT = (**it).pt(); double epT=(**it).ptError(); pT=pT>epT ? pT-epT : 0; sum += pT*pT; } return sum; }