37 if (
name.compare(0,3,
"GEV") == 0 )
return GEV;
38 if (
name.compare(0,3,
"MEV") == 0 )
return MEV;
40 HEPMC3_ERROR(
"Units::momentum_unit: unrecognised unit name: '" <<
name <<
"', setting to GEV" )
47 if (
name.compare(0,2,
"CM") == 0 )
return CM;
48 if (
name.compare(0,2,
"MM") == 0 )
return MM;
50 HEPMC3_ERROR(
"Units::length_unit: unrecognised unit name: '" <<
name <<
"', setting to CM" )
82 if ( from == to )
return;
88 else if ( from == MEV ) {
97 if ( from == to )
return;
103 else if ( from == MM ) {
Implementation of error and HEPMC3_HEPMC3_WARNING macros.
#define HEPMC3_ERROR(MESSAGE)
Macro for printing error messages.
Definition of class FourVector.
Definition of class Setup.
Stores units-related enums and conversion functions.
static void convert(T &m, MomentumUnit from, MomentumUnit to)
Convert FourVector to different momentum unit.
static LengthUnit length_unit(const std::string &name)
Get length unit based on its name.
LengthUnit
Position units.
static std::string name(MomentumUnit u)
Get name of momentum unit.
MomentumUnit
Momentum units.
static MomentumUnit momentum_unit(const std::string &name)
Get momentum unit based on its name.
static std::string name(LengthUnit u)
Get name of length unit.
static void convert(T &m, LengthUnit from, LengthUnit to)
Convert FourVector to different length unit.