1 #ifndef DataFormats_Math_GeantUnits_h 2 #define DataFormats_Math_GeantUnits_h 31 constexpr double operator"" _mm(
long double length) {
return length * 1.; }
32 constexpr double operator"" _cm(
long double length) {
return length * 10.; }
33 constexpr double operator"" _m(
long double length) {
return length * 1000.; }
34 constexpr double operator"" _cm3(
long double length) {
return length * 1._cm * 1._cm * 1._cm; }
35 constexpr double operator"" _m3(
long double length) {
return length * 1._m * 1._m * 1._m; }
36 constexpr double operator"" _mm(
unsigned long long int length) {
return length * 1; }
37 constexpr double operator"" _cm(
unsigned long long int length) {
return length * 10; }
51 return mass * (1._eV / 1.602176487e-19) * 1._s * 1._s / (1.
_m * 1.
_m);
72 template <
class NumType>
74 return (
val / desiredUnits);
constexpr NumType convertCm2ToMm2(NumType centimeters)
constexpr double convertDegToRad(NumType degrees)
constexpr NumType convertCmToMm(NumType centimeters)
constexpr double joule(6.24150e+12)
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 convertUnitsTo(double desiredUnits, NumType val)
constexpr NumType convertGeVToMeV(NumType gev)
constexpr double seconds(1.e+9)
constexpr NumType convertMm3ToM3(NumType mm3)
constexpr NumType convertGeVToKeV(NumType gev)
constexpr NumType convertMmToCm(NumType millimeters)
constexpr double piRadians(M_PI)
constexpr double nanoseconds(1.)