Python implementation of the BumpHenter algorithm used by HEP community.
Project description
pyBumpHunter
This is a python version of the BumpHunter algorithm, see arXiv:1101.0390, G. Choudalakis, designed to find localized excess (or deficit) of events in a 1D distribution.
The main BumpHunter function will scan a data distribution using variable-width window sizes and calculate the p-value of data with respect to a given background distribution in each window. The minimum p-value obtained from all windows is the local p-value. To cope with the "look-elsewhere effect" a global p-value is calculated by performing background-only pseudo-experiments.
The BumpHunter algorithm can also perform signal injection tests where more and more signal is injected in toy data until a given signal significance (global) is reached.
Content
- pyBumpHunter : The pyBumpHunter package
- example/example.py : A little example script that use pyBumpHunter
- example/example.ipynb : A little example notebook that use pyBumpHunter
- example/results : Folder containing the outputs of example script
- testing : Folder containing the testing scripts (based on pytest)
- data/data.root : Toy data used in the examples and tests
- data/gen_data.C : Code used to generate the toy data with ROOT
python dependancies
Requires python >= 3.5
pyBumpHunter depends on the following python libraries :
- numpy
- scipy
- matplotlib
pyBumpHunter wiki
Examples
The examples provided in example.py and test.ipynb require the uproot package in order to read the data from a ROOT software file.
The data provided in the example consists of three histograms: a steeply falling 'background' distribution in a [0,20] x-axis range, a 'signal' gaussian shape centered on a value of 5.5, and a 'data' distribution sampled from background and signal distributions, with a signal fraction of 0.15%. The data file is produced by running gen_data.C in ROOT.
In order to run the example script, simply type python3 example.py
in a terminal.
You can also open the example notebook with jupyter or binder.
- Bump hunting:
- Tomography scan:
- Test statistics and global p-value:
See the wiki for a detailed overview of all the features offered by pyBumpHunter.
To do list
- Run BH on 2D histograms
Authors and contributors
Louis Vaslin (main developper), Julien Donini
Thanks to Samuel Calvet for his help in cross-checking and validating pyBumpHunter against the (internal) C++ version of BumpHunter developped by the ATLAS collaboration.
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
Hashes for pyBumpHunter-0.2.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79651516fa9657f58f9fc73f796be69104131b3478474465faa957cf56016d33 |
|
MD5 | ef7eaea66a599d65e9ea2080f4eb0131 |
|
BLAKE2b-256 | 84d88cfb33831bb44b1df2aa68cb72199ac1848cf5d0a181bab6083d0b1c1658 |