Particle

0.26.1 · active · verified Mon Apr 13

Particle is a core library within the Scikit-HEP ecosystem, providing a Pythonic interface to the Particle Data Group (PDG) particle data tables and Monte Carlo (MC) identification codes. It offers extended particle information, identification queries via PDGID, and powerful search capabilities for particle properties. The library is under active development and frequently updated with new PDG data releases.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create `PDGID` and `Particle` objects, access their properties, and perform searches for particles based on specific criteria. It also shows the integration with `hepunits` for handling physical units.

from particle import PDGID, Particle
from hepunits import GeV

# Working with PDG IDs
pid_pion = PDGID(211)
print(f"PDGID 211 is a meson: {pid_pion.is_meson}")

# Getting a Particle object from its PDG ID
pion = Particle.from_pdgid(211)
print(f"Pion mass: {pion.mass / GeV:.3f} GeV")

# Searching for particles by properties
neutral_beauty_hadrons = Particle.findall(lambda p: p.charge == 0 and p.has_bottom and p.mass > 5.2 * GeV and p.mass < 5.3 * GeV)
for p in neutral_beauty_hadrons:
    print(f"Found neutral beauty hadron: {p.name} (mass={p.mass / GeV:.3f} GeV)")

view raw JSON →