HepMC3 event record library
Public Types | Static Public Member Functions
Units Class Reference

Stores units-related enums and conversion functions. More...

#include <Units.h>

Public Types

enum  MomentumUnit { MEV, GEV }
 Momentum units. More...
 
enum  LengthUnit { MM, CM }
 Position units. More...
 

Static Public Member Functions

static MomentumUnit momentum_unit (const std::string &name)
 Get momentum unit based on its name. More...
 
static LengthUnit length_unit (const std::string &name)
 Get length unit based on its name. More...
 
static std::string name (MomentumUnit u)
 Get name of momentum unit. More...
 
static std::string name (LengthUnit u)
 Get name of length unit. More...
 
template<typename T >
static void convert (T &m, MomentumUnit from, MomentumUnit to)
 Convert FourVector to different momentum unit. More...
 
template<typename T >
static void convert (T &m, LengthUnit from, LengthUnit to)
 Convert FourVector to different length unit. More...
 

Detailed Description

Stores units-related enums and conversion functions.

Manages units used by HepMC::GenEvent

Definition at line 26 of file Units.h.

Member Enumeration Documentation

enum LengthUnit

Position units.

Definition at line 32 of file Units.h.

Momentum units.

Definition at line 29 of file Units.h.

Member Function Documentation

static void convert ( T &  m,
MomentumUnit  from,
MomentumUnit  to 
)
inlinestatic

Convert FourVector to different momentum unit.

Definition at line 81 of file Units.h.

static void convert ( T &  m,
LengthUnit  from,
LengthUnit  to 
)
inlinestatic

Convert FourVector to different length unit.

Definition at line 96 of file Units.h.

static LengthUnit length_unit ( const std::string &  name)
inlinestatic

Get length unit based on its name.

Definition at line 46 of file Units.h.

References HEPMC3_ERROR.

static MomentumUnit momentum_unit ( const std::string &  name)
inlinestatic

Get momentum unit based on its name.

Definition at line 36 of file Units.h.

References HEPMC3_ERROR.

static std::string name ( MomentumUnit  u)
inlinestatic

Get name of momentum unit.

Definition at line 56 of file Units.h.

static std::string name ( LengthUnit  u)
inlinestatic

Get name of length unit.

Definition at line 68 of file Units.h.


The documentation for this class was generated from the following file: