decaylanguage 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/.coveragerc +3 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/AUTHORS.rst +1 -0
- decaylanguage-0.3.0/CHANGELOG.md +39 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/LICENSE +1 -1
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/MANIFEST.in +1 -0
- decaylanguage-0.3.0/PKG-INFO +203 -0
- decaylanguage-0.3.0/README.md +146 -0
- decaylanguage-0.3.0/decaylanguage/__init__.py +14 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/decaylanguage/__main__.py +6 -2
- decaylanguage-0.3.0/decaylanguage/_version.py +10 -0
- decaylanguage-0.3.0/decaylanguage/data/DECAY_CLASSIC.DEC +10249 -0
- decaylanguage-0.3.0/decaylanguage/data/DECAY_LHCB.DEC +11678 -0
- decaylanguage-0.3.0/decaylanguage/data/MintDalitzSpecialParticles.csv +37 -0
- decaylanguage-0.2.0/decaylanguage/data/MintDalitzSpecialParticles.csv → decaylanguage-0.3.0/decaylanguage/data/MintDalitzSpecialParticles.fwf +36 -36
- decaylanguage-0.3.0/decaylanguage/data/MintDalitzSpecialParticlesLatex.csv +15 -0
- decaylanguage-0.3.0/decaylanguage/data/README.rst +51 -0
- decaylanguage-0.3.0/decaylanguage/data/WorkingOutModel.ipynb +659 -0
- decaylanguage-0.3.0/decaylanguage/data/__init__.py +4 -0
- decaylanguage-0.3.0/decaylanguage/data/ampgen.lark +65 -0
- decaylanguage-0.3.0/decaylanguage/data/decfile.lark +61 -0
- decaylanguage-0.3.0/decaylanguage/data/particle.lark +35 -0
- decaylanguage-0.3.0/decaylanguage/dec/__init__.py +3 -0
- decaylanguage-0.3.0/decaylanguage/dec/dec.py +1213 -0
- decaylanguage-0.3.0/decaylanguage/dec/decparser.py +409 -0
- decaylanguage-0.3.0/decaylanguage/dec/enums.py +62 -0
- decaylanguage-0.3.0/decaylanguage/decay/__init__.py +1 -0
- decaylanguage-0.3.0/decaylanguage/decay/decay.py +243 -0
- decaylanguage-0.3.0/decaylanguage/decay/viewer.py +182 -0
- {decaylanguage-0.2.0/decaylanguage/decay → decaylanguage-0.3.0/decaylanguage/modeling}/ampgen2goofit.py +9 -3
- decaylanguage-0.3.0/decaylanguage/modeling/ampgentransform.py +49 -0
- decaylanguage-0.3.0/decaylanguage/modeling/amplitudechain.py +277 -0
- decaylanguage-0.3.0/decaylanguage/modeling/decay.py +123 -0
- {decaylanguage-0.2.0/decaylanguage/decay → decaylanguage-0.3.0/decaylanguage/modeling}/goofit.py +19 -11
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/decaylanguage/utils/errors.py +5 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/decaylanguage/utils/utilities.py +5 -0
- decaylanguage-0.3.0/decaylanguage.egg-info/PKG-INFO +203 -0
- decaylanguage-0.3.0/decaylanguage.egg-info/SOURCES.txt +120 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/decaylanguage.egg-info/requires.txt +11 -1
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/decaylanguage.egg-info/top_level.txt +1 -0
- decaylanguage-0.3.0/docs/reference/decaylanguage.decay.rst +33 -0
- decaylanguage-0.3.0/docs/usage.rst +27 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/notebooks/AmpGen2GooFit D2K3p.ipynb +2 -2
- decaylanguage-0.3.0/notebooks/DecReader.ipynb +859 -0
- decaylanguage-0.3.0/notebooks/DecayLanguageDemo.ipynb +405 -0
- decaylanguage-0.3.0/notebooks/ExampleDecFileParsingWithLark.ipynb +426 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/__init__.py +14 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/__main__.py +30 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/_version.py +10 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/data/DECAY_CLASSIC.DEC +10249 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/data/DECAY_LHCB.DEC +11678 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/data/MintDalitzSpecialParticles.csv +37 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/data/MintDalitzSpecialParticles.fwf +41 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/data/MintDalitzSpecialParticlesLatex.csv +15 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/data/README.rst +51 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/data/WorkingOutModel.ipynb +659 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/data/__init__.py +4 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/data/ampgen.lark +65 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/data/decfile.lark +61 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/data/particle.lark +35 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/dec/__init__.py +3 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/dec/dec.py +1213 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/dec/decparser.py +409 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/dec/enums.py +62 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/decay/__init__.py +1 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/decay/decay.py +243 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/decay/viewer.py +182 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/modeling/AmpGenReader.ipynb +1607 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/modeling/__init__.py +4 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/modeling/ampgen2goofit.py +86 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/modeling/ampgentransform.py +49 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/modeling/amplitudechain.py +277 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/modeling/decay.py +123 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/modeling/goofit.py +330 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/utils/__init__.py +8 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/utils/errors.py +13 -0
- decaylanguage-0.3.0/notebooks/decaylanguage/utils/utilities.py +56 -0
- decaylanguage-0.3.0/notebooks/simple_model.txt +8 -0
- decaylanguage-0.3.0/setup.py +93 -0
- decaylanguage-0.3.0/tests/__init__.py +0 -0
- decaylanguage-0.3.0/tests/data/README.rst +5 -0
- decaylanguage-0.3.0/tests/data/defs-aliases-chargeconj.dec +271 -0
- decaylanguage-0.3.0/tests/data/duplicate-decays.dec +40 -0
- decaylanguage-0.3.0/tests/data/test_Bc2BsPi_Bs2KK.dec +22 -0
- decaylanguage-0.3.0/tests/data/test_Bd2DDst_Ds2DmPi0.dec +53 -0
- decaylanguage-0.3.0/tests/data/test_Bd2DmTauNu_Dm23PiPi0_Tau2MuNu.dec +42 -0
- decaylanguage-0.3.0/tests/data/test_Bd2Dst0X_D02KPi.dec +127 -0
- decaylanguage-0.3.0/tests/data/test_Bd2DstDst.dec +85 -0
- decaylanguage-0.3.0/tests/data/test_Upsilon4S2B0B0bar.dec +8 -0
- decaylanguage-0.3.0/tests/data/test_Xicc2XicPiPi.dec +16 -0
- decaylanguage-0.3.0/tests/data/test_example_Dst.dec +30 -0
- decaylanguage-0.3.0/tests/decay/test_decay.py +127 -0
- decaylanguage-0.3.0/tests/decay/test_viewer.py +99 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/tests/output/DtoKpipipi_v2.cu +49 -49
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/tests/test_convert.py +10 -1
- decaylanguage-0.3.0/tests/test_dec.py +401 -0
- decaylanguage-0.3.0/tests/test_dec_full.py +67 -0
- decaylanguage-0.3.0/tests/test_decaylanguage.py +10 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/tests/test_goofit.py +11 -2
- decaylanguage-0.2.0/.appveyor.yml +0 -65
- decaylanguage-0.2.0/.bumpversion.cfg +0 -21
- decaylanguage-0.2.0/.cookiecutterrc +0 -53
- decaylanguage-0.2.0/.travis.yml +0 -39
- decaylanguage-0.2.0/CHANGELOG.md +0 -13
- decaylanguage-0.2.0/PKG-INFO +0 -163
- decaylanguage-0.2.0/Pipfile +0 -26
- decaylanguage-0.2.0/README.md +0 -120
- decaylanguage-0.2.0/ci/appveyor-bootstrap.py +0 -111
- decaylanguage-0.2.0/ci/appveyor-download.py +0 -109
- decaylanguage-0.2.0/ci/appveyor-with-compiler.cmd +0 -23
- decaylanguage-0.2.0/ci/bootstrap.py +0 -57
- decaylanguage-0.2.0/ci/templates/.travis.yml +0 -36
- decaylanguage-0.2.0/ci/templates/appveyor.yml +0 -51
- decaylanguage-0.2.0/decaylanguage/__init__.py +0 -6
- decaylanguage-0.2.0/decaylanguage/data/__init__.py +0 -16
- decaylanguage-0.2.0/decaylanguage/data/mass_width_2008.csv +0 -736
- decaylanguage-0.2.0/decaylanguage/data/pdgID_to_latex.txt +0 -338
- decaylanguage-0.2.0/decaylanguage/decay/ampline.py +0 -79
- decaylanguage-0.2.0/decaylanguage/decay/amplitudechain.py +0 -337
- decaylanguage-0.2.0/decaylanguage/particle/__init__.py +0 -12
- decaylanguage-0.2.0/decaylanguage/particle/particle.py +0 -443
- decaylanguage-0.2.0/decaylanguage.egg-info/PKG-INFO +0 -163
- decaylanguage-0.2.0/decaylanguage.egg-info/SOURCES.txt +0 -70
- decaylanguage-0.2.0/decaylanguage.egg-info/zip-safe +0 -1
- decaylanguage-0.2.0/docs/reference/decaylanguage.decay.rst +0 -33
- decaylanguage-0.2.0/docs/reference/decaylanguage.particle.rst +0 -9
- decaylanguage-0.2.0/docs/usage.rst +0 -22
- decaylanguage-0.2.0/setup.py +0 -70
- decaylanguage-0.2.0/tests/test_decaylanguage.py +0 -6
- decaylanguage-0.2.0/tests/test_particle.py +0 -39
- decaylanguage-0.2.0/tox.ini +0 -93
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/.editorconfig +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/CONTRIBUTING.rst +0 -0
- {decaylanguage-0.2.0/decaylanguage/decay → decaylanguage-0.3.0/decaylanguage/modeling}/__init__.py +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/decaylanguage/utils/__init__.py +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/decaylanguage.egg-info/dependency_links.txt +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/docs/authors.rst +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/docs/changelog.rst +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/docs/conf.py +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/docs/contributing.rst +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/docs/index.rst +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/docs/installation.rst +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/docs/readme.rst +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/docs/reference/decaylanguage.rst +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/docs/reference/index.rst +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/docs/requirements.txt +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/docs/spelling_wordlist.txt +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/images/DecayLanguage.ink.svg +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/images/DecayLanguage.pdf +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/images/DecayLanguage.png +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/images/DecayLanguage.svg +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/models/DtoKpipipi_v2.txt +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/notebooks/DtoKpipipi_v2.cu +0 -0
- {decaylanguage-0.2.0 → decaylanguage-0.3.0}/setup.cfg +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Version 0.3.0 (2019-06-26)
|
|
4
|
+
|
|
5
|
+
* Decays modelling:
|
|
6
|
+
- Updates to Mint related particle data files.
|
|
7
|
+
* Parsing of decay files (aka .dec files):
|
|
8
|
+
- Lark parser files added, for ``.dec`` decay files.
|
|
9
|
+
- ``DecFileParser`` class introduced, with documentation and test suite.
|
|
10
|
+
- Various ``.dec`` test decay files added.
|
|
11
|
+
* Visualisation of decay chains:
|
|
12
|
+
- ``DecayChainViewer`` class introduced, with documentation and test suite.
|
|
13
|
+
* Universal representation of decay chains:
|
|
14
|
+
- First "building block" classes ``DaughtersDict`` and ``DecayMode`` introduced,
|
|
15
|
+
with documentation and test suite.
|
|
16
|
+
* Package dependencies:
|
|
17
|
+
- Package made dependent on Scikit-HEP's ``Particle`` package.
|
|
18
|
+
- Redundant code removed.
|
|
19
|
+
* Continuous integration:
|
|
20
|
+
- CI with Azure pipelines introduced.
|
|
21
|
+
- CI with Travis and AppVeyor removed.
|
|
22
|
+
* Miscellaneous:
|
|
23
|
+
- Demo notebook added, with a launcher for Binder.
|
|
24
|
+
-Copyright statements added to repository files.
|
|
25
|
+
- General clean-up and minor bug fixes.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## Version 0.2.0 (2018-08-02)
|
|
29
|
+
|
|
30
|
+
* First release as part of Scikit-HEP.
|
|
31
|
+
* Using new data package with ``importlib_resources`` (or ``importlib.resources`` on Python 3.7).
|
|
32
|
+
* Better docs and examples.
|
|
33
|
+
* Some method renaming.
|
|
34
|
+
* Generalized converter script.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## Version 0.1.0 (2018-03-13)
|
|
38
|
+
|
|
39
|
+
* First release on PyPI.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
BSD 3-Clause License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2018,
|
|
3
|
+
Copyright (c) 2018-2019, Eduardo Rodrigues and Henry Schreiner.
|
|
4
4
|
All rights reserved.
|
|
5
5
|
|
|
6
6
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
|
|
@@ -25,6 +25,7 @@ include tox.ini .travis.yml .appveyor.yml
|
|
|
25
25
|
recursive-include decaylanguage *.py
|
|
26
26
|
recursive-include decaylanguage *.csv
|
|
27
27
|
recursive-include decaylanguage *.txt
|
|
28
|
+
recursive-include decaylanguage *.lark
|
|
28
29
|
|
|
29
30
|
recursive-include images *.pdf
|
|
30
31
|
recursive-include images *.png
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: decaylanguage
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: A language to describe particle decays, and tools to work with them.
|
|
5
|
+
Home-page: https://github.com/scikit-hep/decaylanguage
|
|
6
|
+
Author: Henry Fredrick Schreiner III
|
|
7
|
+
Author-email: henry.schreiner@cern.ch
|
|
8
|
+
Maintainer: The Scikit-HEP admins
|
|
9
|
+
Maintainer-email: scikit-hep-admins@googlegroups.com
|
|
10
|
+
License: BSD 3-Clause License
|
|
11
|
+
Description:
|
|
12
|
+
](https://github.com/scikit-hep/decaylanguage/raw/master/images/DecayLanguage.png)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
DecayLanguage implements a language to describe and convert particle decays
|
|
17
|
+
between digital representations, effectively making it possible to interoperate
|
|
18
|
+
several fitting programs. Particular interest is given to programs dedicated
|
|
19
|
+
to amplitude analyses.
|
|
20
|
+
|
|
21
|
+
DecayLanguage provides tools to parse so-called .dec decay files,
|
|
22
|
+
and manipulate and visualize decay chains.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Installation
|
|
26
|
+
|
|
27
|
+
Just run the following:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install decaylanguage
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
You can use a virtual environment through pipenv or with `--user` if you know
|
|
34
|
+
what those are. [Python 2.7 and 3.4+](http://docs.python-guide.org/en/latest/starting/installation) are supported.
|
|
35
|
+
|
|
36
|
+
<details><summary>Dependencies: (click to expand)</summary><p>
|
|
37
|
+
|
|
38
|
+
Required and compatibility dependencies will be automatically installed by pip.
|
|
39
|
+
|
|
40
|
+
#### Required dependencies:
|
|
41
|
+
|
|
42
|
+
- [particle](https://github.com/scikit-hep/particle): PDG particle data and identification codes
|
|
43
|
+
- [Numpy](https://scipy.org/install.html): The numerical library for Python
|
|
44
|
+
- [pandas](https://pandas.pydata.org/): Tabular data in Python
|
|
45
|
+
- [attrs](https://github.com/python-attrs/attrs): DataClasses for Python
|
|
46
|
+
- [plumbum](https://github.com/tomerfiliba/plumbum): Command line tools
|
|
47
|
+
- [lark-parser](https://github.com/lark-parser/lark): A modern parsing library for Python
|
|
48
|
+
|
|
49
|
+
#### Python compatibility:
|
|
50
|
+
- [six](https://github.com/benjaminp/six): Compatibility library
|
|
51
|
+
- [pathlib2](https://github.com/mcmtroffaes/pathlib2) backport if using Python 2.7
|
|
52
|
+
- [enum34](https://bitbucket.org/stoneleaf/enum34) backport if using Python /< 3.5
|
|
53
|
+
- [importlib_resources](http://importlib-resources.readthedocs.io/en/latest/) backport if using Python /< 3.7
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
#### Recommended dependencies:
|
|
57
|
+
- [graphviz](https://gitlab.com/graphviz/graphviz/) to render (DOT
|
|
58
|
+
language) graph descriptions of decay chains.
|
|
59
|
+
- [pydot](https://github.com/pydot/pydot), a Python interface to
|
|
60
|
+
Graphviz's Dot language, used to visualize particle decay chains.
|
|
61
|
+
</p></details>
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Usage
|
|
65
|
+
|
|
66
|
+
This is a quick user guide. For a full API docs, go [here](https://decaylanguage.readthedocs.io/en/latest/).
|
|
67
|
+
|
|
68
|
+
``DecayLanguage`` is a set of tools for building and transforming particle
|
|
69
|
+
decays. The parts are:
|
|
70
|
+
|
|
71
|
+
#### Particles
|
|
72
|
+
|
|
73
|
+
Particles are a key component when dealing with decays.
|
|
74
|
+
Refer to the [particle package](https://github.com/scikit-hep/particle)
|
|
75
|
+
for how to deal with particles and PDG identification codes.
|
|
76
|
+
|
|
77
|
+
#### Decay files
|
|
78
|
+
|
|
79
|
+
Decay .dec files can be parsed simply with
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from decaylanguage import DecFileParser
|
|
83
|
+
|
|
84
|
+
parser = DecFileParser('my-decay-file.dec')
|
|
85
|
+
parser.parse()
|
|
86
|
+
|
|
87
|
+
# Inspect what decays are defined
|
|
88
|
+
parser.list_decay_mother_names()
|
|
89
|
+
|
|
90
|
+
# Print decay modes, etc. ...
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
A copy of the master DECAY.DEC file used by the LHCb experiment is provided
|
|
94
|
+
[here](https://github.com/scikit-hep/decaylanguage/tree/master/decaylanguage/data)
|
|
95
|
+
for convenience.
|
|
96
|
+
|
|
97
|
+
The `DecFileParser` class implements a series of methods giving access to all
|
|
98
|
+
information stored in decay files: the decays themselves, particle name aliases,
|
|
99
|
+
definitions of charge-conjugate particles, variable and Pythia-specific
|
|
100
|
+
definitions, etc.
|
|
101
|
+
|
|
102
|
+
#### Decay modeling
|
|
103
|
+
|
|
104
|
+
The most common way to create a decay chain is to read in an [AmpGen]
|
|
105
|
+
style syntax from a file or a string. You can use:
|
|
106
|
+
|
|
107
|
+
```python
|
|
108
|
+
from decaylanguage.modeling import AmplitudeChain
|
|
109
|
+
lines, parameters, constants, states = AmplitudeChain.read_ampgen(text='''
|
|
110
|
+
EventType D0 K- pi+ pi+ pi-
|
|
111
|
+
|
|
112
|
+
D0[D]{K*(892)bar0{K-,pi+},rho(770)0{pi+,pi-}} 0 1 0.1 0 1 0.1
|
|
113
|
+
|
|
114
|
+
K(1460)bar-_mass 0 1460 1
|
|
115
|
+
K(1460)bar-_width 0 250 1
|
|
116
|
+
|
|
117
|
+
a(1)(1260)+::Spline::Min 0.18412
|
|
118
|
+
a(1)(1260)+::Spline::Max 1.86869
|
|
119
|
+
a(1)(1260)+::Spline::N 34
|
|
120
|
+
''')
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Here, `lines` will be a list of AmplitudeChain lines (pretty print supported in Jupyter notebooks),
|
|
124
|
+
`parameters` will be a table of parameters (ranged parameters not yet supported),
|
|
125
|
+
`constants` will be a table of constants,
|
|
126
|
+
and `states` will be the list of known states (EventType).
|
|
127
|
+
|
|
128
|
+
#### Converters
|
|
129
|
+
|
|
130
|
+
You can output to a format (currently only [GooFit] supported, feel free
|
|
131
|
+
to make a PR to add more). Use a subclass of DecayChain, in this case,
|
|
132
|
+
GooFitChain. To use the [GooFit] output, type from the shell:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
python -m decaylanguage -G goofit myinput.opts
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Acknowledgements
|
|
139
|
+
|
|
140
|
+
DecayLanguage is free software released under a BSD 3-Clause License.
|
|
141
|
+
It was originally developed by Henry Schreiner.
|
|
142
|
+
|
|
143
|
+
[AmpGen]: https://gitlab.cern.ch/lhcb/Gauss/tree/LHCBGAUSS-1058.AmpGenDev/Gen/AmpGen
|
|
144
|
+
[GooFit]: https://GooFit.github.io
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
# Changelog
|
|
148
|
+
|
|
149
|
+
## Version 0.3.0 (2019-06-26)
|
|
150
|
+
|
|
151
|
+
* Decays modelling:
|
|
152
|
+
- Updates to Mint related particle data files.
|
|
153
|
+
* Parsing of decay files (aka .dec files):
|
|
154
|
+
- Lark parser files added, for ``.dec`` decay files.
|
|
155
|
+
- ``DecFileParser`` class introduced, with documentation and test suite.
|
|
156
|
+
- Various ``.dec`` test decay files added.
|
|
157
|
+
* Visualisation of decay chains:
|
|
158
|
+
- ``DecayChainViewer`` class introduced, with documentation and test suite.
|
|
159
|
+
* Universal representation of decay chains:
|
|
160
|
+
- First "building block" classes ``DaughtersDict`` and ``DecayMode`` introduced,
|
|
161
|
+
with documentation and test suite.
|
|
162
|
+
* Package dependencies:
|
|
163
|
+
- Package made dependent on Scikit-HEP's ``Particle`` package.
|
|
164
|
+
- Redundant code removed.
|
|
165
|
+
* Continuous integration:
|
|
166
|
+
- CI with Azure pipelines introduced.
|
|
167
|
+
- CI with Travis and AppVeyor removed.
|
|
168
|
+
* Miscellaneous:
|
|
169
|
+
- Demo notebook added, with a launcher for Binder.
|
|
170
|
+
-Copyright statements added to repository files.
|
|
171
|
+
- General clean-up and minor bug fixes.
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## Version 0.2.0 (2018-08-02)
|
|
175
|
+
|
|
176
|
+
* First release as part of Scikit-HEP.
|
|
177
|
+
* Using new data package with ``importlib_resources`` (or ``importlib.resources`` on Python 3.7).
|
|
178
|
+
* Better docs and examples.
|
|
179
|
+
* Some method renaming.
|
|
180
|
+
* Generalized converter script.
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
## Version 0.1.0 (2018-03-13)
|
|
184
|
+
|
|
185
|
+
* First release on PyPI.
|
|
186
|
+
|
|
187
|
+
Keywords: particle,decay,HEP
|
|
188
|
+
Platform: Any
|
|
189
|
+
Classifier: Development Status :: 4 - Beta
|
|
190
|
+
Classifier: Intended Audience :: Developers
|
|
191
|
+
Classifier: Intended Audience :: Science/Research
|
|
192
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
193
|
+
Classifier: Operating System :: OS Independent
|
|
194
|
+
Classifier: Programming Language :: Python
|
|
195
|
+
Classifier: Programming Language :: Python :: 2.7
|
|
196
|
+
Classifier: Programming Language :: Python :: 3
|
|
197
|
+
Classifier: Programming Language :: Python :: 3.5
|
|
198
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
199
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
200
|
+
Classifier: Topic :: Scientific/Engineering
|
|
201
|
+
Description-Content-Type: text/markdown
|
|
202
|
+
Provides-Extra: test
|
|
203
|
+
Provides-Extra: notebook
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
[](http://decaylanguage.readthedocs.io/en/latest/)
|
|
2
|
+
|
|
3
|
+
## DecayLanguage: describe, manipulate and convert particle decays
|
|
4
|
+
|
|
5
|
+
[](https://pypi.python.org/pypi/decaylanguage)
|
|
6
|
+
[](https://doi.org/10.5281/zenodo.3257423)
|
|
7
|
+
[](https://readthedocs.org/projects/decaylanguage)
|
|
8
|
+
[](https://dev.azure.com/scikit-hep/decaylanguage/_build/latest?definitionId=3?branchName=master)
|
|
9
|
+
[](https://dev.azure.com/scikit-hep/decaylanguage/_build/latest?definitionId=3?branchName=master)
|
|
10
|
+
[](https://dev.azure.com/scikit-hep/decaylanguage/_build/latest?definitionId=3?branchName=master)
|
|
11
|
+
[](https://pypi.python.org/pypi/decaylanguage)
|
|
12
|
+
[](https://github.com/scikit-hep/decaylanguage/compare/v0.3.0...master)
|
|
13
|
+
[](https://mybinder.org/v2/gh/scikit-hep/decaylanguage/master?urlpath=lab/tree/notebooks/DecayLanguageDemo.ipynb)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<!-- break -->
|
|
17
|
+
|
|
18
|
+
DecayLanguage implements a language to describe and convert particle decays
|
|
19
|
+
between digital representations, effectively making it possible to interoperate
|
|
20
|
+
several fitting programs. Particular interest is given to programs dedicated
|
|
21
|
+
to amplitude analyses.
|
|
22
|
+
|
|
23
|
+
DecayLanguage provides tools to parse so-called .dec decay files,
|
|
24
|
+
and manipulate and visualize decay chains.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Installation
|
|
28
|
+
|
|
29
|
+
Just run the following:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install decaylanguage
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
You can use a virtual environment through pipenv or with `--user` if you know
|
|
36
|
+
what those are. [Python 2.7 and 3.4+](http://docs.python-guide.org/en/latest/starting/installation) are supported.
|
|
37
|
+
|
|
38
|
+
<details><summary>Dependencies: (click to expand)</summary><p>
|
|
39
|
+
|
|
40
|
+
Required and compatibility dependencies will be automatically installed by pip.
|
|
41
|
+
|
|
42
|
+
#### Required dependencies:
|
|
43
|
+
|
|
44
|
+
- [particle](https://github.com/scikit-hep/particle): PDG particle data and identification codes
|
|
45
|
+
- [Numpy](https://scipy.org/install.html): The numerical library for Python
|
|
46
|
+
- [pandas](https://pandas.pydata.org/): Tabular data in Python
|
|
47
|
+
- [attrs](https://github.com/python-attrs/attrs): DataClasses for Python
|
|
48
|
+
- [plumbum](https://github.com/tomerfiliba/plumbum): Command line tools
|
|
49
|
+
- [lark-parser](https://github.com/lark-parser/lark): A modern parsing library for Python
|
|
50
|
+
|
|
51
|
+
#### Python compatibility:
|
|
52
|
+
- [six](https://github.com/benjaminp/six): Compatibility library
|
|
53
|
+
- [pathlib2](https://github.com/mcmtroffaes/pathlib2) backport if using Python 2.7
|
|
54
|
+
- [enum34](https://bitbucket.org/stoneleaf/enum34) backport if using Python /< 3.5
|
|
55
|
+
- [importlib_resources](http://importlib-resources.readthedocs.io/en/latest/) backport if using Python /< 3.7
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
#### Recommended dependencies:
|
|
59
|
+
- [graphviz](https://gitlab.com/graphviz/graphviz/) to render (DOT
|
|
60
|
+
language) graph descriptions of decay chains.
|
|
61
|
+
- [pydot](https://github.com/pydot/pydot), a Python interface to
|
|
62
|
+
Graphviz's Dot language, used to visualize particle decay chains.
|
|
63
|
+
</p></details>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Usage
|
|
67
|
+
|
|
68
|
+
This is a quick user guide. For a full API docs, go [here](https://decaylanguage.readthedocs.io/en/latest/).
|
|
69
|
+
|
|
70
|
+
``DecayLanguage`` is a set of tools for building and transforming particle
|
|
71
|
+
decays. The parts are:
|
|
72
|
+
|
|
73
|
+
#### Particles
|
|
74
|
+
|
|
75
|
+
Particles are a key component when dealing with decays.
|
|
76
|
+
Refer to the [particle package](https://github.com/scikit-hep/particle)
|
|
77
|
+
for how to deal with particles and PDG identification codes.
|
|
78
|
+
|
|
79
|
+
#### Decay files
|
|
80
|
+
|
|
81
|
+
Decay .dec files can be parsed simply with
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from decaylanguage import DecFileParser
|
|
85
|
+
|
|
86
|
+
parser = DecFileParser('my-decay-file.dec')
|
|
87
|
+
parser.parse()
|
|
88
|
+
|
|
89
|
+
# Inspect what decays are defined
|
|
90
|
+
parser.list_decay_mother_names()
|
|
91
|
+
|
|
92
|
+
# Print decay modes, etc. ...
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
A copy of the master DECAY.DEC file used by the LHCb experiment is provided
|
|
96
|
+
[here](https://github.com/scikit-hep/decaylanguage/tree/master/decaylanguage/data)
|
|
97
|
+
for convenience.
|
|
98
|
+
|
|
99
|
+
The `DecFileParser` class implements a series of methods giving access to all
|
|
100
|
+
information stored in decay files: the decays themselves, particle name aliases,
|
|
101
|
+
definitions of charge-conjugate particles, variable and Pythia-specific
|
|
102
|
+
definitions, etc.
|
|
103
|
+
|
|
104
|
+
#### Decay modeling
|
|
105
|
+
|
|
106
|
+
The most common way to create a decay chain is to read in an [AmpGen]
|
|
107
|
+
style syntax from a file or a string. You can use:
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
from decaylanguage.modeling import AmplitudeChain
|
|
111
|
+
lines, parameters, constants, states = AmplitudeChain.read_ampgen(text='''
|
|
112
|
+
EventType D0 K- pi+ pi+ pi-
|
|
113
|
+
|
|
114
|
+
D0[D]{K*(892)bar0{K-,pi+},rho(770)0{pi+,pi-}} 0 1 0.1 0 1 0.1
|
|
115
|
+
|
|
116
|
+
K(1460)bar-_mass 0 1460 1
|
|
117
|
+
K(1460)bar-_width 0 250 1
|
|
118
|
+
|
|
119
|
+
a(1)(1260)+::Spline::Min 0.18412
|
|
120
|
+
a(1)(1260)+::Spline::Max 1.86869
|
|
121
|
+
a(1)(1260)+::Spline::N 34
|
|
122
|
+
''')
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Here, `lines` will be a list of AmplitudeChain lines (pretty print supported in Jupyter notebooks),
|
|
126
|
+
`parameters` will be a table of parameters (ranged parameters not yet supported),
|
|
127
|
+
`constants` will be a table of constants,
|
|
128
|
+
and `states` will be the list of known states (EventType).
|
|
129
|
+
|
|
130
|
+
#### Converters
|
|
131
|
+
|
|
132
|
+
You can output to a format (currently only [GooFit] supported, feel free
|
|
133
|
+
to make a PR to add more). Use a subclass of DecayChain, in this case,
|
|
134
|
+
GooFitChain. To use the [GooFit] output, type from the shell:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
python -m decaylanguage -G goofit myinput.opts
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Acknowledgements
|
|
141
|
+
|
|
142
|
+
DecayLanguage is free software released under a BSD 3-Clause License.
|
|
143
|
+
It was originally developed by Henry Schreiner.
|
|
144
|
+
|
|
145
|
+
[AmpGen]: https://gitlab.cern.ch/lhcb/Gauss/tree/LHCBGAUSS-1058.AmpGenDev/Gen/AmpGen
|
|
146
|
+
[GooFit]: https://GooFit.github.io
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Copyright (c) 2018-2019, Eduardo Rodrigues and Henry Schreiner.
|
|
2
|
+
#
|
|
3
|
+
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
|
|
4
|
+
# or https://github.com/scikit-hep/decaylanguage for details.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Convenient access to the version number
|
|
8
|
+
from ._version import __version__
|
|
9
|
+
|
|
10
|
+
# Direct access to decay file parsing tools
|
|
11
|
+
from .dec import DecFileParser
|
|
12
|
+
|
|
13
|
+
# Direct access to decay chain visualization tools
|
|
14
|
+
from .decay import DecayChainViewer
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# coding: utf-8
|
|
3
|
+
# Copyright (c) 2018-2019, Eduardo Rodrigues and Henry Schreiner.
|
|
4
|
+
#
|
|
5
|
+
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
|
|
6
|
+
# or https://github.com/scikit-hep/decaylanguage for details.
|
|
3
7
|
|
|
4
8
|
from __future__ import absolute_import
|
|
5
9
|
from __future__ import division
|
|
@@ -7,11 +11,11 @@ from __future__ import print_function
|
|
|
7
11
|
|
|
8
12
|
from plumbum import cli
|
|
9
13
|
|
|
10
|
-
from decaylanguage.
|
|
14
|
+
from decaylanguage.modeling.ampgen2goofit import ampgen2goofit
|
|
11
15
|
|
|
12
16
|
|
|
13
17
|
class DecayLanguageDecay(cli.Application):
|
|
14
|
-
generator = cli.SwitchAttr('-G
|
|
18
|
+
generator = cli.SwitchAttr(['-G', '--generator'], cli.Set('goofit'), mandatory=True)
|
|
15
19
|
|
|
16
20
|
def main(self, filename):
|
|
17
21
|
if self.generator == 'goofit':
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Copyright (c) 2018-2019, Eduardo Rodrigues and Henry Schreiner.
|
|
2
|
+
#
|
|
3
|
+
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
|
|
4
|
+
# or https://github.com/scikit-hep/decaylanguage for details.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
__version__ = '0.3.0'
|
|
8
|
+
|
|
9
|
+
version = __version__
|
|
10
|
+
version_info = __version__.split('.')
|