18 #ifndef _JETCOMMONUTILS_HH_
19 #define _JETCOMMONUTILS_HH_
25 #include <fastjet/internal/base.hh>
27 FASTJET_BEGIN_NAMESPACE
34 inline float to_minusPI_PI(
float phi){
35 while(phi < -M_PI) phi += 2*M_PI;
36 while(phi >= M_PI) phi -= 2*M_PI;
39 inline float to_zero_2PI(
float phi){
40 while(phi < 0) phi += 2*M_PI;
41 while(phi >= 2*M_PI) phi -= 2*M_PI;
53 void clear_list(T & list){
54 typedef typename T::iterator it_t;
55 it_t it = list.begin();
56 it_t itE = list.end();
57 for(; it != itE; ++it){
72 stopwatch() : m_total(0){};
73 void start(){m_last = std::clock();};
74 void resume(){m_last = std::clock();};
76 std::clock_t now=std::clock();
77 m_total = m_total + now - m_last;
81 float stop(){
float t=pause(); m_total = std::clock_t(0);
return t;}
86 float convert(){
return float(m_total)*1000/CLOCKS_PER_SEC;}