openmc.ParticleType

class openmc.ParticleType(value: str | int | ParticleType)[source]

Particle type defined by a PDG number.

ParticleType uses the Particle Data Group (PDG) Monte Carlo numbering scheme to uniquely identify particle types. This includes elementary particles (neutrons, photons, etc.) and nuclear codes for isotopes.

Changed in version 0.16.0: Changed from an IntEnum to a class backed by PDG Monte Carlo particle numbers.

Parameters:

value (str, int, or ParticleType) –

The particle identifier. Can be:

  • A string name (e.g., ‘neutron’, ‘photon’, ‘He4’, ‘U235’)

  • An integer PDG number (e.g., 2112 for neutron)

  • A string with PDG prefix (e.g., ‘pdg:2112’)

  • An existing ParticleType instance

Variables:
  • pdg_number (int) – The PDG number for this particle type

  • zam (tuple of int or None) – For nuclear particles, the (Z, A, m) tuple where Z is atomic number, A is mass number, and m is metastable state. None for elementary particles.

  • is_nucleus (bool) – Whether this particle is a nucleus (ion)

Examples

>>> neutron = ParticleType('neutron')
>>> neutron.pdg_number
2112
>>> he4 = ParticleType('He4')
>>> he4.zam
(2, 4, 0)
>>> ParticleType(2112) == ParticleType('neutron')
True
property is_nucleus: bool

Return whether this particle is a nucleus.

Returns:

True if the particle is a nucleus (ion), False otherwise

Return type:

bool

property zam: tuple[int, int, int] | None

Return the (Z, A, m) tuple for nuclear particles.

Returns:

For nuclear particles, returns (Z, A, m) where Z is atomic number, A is mass number, and m is metastable state. Returns None for elementary particles.

Return type:

tuple of int or None