SortByEt.h
Go to the documentation of this file.00001 #ifndef __CMS_ITERATIVE_CONE__SORT_BY_ET_H__
00002 #define __CMS_ITERATIVE_CONE__SORT_BY_ET_H__
00003
00004 #include <limits>
00005 #include <fastjet/internal/base.hh>
00006
00007 FASTJET_BEGIN_NAMESPACE
00008
00009 namespace cms{
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 template <class T>
00034 struct NumericSafeGreaterByEt {
00035 typedef T first_argument_type;
00036 typedef T second_argument_type;
00037 bool operator()(const T& a1, const T& a2) {
00038
00039
00040
00041 double et1 = a1.Et();
00042 double et2 = a2.Et();
00043
00044
00045 return
00046 fabs (et1-et2) > std::numeric_limits<double>::epsilon() ? et1 > et2 :
00047 fabs (a1.px()-a2.px()) > std::numeric_limits<double>::epsilon() ? a1.px() > a2.px() :
00048 a1.pz() > a2.pz();
00049 }
00050 };
00051
00052 }
00053
00054 FASTJET_END_NAMESPACE
00055
00056
00057 #endif // __CMS_ITERATIVE_CONE__SORT_BY_ET_H__