Celeritas  0.5.0-86+4a8eea4
Public Member Functions | List of all members
celeritas::PDGNumber Class Reference

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.
 

Detailed Description

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.


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