Celeritas
0.5.0-56+6b053cd
|
Type-safe particle identifier. More...
#include <PDGNumber.hh>
Public Member Functions | |
constexpr | PDGNumber ()=default |
Construct with an invalid/unassigned value of zero. | |
constexpr | PDGNumber (int val) |
Construct with the PDG value. | |
constexpr | operator bool () const |
True if value is nonzero. | |
constexpr int | unchecked_get () const |
Get the PDG value. | |
int | get () const |
Get the PDG value. | |
Type-safe particle identifier.
PDG-coded numbers should generally not be treated like numbers, so this prevents unintentional arithmetic and conversion.
PDG numbers should only be used in host setup code (they should be converted to ParticleId for use during runtime) so these functions have fewer decorators.