Skip to main content

Python implementation of the BumpHenter algorithm used by HEP community.

Project description

pyBumpHunter

Binder Test

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyBumpHunter-0.2.0.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

pyBumpHunter-0.2.0-py2.py3-none-any.whl (14.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pyBumpHunter-0.2.0.tar.gz.

File metadata

  • Download URL: pyBumpHunter-0.2.0.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for pyBumpHunter-0.2.0.tar.gz
Algorithm Hash digest
SHA256 756be33e58041475d793f6714c8d925bc025185efb7bda7b23c3c143e8c2ec59
MD5 63793b5b802005b8ed97cec6188cded6
BLAKE2b-256 a181e7eac859f88a14e420c0e7133874c148b7afd4395e1d6808057fd30afffd

See more details on using hashes here.

File details

Details for the file pyBumpHunter-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pyBumpHunter-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for pyBumpHunter-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1c35243cca4e6308add1752c1ce8ef37a6ce37f881de727ae4cc2e217edd3355
MD5 b65a57604a812a954b2a7524ae5bcb79
BLAKE2b-256 c58fdabdb3eaf6e74eedf5af807209f44b0a04c8035c354c3d92303cdd6ba0e9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page