SHiP Geometry
SHiP experiment geometry implementation using GeoModel.
Loading...
Searching...
No Matches
SHiP::geometry::units Namespace Reference

Typed-unit vocabulary for the SHiP geometry. More...

Typedefs

using LengthMm = mp_units::quantity<mm>
 Spellings for struct members and function parameters.
using LengthCm = mp_units::quantity<cm>
using AngleDeg = mp_units::quantity<deg>
using AngleRad = mp_units::quantity<rad>

Functions

template<auto U, typename Rep>
requires (U == mm || U == cm || U == m)
constexpr double gm (mp_units::quantity< U, Rep > q)
 Length quantity -> GeoModel raw double (GeoModel native unit: mm).
template<auto U, typename Rep>
requires (U == deg || U == rad)
constexpr double gm (mp_units::quantity< U, Rep > q)
 Angle quantity -> GeoModel raw double (GeoTrf / GeoShape take radians).
constexpr double gm (mp_units::quantity< g/cm3 > density)
 Density bridge; reproduces the former (X * g) / cm3 evaluation order.
constexpr double gm (mp_units::quantity< g/mol > molarMass)
 Molar-mass bridge; reproduces the former (X * g) / mole evaluation order.
constexpr double ratio (mp_units::quantity< one > q)
 Dimensionless quantity -> plain double (counts, growth slopes, and inputs to GeoGenfun / Eigen, which own their own double math).

Variables

constexpr auto mm = mp_units::si::unit_symbols::mm
constexpr auto cm = mp_units::si::unit_symbols::cm
constexpr auto m = mp_units::si::unit_symbols::m
constexpr auto deg = mp_units::si::unit_symbols::deg
constexpr auto rad = mp_units::si::unit_symbols::rad
constexpr auto g = mp_units::si::unit_symbols::g
constexpr auto mol = mp_units::si::unit_symbols::mol
constexpr auto cm3 = mp_units::cubic(mp_units::si::centi<mp_units::si::metre>)

Detailed Description

Typed-unit vocabulary for the SHiP geometry.

Dimensional constants are mp-units quantities stored in the unit they are declared in (an mm-declared value is a quantity of mm, an m-declared value a quantity of m, ...). gm() is the single bridge into GeoModel's raw-double unit system: it reads the stored number back in its own unit (an identity, no conversion) and multiplies by the matching GeoModelKernelUnits factor — the exact floating-point operation the former value * GeoModelKernelUnits::<unit> annotation performed — so retyping leaves the built geometry bit-for-bit unchanged.

Typedef Documentation

◆ AngleDeg

using SHiP::geometry::units::AngleDeg = mp_units::quantity<deg>

◆ AngleRad

using SHiP::geometry::units::AngleRad = mp_units::quantity<rad>

◆ LengthCm

using SHiP::geometry::units::LengthCm = mp_units::quantity<cm>

◆ LengthMm

using SHiP::geometry::units::LengthMm = mp_units::quantity<mm>

Spellings for struct members and function parameters.

Constants instead use static constexpr auto x = 1.0 * units::mm; and deduce their type.

Function Documentation

◆ gm() [1/4]

double SHiP::geometry::units::gm ( mp_units::quantity< g/cm3 > density)
nodiscardconstexpr

Density bridge; reproduces the former (X * g) / cm3 evaluation order.

◆ gm() [2/4]

double SHiP::geometry::units::gm ( mp_units::quantity< g/mol > molarMass)
nodiscardconstexpr

Molar-mass bridge; reproduces the former (X * g) / mole evaluation order.

◆ gm() [3/4]

template<auto U, typename Rep>
requires (U == deg || U == rad)
double SHiP::geometry::units::gm ( mp_units::quantity< U, Rep > q)
nodiscardconstexpr

Angle quantity -> GeoModel raw double (GeoTrf / GeoShape take radians).

◆ gm() [4/4]

template<auto U, typename Rep>
requires (U == mm || U == cm || U == m)
double SHiP::geometry::units::gm ( mp_units::quantity< U, Rep > q)
nodiscardconstexpr

Length quantity -> GeoModel raw double (GeoModel native unit: mm).

◆ ratio()

double SHiP::geometry::units::ratio ( mp_units::quantity< one > q)
nodiscardconstexpr

Dimensionless quantity -> plain double (counts, growth slopes, and inputs to GeoGenfun / Eigen, which own their own double math).

Variable Documentation

◆ cm

auto SHiP::geometry::units::cm = mp_units::si::unit_symbols::cm
inlineconstexpr

◆ cm3

auto SHiP::geometry::units::cm3 = mp_units::cubic(mp_units::si::centi<mp_units::si::metre>)
inlineconstexpr

◆ deg

auto SHiP::geometry::units::deg = mp_units::si::unit_symbols::deg
inlineconstexpr

◆ g

auto SHiP::geometry::units::g = mp_units::si::unit_symbols::g
inlineconstexpr

◆ m

auto SHiP::geometry::units::m = mp_units::si::unit_symbols::m
inlineconstexpr

◆ mm

auto SHiP::geometry::units::mm = mp_units::si::unit_symbols::mm
inlineconstexpr

◆ mol

auto SHiP::geometry::units::mol = mp_units::si::unit_symbols::mol
inlineconstexpr

◆ rad

auto SHiP::geometry::units::rad = mp_units::si::unit_symbols::rad
inlineconstexpr