Skip to main content

pyBumpHunter

Scikit-HEP PyPI DOI

Test Code Coverage

Binder

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 or 2D 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 (signal injection not available in 2D yet).

Content

  • pyBumpHunter : The pyBumpHunter package
  • example : Folder containing a set of example scripts and notebooks
  • example/results : Folder containing the outputs of example scripts
  • test : 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

Dependencies

Requires Python >= 3.9.

BumpHunter 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.

Release files for pyBumpHunter 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyBumpHunter 0.5.1
File Size Uploaded
pybumphunter-0.5.1.tar.gz 2.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyBumpHunter 0.5.1
File Interpreter ABI Platform
pybumphunter-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 4.4 MB

Release files / pybumphunter-0.5.1.tar.gz

Download URL pybumphunter-0.5.1.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
3aa13130f6b8552d2025491aaa1e1a90ccceeda42079dd0d6745e83860860b89
BLAKE2b-256 checksum
How to use checksums
334e17938e615c84bb887358273a04742554749a2f337cd435f1e299ece8b6fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / pybumphunter-0.5.1-py3-none-any.whl

Download URL pybumphunter-0.5.1-py3-none-any.whl
Size 2.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4cc4b0dd97ce3b65878d35b27f963dc51e911cc99150ac36b9b1d370fff3d7bf
BLAKE2b-256 checksum
How to use checksums
5b5bb6e9899895d15819011c351fce3d36f0de72d5fc31ee1d56b2af558f9571
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page