CMS 3D CMS Logo

Functions
geant_units::operators Namespace Reference

Functions

template<class NumType >
constexpr NumType convertCmToMm (NumType centimeters)
 
template<class NumType >
constexpr long double convertDegToRad (NumType degrees)
 
template<class NumType >
constexpr NumType convertMm3ToM3 (NumType mm3)
 
template<class NumType >
constexpr NumType convertMmToCm (NumType millimeters)
 
template<class NumType >
constexpr NumType convertRadToDeg (NumType radians)
 
template<class NumType >
constexpr NumType convertUnitsTo (long double desiredUnits, NumType val)
 
constexpr long double operator""_cm (long double length)
 
constexpr long double operator""_cm3 (long double length)
 
constexpr long double operator""_deg (long double deg)
 
constexpr long double operator""_deg (unsigned long long int deg)
 
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""_mole (long double mass)
 
constexpr long double operator""_ns (long double x)
 
constexpr long double operator""_pi (long double x)
 
constexpr long double operator""_pi (unsigned long long int x)
 
constexpr long double operator""_rad (long double rad)
 
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::convertCmToMm ( NumType  centimeters)
inline

Definition at line 116 of file GeantUnits.h.

117  {
118  return (centimeters * 10.);
119  }
template<class NumType >
constexpr long double geant_units::operators::convertDegToRad ( NumType  degrees)
inline

Definition at line 104 of file GeantUnits.h.

Referenced by algorithm(), CSCLayerGeometry::CSCLayerGeometry(), CSCWireTopology::CSCWireTopology(), DDHGCalWaferAlgo::execute(), and DDHGCalWafer::execute().

105  {
106  return (degrees / degPerRad);
107  }
double degrees(double radiants)
def degrees
constexpr long double degPerRad
Definition: GeantUnits.h:16
template<class NumType >
constexpr NumType geant_units::operators::convertMm3ToM3 ( NumType  mm3)
inline

Definition at line 122 of file GeantUnits.h.

123  {
124  return (mm3 / 1.e9);
125  }
template<class NumType >
constexpr NumType geant_units::operators::convertMmToCm ( NumType  millimeters)
inline
template<class NumType >
constexpr NumType geant_units::operators::convertRadToDeg ( NumType  radians)
inline

Definition at line 98 of file GeantUnits.h.

Referenced by algorithm(), DDHCalBarrelAlgo::constructGeneralVolume(), DDHCalEndcapAlgo::constructGeneralVolume(), DDHCalEndcapModuleAlgo::constructInsideModule(), DDHCalEndcapAlgo::constructInsideModule(), DDHCalEndcapModuleAlgo::constructInsideModule0(), DDHCalEndcapAlgo::constructInsideModule0(), DDHCalBarrelAlgo::constructInsideSector(), DDHCalEndcapAlgo::constructInsideSector(), DDHGCalModule::constructLayers(), DDHGCalModuleAlgo::constructLayers(), DDHGCalEEAlgo::constructLayers(), DDHGCalHEAlgo::constructLayers(), DDHCalBarrelAlgo::constructMidLayer(), DDHCalEndcapModuleAlgo::constructScintLayer(), DDHCalEndcapAlgo::constructScintLayer(), DDHCalBarrelAlgo::constructSideLayer(), DDcreateRotationMatrix(), DDHtmlRoDetails::details(), DDHCalAngular::execute(), DDGEMAngular::execute(), DDMuonAngular::execute(), DDHCalTBCableAlgo::execute(), DDHCalTBZposAlgo::execute(), DDHCalTestBeamAlgo::execute(), DDHCalXtalAlgo::execute(), DDHCalFibreBundle::execute(), DDAngular::execute(), formatAsDegrees(), formatAsDegreesInInteger(), FastTimeDDDConstants::getEtaPhi(), HcalDDDRecConstants::getOneEtaBin(), HcalDDDSimConstants::getPhis(), HcalDDDRecConstants::getPhis(), HcalDDDRecConstants::getThickActive(), FastTimeDDDConstants::getZPhi(), DDHCalAngular::initialize(), DDMuonAngular::initialize(), DDHCalTBZposAlgo::initialize(), DDHCalTestBeamAlgo::initialize(), DDHCalXtalAlgo::initialize(), DDGEMAngular::initialize(), DDHCalFibreBundle::initialize(), DDHGCalEEAlgo::initialize(), DDHGCalHEAlgo::initialize(), DDLinear::initialize(), DDAngular::initialize(), FastTimeDDDConstants::initialize(), DDHCalEndcapAlgo::initialize(), HcalDDDRecConstants::initialize(), DDLRotationAndReflection::isLeftHanded(), operator<<(), output(), DDHCalEndcapModuleAlgo::parameterLayer(), DDHCalEndcapAlgo::parameterLayer(), DDHCalEndcapModuleAlgo::parameterLayer0(), DDHCalEndcapAlgo::parameterLayer0(), printRot(), HcalDDDSimConstants::printTileHB(), HcalDDDSimConstants::printTileHE(), DDCoreToDDXMLOutput::rotation(), DDCoreToDDXMLOutput::solid(), DDI::Tubs::stream(), DDI::Sphere::stream(), DDI::Torus::stream(), DDI::CutTubs::stream(), DDI::Cons::stream(), DDI::TruncTubs::stream(), DDI::Trap::stream(), DDI::Polyhedra::stream(), and DDI::Polycone::stream().

