CMS 3D CMS Logo

PVClusterComparer Class Reference

RecoPixelVertexing/PixelVertexFinding/PVClusterComparer.h This helper class is used to sort the collection of vertexes by sumPt. More...

#include <RecoPixelVertexing/PixelVertexFinding/interface/PVClusterComparer.h>

List of all members.

Public Member Functions

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


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.

00005 {}


Member Function Documentation

bool PVClusterComparer::operator() ( const reco::Vertex v1,
const reco::Vertex v2 
) const

Definition at line 33 of file PVClusterComparer.cc.

References pTSquaredSum().

00033                                                                                     {
00034   return ( pTSquaredSum(v1) > pTSquaredSum(v2) );
00035 }

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().

00030                                                                                   {
00031   return ( pTSquaredSum(v1) > pTSquaredSum(v2) );
00032 }

double PVClusterComparer::pTSquaredSum ( const reco::Vertex v  )  const

Definition at line 18 of file PVClusterComparer.cc.

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

00018                                                                 {
00019   double sum=0;
00020   for (reco::Vertex::trackRef_iterator i=v.tracks_begin(); i!=v.tracks_end(); ++i) {
00021     double pt = (*i)->pt();
00022     if (pt > 2.5) { // Don't count tracks below 2.5 GeV
00023       if (pt > 10.0) pt = 10.0;
00024       sum += pt*pt;
00025     }
00026   }
00027   return sum;
00028 }

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, and sum().

Referenced by operator()().

00007                                                                {
00008   double sum=0;
00009   for (unsigned int i=0; i<v.tracks().size(); ++i) {
00010     double pt = v.tracks()[i]->pt();
00011     if (pt > 2.5) { // Don't count tracks below 2.5 GeV
00012       if (pt > 10.0) pt = 10.0;
00013       sum += pt*pt;
00014     }
00015   }
00016   return sum;
00017 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:30 2009 for CMSSW by  doxygen 1.5.4