CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/RecoEcal/EgammaCoreTools/interface/ClusterEtLess.h

Go to the documentation of this file.
00001 #ifndef RecoECAL_ECALClusters_ClusterEtLess_h
00002 #define RecoECAL_ECALClusters_ClusterEtLess_h
00003 
00004 
00005 #include "DataFormats/CaloRecHit/interface/CaloCluster.h"
00006 
00007 // Less than operator for sorting EcalRecHits according to energy.
00008 class ClusterEtLess : public std::binary_function<reco::CaloCluster, reco::CaloCluster, bool>
00009 {
00010  public:
00011   bool operator()(reco::CaloCluster x, reco::CaloCluster y)
00012     {
00013       return ( (x.energy() * sin(x.position().theta())) < (y.energy() * sin(y.position().theta())) ) ;
00014     }
00015 };
00016 
00017 #endif
00018