1 #ifndef DataFormats_Math_Angle_Units_h 2 #define DataFormats_Math_Angle_Units_h 14 constexpr
double operator"" _pi(
long double x) {
return double(
x) *
M_PI; }
15 constexpr
double operator"" _pi(
unsigned long long int x) {
return double(
x) *
M_PI; }
16 constexpr
double operator"" _deg(
long double deg) {
return deg /
degPerRad; }
17 constexpr
double operator"" _deg(
unsigned long long int deg) {
return deg /
degPerRad; }
18 constexpr
double operator"" _rad(
long double rad) {
return rad * 1.; }
20 template <
class NumType>
26 template <
class NumType>
32 template <
class NumType>
33 typename std::enable_if<!std::numeric_limits<NumType>::is_integer,
bool>
::type almostEqual(NumType x,
43 template <
class NumType>
46 return (millimeters / 10.);
49 template <
class NumType>
52 return (centimeters * 10.);
55 template <
class NumType>
58 return (centimeters * 100.);
61 template <
class NumType>
67 template <
class NumType>
73 template <
class NumType>
79 template <
class NumType>
double degrees(double radiants)
def degrees
constexpr NumType convertCm2ToMm2(NumType centimeters)
constexpr double degPerRad
constexpr double convertDegToRad(NumType degrees)
constexpr NumType convertCmToMm(NumType centimeters)
constexpr NumType convertRadToDeg(NumType radians)
std::enable_if<!std::numeric_limits< NumType >::is_integer, bool >::type almostEqual(NumType x, NumType y, int ulp)
constexpr NumType convertMeVToGeV(NumType mev)
constexpr NumType convertGeVToMeV(NumType gev)
constexpr NumType convertMm3ToM3(NumType mm3)
constexpr NumType convertGeVToKeV(NumType gev)
constexpr NumType convertMmToCm(NumType millimeters)
constexpr double piRadians(M_PI)