Implments the reaction plane fit for background subtraction in heavy ion collisions.
Project description
Reaction plane fit
Implements the reaction plane fit described in Phys. Rev. C 93, 044915 (or on the arxiv) to characterize and subtract background contributions to correlation functions measured in heavy ion collisions. This package implements the fit for 3 orientations relative to the reaction plane, in-plane (0<|Δφ|<π/6), mid-plane (π/6<|Δφ|<π/3), and out-of-plane (π/3<|Δφ|<π/2).
Installation
This package requires python 3.6 and above. A few prerequisites are required which unfortunately cannot be
resolved solely by pip because of the packaging details of probfit
.
$ pip install numpy cython
The package is available on pypi and is available via pip.
$ pip install --user reaction_plane_fit
This assumes installation for only the current user.
Usage
Performing a fit with this package only requires a few lines of code. Below is sufficient to define and run a fit with some sample values:
from reaction_plane_fit import three_orientations
# Define the fit object.
rp_fit = three_orientations.BackgroundFit(
resolution_parameters = {"R22": 0.6, "R42": 0.3, "R62": 0.1, "R82": 0.1},
use_log_likelihood = False,
signal_region = (0, 0.6),
background_region = (0.8, 1.2),
)
# Load or otherwise provide the relevant histograms here.
# The structure of this dictionary is important to ensure that the proper data ends up in the right place.
data = {"background": {"inPlane": ROOT.TH1.., "midPlane": ROOT.TH1..., "outOfPlane": ROOT.TH1...}}
# Perform the actual fit.
success = rp_fit.fit(data = data)
# Print the fit results
print("Fit result: {fit_result}".format(fit_result = rp_fit.fit_result))
Examples for fitting an inclusive reaction plane orientation signal alongside the background, or for fitting
only the background are both available in reaction_plane_fit.example
. This module can also be run directly
in the terminal via:
$ python -m reaction_plane_fit.example [-b] [-i dataFilename]
If fit data is not specified, it will use some sample data. For further information, including all possible fit function combinations, please see the full documentation.
Citations
Please cite the paper, as well as this implementation.
TODO: Zenodo DOI
Development
If developing the packaging, clone the repository and then install with
$ pip install -e .[dev,tests]
Note that python 3.6 and above is required because this package uses dataclasses
(which has a python 3.6
backport), and it relies on dictionaries being ordered (which is true for cpython
3.6 and is required for
python 3.7 in general).
Acknowledgments
Code started from implementation work done by M. Arratia. Thanks to C. Nattrass and J. Mazer for help and discussions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file reaction_plane_fit-0.9.tar.gz
.
File metadata
- Download URL: reaction_plane_fit-0.9.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87c31a1d1b2aa9a458e9bc8a6f01374bfab4124de062fabb584f2071e32f1bb4 |
|
MD5 | 4afd1bcfce4e1d569038bb7e7eb95e56 |
|
BLAKE2b-256 | e6933511e9ea153e80b6e5c18cc1ceeccdaf5584416d21cba7e1b2fd64869abc |
File details
Details for the file reaction_plane_fit-0.9-py2.py3-none-any.whl
.
File metadata
- Download URL: reaction_plane_fit-0.9-py2.py3-none-any.whl
- Upload date:
- Size: 33.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1191073f90dc7bedcd9287a1bd20ff566e6aded755a2534639c355089a2d234 |
|
MD5 | 5dd6bf28dd7e872fc87c8b592c6535e0 |
|
BLAKE2b-256 | 16adbc1ebb0864f4812f3d47ee4ff69ca5bb7386e2988e88284060232b6cf958 |