Decay chains#

The decaylanguage.decay module provides classes for building and visualizing decay chains programmatically.

Building a decay chain#

from decaylanguage import DecayMode, DecayChain

# Define individual decay modes with branching fractions
dm1 = DecayMode(0.0263, "D0 pi+")
dm2 = DecayMode(0.0391, "K- pi+")

# Build the full chain
dc = DecayChain("D*+", {"D*+": dm1, "D0": dm2})
print(dc)
<DecayChain: D*+ -> D0 pi+ (1 sub-decays), BF=0.0263>

Visualization#

Decay chains can be visualized using DecayChainViewer:

from decaylanguage import DecayChainViewer

dcv = DecayChainViewer(dc)

# In Jupyter, simply display the object
dcv

# Or export to a file
dcv.graph.render("my_decay", format="png")
'my_decay.png'

The DaughtersDict class (a specialized Counter) represents final-state particle multiplicities.

For more detailed examples, see the Notebooks section.