CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CommonTools/Utils/src/normalizedPhi.cc

Go to the documentation of this file.
00001 #include "CommonTools/Utils/interface/normalizedPhi.h"
00002 #include <cmath>
00003 
00004 namespace reco {
00005   double normalizedPhi(double phi) {
00006     static double const TWO_PI = M_PI * 2;
00007     while ( phi < -M_PI ) phi += TWO_PI;
00008     while ( phi >  M_PI ) phi -= TWO_PI;
00009     return phi;
00010   }
00011 }