Skip to main content

design and steer profile likelihood fits

Project description

cabinetry logo

CI status Documentation Status Codecov PyPI version Python version Code style: black

DOI Scikit-HEP

cabinetry is a Python library for building and steering binned template fits. It is written with applications in High Energy Physics in mind. cabinetry interfaces many other powerful libraries to make it easy for an analyzer to run their statistical inference pipeline.

Statistical models in HistFactory format can be built by cabinetry from instructions in a declarative configuration. cabinetry makes heavy use of pyhf for statistical inference, and provides additional utilities to help study and disseminate fit results. This includes commonly used visualizations. Due to its modular approach, analyzers are free to use all of cabinetry's functionality or only some pieces. cabinetry can be used for inference and visualization with any pyhf-compatible model, whether it was built with cabinetry or not.

Installation

cabinetry can be installed with pip:

python -m pip install cabinetry

This will only install the minimum requirements for the core part of cabinetry. The following will install additional optional dependencies needed for ROOT file reading:

python -m pip install cabinetry[contrib]

Hello world

To run the following example, first generate the input files via the script utils/create_ntuples.py.

import cabinetry

config = cabinetry.configuration.load("config_example.yml")

# create template histograms
cabinetry.templates.build(config)

# perform histogram post-processing
cabinetry.templates.postprocess(config)

# build a workspace
ws = cabinetry.workspace.build(config)

# run a fit
model, data = cabinetry.model_utils.model_and_data(ws)
fit_results = cabinetry.fit.fit(model, data)

# visualize the post-fit model prediction and data
model_postfit = cabinetry.model_utils.prediction(model, fit_results=fit_results)
cabinetry.visualize.data_mc(model_postfit, data, config=config)

The above is an abbreviated version of an example included in example.py, which shows how to use cabinetry. It requires additional dependencies obtained with pip install cabinetry[contrib].

Documentation

Find more information in the documentation and tutorial material in the cabinetry-tutorials repository. cabinetry is also described in a paper submitted to vCHEP 2021: 10.5281/zenodo.4627037.

Acknowledgements

NSF-1836650

This work was supported by the U.S. National Science Foundation (NSF) cooperative agreement OAC-1836650 (IRIS-HEP).

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

cabinetry-0.4.1.tar.gz (99.4 kB view details)

Uploaded Source

Built Distribution

cabinetry-0.4.1-py3-none-any.whl (70.0 kB view details)

Uploaded Python 3

File details

Details for the file cabinetry-0.4.1.tar.gz.

File metadata

  • Download URL: cabinetry-0.4.1.tar.gz
  • Upload date:
  • Size: 99.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for cabinetry-0.4.1.tar.gz
Algorithm Hash digest
SHA256 88accfd0a6138e1b0c7ce0b5f44a746a53ebed8488bea02a5333846fee71f30a
MD5 117960bb09cf9bbadd1529e697778682
BLAKE2b-256 47acb17e51718ed0961fc8a91862f696c3f5c3b6440cacb58ef9e062a09831c3

See more details on using hashes here.

File details

Details for the file cabinetry-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: cabinetry-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 70.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for cabinetry-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91711f23446c3e5f0a7934df7e1176c4832a237e0efa8628b073785b3b2b061a
MD5 80d309900c91f795f873de66b360a706
BLAKE2b-256 04f008401d28414caf2b966d9615518ed35d7ba9c19dde0b1022db9ae7e8d473

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