99  {
100  return (radians * degPerRad);
101  }
constexpr long double degPerRad
Definition: GeantUnits.h:16
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 46 of file GeantUnits.h.

47  {
48  return length*10.;
49  }
constexpr long double geant_units::operators::operator""_cm3 ( long double  length)

Definition at line 54 of file GeantUnits.h.

55  {
56  return length*1._cm*1._cm*1._cm;
57  }
constexpr long double geant_units::operators::operator""_deg ( long double  deg)

Definition at line 28 of file GeantUnits.h.

References geant_units::degPerRad.

29  {
30  return deg / degPerRad;
31  }
constexpr long double degPerRad
Definition: GeantUnits.h:16
constexpr long double geant_units::operators::operator""_deg ( unsigned long long int  deg)

Definition at line 32 of file GeantUnits.h.

References geant_units::degPerRad.

33  {
34  return deg / degPerRad;
35  }
constexpr long double degPerRad
Definition: GeantUnits.h:16
constexpr long double geant_units::operators::operator""_eV ( long double  energy)

Definition at line 72 of file GeantUnits.h.

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

Definition at line 82 of file GeantUnits.h.

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

Definition at line 92 of file GeantUnits.h.

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

Definition at line 94 of file GeantUnits.h.

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

Definition at line 76 of file GeantUnits.h.

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

Definition at line 80 of file GeantUnits.h.

References hgcalDigitizer_cfi::_m.

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

Definition at line 50 of file GeantUnits.h.

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

Definition at line 58 of file GeantUnits.h.

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

Definition at line 70 of file GeantUnits.h.

71  { return energy * 1.; }
constexpr long double geant_units::operators::operator""_mg ( long double  mass)

Definition at line 84 of file GeantUnits.h.

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

Definition at line 90 of file GeantUnits.h.

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

Definition at line 42 of file GeantUnits.h.

43  {
44  return length*1.;
45  }
constexpr long double geant_units::operators::operator""_mole ( long double  mass)

Definition at line 86 of file GeantUnits.h.

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

Definition at line 66 of file GeantUnits.h.

References geant_units::nanoseconds().

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

Definition at line 24 of file GeantUnits.h.

References geant_units::piRadians().

25  { return x * piRadians; }
constexpr long double piRadians(M_PI)
constexpr long double geant_units::operators::operator""_pi ( unsigned long long int  x)

Definition at line 26 of file GeantUnits.h.

References geant_units::piRadians().

27  { return x * piRadians; }
constexpr long double piRadians(M_PI)
constexpr long double geant_units::operators::operator""_rad ( long double  rad)

Definition at line 36 of file GeantUnits.h.

37  {
38  return rad*1.;
39  }
constexpr long double geant_units::operators::operator""_s ( long double  x)

Definition at line 64 of file GeantUnits.h.

References geant_units::seconds().

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

Definition at line 74 of file GeantUnits.h.

75  { return energy * 1.e6_MeV; }