Parsing .dec files#

The DecFileParser class provides a full parser for EvtGen-format .dec decay files used by LHCb, Belle II, and other experiments.

Basic usage#

from decaylanguage import DecFileParser
from decaylanguage.data import basepath

# Parse the bundled LHCb decay file
parser = DecFileParser(basepath / "DECAY_LHCB.DEC")
parser.parse()

# List all mother particles with defined decays
parser.list_decay_mother_names()[:10]
['Upsilon(4S)',
 'anti-B0',
 'B0',
 'B-',
 'B+',
 'B*+',
 'B*-',
 'B*0',
 'anti-B*0',
 'B_s*0']
# Get decay modes for a specific particle
parser.list_decay_modes("D*+")
[['D0', 'pi+'], ['D+', 'pi0'], ['D+', 'gamma']]
# Get branching fractions
parser.print_decay_modes("D*+")
  0.677        D0 pi+         VSS;
  0.307        D+ pi0         VSS;
  0.016        D+ gamma       VSP_PWAVE;

Building decay chains#

# Build the full decay chain for a particle
chain = parser.build_decay_chains("D*+")

Charge conjugation#

By default, charge-conjugated decays are automatically included. This behavior can be controlled at parse time.

For more detailed examples, see the Notebooks section.