|
Celeritas 0.7+9a7f6a5
|
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. | |
Friends | |
| constexpr friend bool | operator== (PDGNumber lhs, PDGNumber rhs) |
| Test equality. | |
| constexpr friend bool | operator!= (PDGNumber lhs, PDGNumber rhs) |
| Test inequality. | |
| constexpr friend bool | operator< (PDGNumber lhs, PDGNumber rhs) |
| Allow less-than comparison for sorting. | |
Type-safe particle identifier.
The Particle Data Group specifies a coding to uniquely identify standard-model particle types in "Monte Carlo Particle Numbering Scheme" section of (pdg). These coded identifiers should generally not be treated like numbers: this class 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).