CMS 3D CMS Logo

Functions
geant_units::operators Namespace Reference

Functions

template<class NumType >
constexpr NumType convertCm2ToMm2 (NumType centimeters)
 
template<class NumType >
constexpr NumType convertCmToMm (NumType centimeters)
 
template<class NumType >
constexpr NumType convertMm3ToM3 (NumType mm3)
 
template<class NumType >
constexpr NumType convertMmToCm (NumType millimeters)
 
template<class NumType >
constexpr NumType convertUnitsTo (long double desiredUnits, NumType val)
 
constexpr long double operator""_cm (long double length)
 
constexpr long double operator""_cm (unsigned long long int length)
 
constexpr long double operator""_cm3 (long double length)
 
constexpr long double operator""_eV (long double energy)
 
constexpr long double operator""_g (long double mass)
 
constexpr long double operator""_g_per_cm3 (long double density)
 
constexpr long double operator""_g_per_mole (long double mass)
 
constexpr long double operator""_GeV (long double energy)
 
constexpr long double operator""_kg (long double mass)
 
constexpr long double operator""_m (long double length)
 
constexpr long double operator""_m3 (long double length)
 
constexpr long double operator""_MeV (long double energy)
 
constexpr long double operator""_mg (long double mass)
 
constexpr long double operator""_mg_per_cm3 (long double density)
 
constexpr long double operator""_mm (long double length)
 
constexpr long double operator""_mm (unsigned long long int length)
 
constexpr long double operator""_mole (long double mass)
 
constexpr long double operator""_ns (long double x)
 
constexpr long double operator""_s (long double x)
 
constexpr long double operator""_TeV (long double energy)
 

Function Documentation

template<class NumType >
constexpr NumType geant_units::operators::convertCm2ToMm2 ( NumType  centimeters)
inline

Definition at line 74 of file GeantUnits.h.

Referenced by algorithm().

75  {
76  return (centimeters * 100.);
77  }
template<class NumType >
constexpr NumType geant_units::operators::convertCmToMm ( NumType  centimeters)
inline
template<class NumType >
constexpr NumType geant_units::operators::convertMm3ToM3 ( NumType  mm3)
inline

Definition at line 80 of file GeantUnits.h.

81  {
82  return (mm3 / 1.e9);
83  }
template<class NumType >
constexpr NumType geant_units::operators::convertMmToCm ( NumType  millimeters)
inline
template<class NumType >
constexpr NumType geant_units::operators::convertUnitsTo ( long double  desiredUnits,
NumType  val 
)
inline
constexpr long double geant_units::operators::operator""_cm ( long double  length)

Definition at line 31 of file GeantUnits.h.

31 { return length * 10.; }
constexpr long double geant_units::operators::operator""_cm ( unsigned long long int  length)

Definition at line 36 of file GeantUnits.h.

36 { return length * 10; }
constexpr long double geant_units::operators::operator""_cm3 ( long double  length)

Definition at line 33 of file GeantUnits.h.

33 { return length * 1._cm * 1._cm * 1._cm; }
constexpr long double geant_units::operators::operator""_eV ( long double  energy)

Definition at line 44 of file GeantUnits.h.

44 { return energy * 1.e-6_MeV; }
constexpr long double geant_units::operators::operator""_g ( long double  mass)

Definition at line 52 of file GeantUnits.h.

52 { return mass * 1.e-3_kg; }
constexpr long double geant_units::operators::operator""_g_per_cm3 ( long double  density)

Definition at line 58 of file GeantUnits.h.

58 { return density * 1._g / 1._cm3; }
constexpr long double geant_units::operators::operator""_g_per_mole ( long double  mass)

Definition at line 59 of file GeantUnits.h.

59 { return mass * 1._g / 1._mole; }
constexpr long double geant_units::operators::operator""_GeV ( long double  energy)

Definition at line 46 of file GeantUnits.h.

46 { return energy * 1000._MeV; }
constexpr long double geant_units::operators::operator""_kg ( long double  mass)

Definition at line 49 of file GeantUnits.h.

References hgcalDigitizer_cfi::_m.

49  {
50  return mass * (1._eV / 1.602176487e-19) * 1._s * 1._s / (1._m * 1._m);
51  }
constexpr long double geant_units::operators::operator""_m ( long double  length)

Definition at line 32 of file GeantUnits.h.

32 { return length * 1000.; }
constexpr long double geant_units::operators::operator""_m3 ( long double  length)

Definition at line 34 of file GeantUnits.h.

34 { return length * 1._m * 1._m * 1._m; }
constexpr long double geant_units::operators::operator""_MeV ( long double  energy)

Definition at line 43 of file GeantUnits.h.

constexpr long double geant_units::operators::operator""_mg ( long double  mass)

Definition at line 53 of file GeantUnits.h.

53 { return mass * 1.e-3_g; }
constexpr long double geant_units::operators::operator""_mg_per_cm3 ( long double  density)

Definition at line 57 of file GeantUnits.h.

57 { return density * 1._mg / 1._cm3; }
constexpr long double geant_units::operators::operator""_mm ( long double  length)

Definition at line 30 of file GeantUnits.h.

30 { return length * 1.; }
constexpr long double geant_units::operators::operator""_mm ( unsigned long long int  length)

Definition at line 35 of file GeantUnits.h.

35 { return length * 1; }
constexpr long double geant_units::operators::operator""_mole ( long double  mass)

Definition at line 54 of file GeantUnits.h.

54 { return mass * 1.; }
constexpr long double geant_units::operators::operator""_ns ( long double  x)

Definition at line 40 of file GeantUnits.h.

References geant_units::nanoseconds().

40 { return x * nanoseconds; }
constexpr long double nanoseconds(1.)
constexpr long double geant_units::operators::operator""_s ( long double  x)

Definition at line 39 of file GeantUnits.h.

References geant_units::seconds().

39 { return x * seconds; }
double seconds()
constexpr long double geant_units::operators::operator""_TeV ( long double  energy)

Definition at line 45 of file GeantUnits.h.