Skip to content
Package to parse decay files, describe and convert particle decays between digital representations.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.ci
ci
decaylanguage
docs
images
models
notebooks
tests
.appveyor.yml
.bumpversion.cfg
.cookiecutterrc
.coveragerc
.editorconfig
.gitignore
.travis.yml
AUTHORS.rst
CHANGELOG.md
CONTRIBUTING.rst
LICENSE
MANIFEST.in
Pipfile
README.md
README_dev.md
azure-pipelines.yml
setup.cfg
setup.py
tox.ini

README.md

DecayLanguage

Documentation Status Azure Build Status Coverage Status Tests Status Travis-CI Build Status AppVeyor Build Status Coverage Status PyPI Package latest release Supported versions Commits since latest release

A language to describe particle decays, and tools to work with them.

Installation

Just run the following:

pip install decaylanguage

You can use a virtual environment through pipenv or with --user if you know what those are. Python 2.7 and 3.4+ are supported.

Dependencies: (click to expand)

Required and compatibility dependencies will be automatically installed by pip.

Required dependencies:

  • particle: PDG particle data and identification codes
  • Numpy: The numerical library for Python
  • pandas: Tabular data in Python
  • attrs: DataClasses for Python
  • plumbum: Command line tools
  • lark-parser: A modern parsing library for Python

Python compatibility:

Recommended dependencies:

  • graphviz to render (DOT language) graph descriptions of decay chains.

Usage

This is a quick user guide; for full API docs, go here.

DecayLanguage is a set of tools for building and transforming particle decays. The parts are:

Particles

Particles are a key component when dealing with decays. Refer to the particle package for how to deal with particles and PDG identification codes.

Decays

The most common way to create a decay chain is to read in an AmpGen style syntax from a file or a string. You can use:

from decaylanguage.decay import AmplitudeChain
lines, parameters, constants, states = AmplitudeChain.read_ampgen(text='''
EventType D0 K- pi+ pi+ pi-

D0[D]{K*(892)bar0{K-,pi+},rho(770)0{pi+,pi-}}                            0 1 0.1 0 1 0.1

K(1460)bar-_mass  0 1460 1
K(1460)bar-_width 0  250 1

a(1)(1260)+::Spline::Min 0.18412
a(1)(1260)+::Spline::Max 1.86869
a(1)(1260)+::Spline::N 34
''')

Here, lines will be a list of AmplitudeChain lines (pretty print supported in Jupyter notebooks), parameters will be a table of parameters (ranged parameters not yet supported), constants will be a table of constants, and states will be the list of known states (EventType).

Converters

You can output to a format (currently only GooFit supported, feel free to make a PR to add more). Use a subclass of DecayChain, in this case, GooFitChain. To use the GooFit output, type from the shell:

python -m decaylanguage.decay -G goofit myinput.opts

Acknowledgements

DecayLanguage is free software released under a BSD 3-Clause License. It was originally developed by Henry Schreiner.

You can’t perform that action at this time.