CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
PVClusterComparer Class Reference

#include <PVClusterComparer.h>

Public Member Functions

bool operator() (const PVCluster &v1, const PVCluster &v2) const
 Use this operator in a std::sort to sort them in decreasing sumPt. More...
 
bool operator() (const reco::Vertex &v1, const reco::Vertex &v2) const
 
double pTSquaredSum (const PVCluster &v) const
 Calculate sum of square of the pT's of the tracks in the vertex. More...
 
double pTSquaredSum (const reco::Vertex &v) const
 
 PVClusterComparer ()
 Constructor does nothing, no data members. More...
 

Detailed Description

RecoPixelVertexing/PixelVertexFinding/PVClusterComparer.h This helper class is used to sort the collection of vertexes by sumPt. It is used in DivisiveVertexFinder. The sum of the squares of the pT is only done for tracks with pT>2.5 GeV. If the pT>10 GeV, then the max value of 10 is used. (The pT of pixel tracks is not very precise.)

Date:
2006/06/06 22:28:25
Revision:
1.1
Author
Aaron Dominguez (UNL)

Definition at line 18 of file PVClusterComparer.h.

Constructor & Destructor Documentation

PVClusterComparer::PVClusterComparer ( )

Constructor does nothing, no data members.

Definition at line 5 of file PVClusterComparer.cc.

5 {}

Member Function Documentation

bool PVClusterComparer::operator() ( const PVCluster v1,
const PVCluster v2 
) const

Use this operator in a std::sort to sort them in decreasing sumPt.

Definition at line 30 of file PVClusterComparer.cc.

References pTSquaredSum().

30  {
31  return ( pTSquaredSum(v1) > pTSquaredSum(v2) );
32 }
double pTSquaredSum(const PVCluster &v) const
Calculate sum of square of the pT&#39;s of the tracks in the vertex.
bool PVClusterComparer::operator() ( const reco::Vertex v1,
const reco::Vertex v2 
) const

Definition at line 33 of file PVClusterComparer.cc.

References pTSquaredSum().

33  {
34  return ( pTSquaredSum(v1) > pTSquaredSum(v2) );
35 }
double pTSquaredSum(const PVCluster &v) const
Calculate sum of square of the pT&#39;s of the tracks in the vertex.
double PVClusterComparer::pTSquaredSum ( const PVCluster v) const

Calculate sum of square of the pT's of the tracks in the vertex.

Definition at line 7 of file PVClusterComparer.cc.

References i.

Referenced by operator()().

7  {
8  double sum=0;
9  for (unsigned int i=0; i<v.tracks().size(); ++i) {
10  double pt = v.tracks()[i]->pt();
11  if (pt > 2.5) { // Don't count tracks below 2.5 GeV
12  if (pt > 10.0) pt = 10.0;
13  sum += pt*pt;
14  }
15  }
16  return sum;
17 }
int i
Definition: DBlmapReader.cc:9
double PVClusterComparer::pTSquaredSum ( const reco::Vertex v) const

Definition at line 18 of file PVClusterComparer.cc.

References i, reco::Vertex::tracks_begin(), and reco::Vertex::tracks_end().

18  {
19  double sum=0;
21  double pt = (*i)->pt();
22  if (pt > 2.5) { // Don't count tracks below 2.5 GeV
23  if (pt > 10.0) pt = 10.0;
24  sum += pt*pt;
25  }
26  }
27  return sum;
28 }
int i
Definition: DBlmapReader.cc:9
trackRef_iterator tracks_end() const
last iterator over tracks
Definition: Vertex.cc:45
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector&lt;TrackRef&gt;
Definition: Vertex.h:38
trackRef_iterator tracks_begin() const
first iterator over tracks
Definition: Vertex.cc:40