19 #include "HepMC/Errors.h" 20 #include "HepMC/Setup.h" 21 #include "HepMC/FourVector.h" 37 if(
name.compare(0,3,
"GEV") == 0 )
return GEV;
38 if(
name.compare(0,3,
"MEV") == 0 )
return MEV;
40 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 ERROR(
"Units::length_unit: unrecognised unit name: '" <<
name <<
"', setting to CM" )
58 case MEV:
return "MEV";
59 case GEV:
return "GEV";
77 if( from == to )
return;
83 else if( from == MEV ) {
91 if( from == to )
return;
97 else if( from == MM ) {
static void convert(FourVector &m, LengthUnit from, LengthUnit to)
Convert FourVector to different length unit.
static std::string name(LengthUnit u)
Get name of length unit.
static std::string name(MomentumUnit u)
Get name of momentum unit.
static void convert(FourVector &m, MomentumUnit from, MomentumUnit to)
Convert FourVector to different momentum unit.
static MomentumUnit momentum_unit(const std::string &name)
Get momentum unit based on its name.
Stores units-related enums and conversion functions.
MomentumUnit
Momentum units.
Definition of template class SmartPointer.
static LengthUnit length_unit(const std::string &name)
Get length unit based on its name.
LengthUnit
Position units.