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
IntEnumto 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:
Examples
>>> neutron = ParticleType('neutron') >>> neutron.pdg_number 2112 >>> he4 = ParticleType('He4') >>> he4.zam (2, 4, 0) >>> ParticleType(2112) == ParticleType('neutron') True