Skip to main content

Library for calibrating flavour tagging algorithms at LHCb

Project description

lhcb_ftcalib

pipeline status

LHCb Flavour Tagging calibration software

At high-energy proton-proton collider experiments, the production flavour of neutral B mesons needs to be reconstructed from particle charges from hadronisation processes in the associated event, i.e. from additional hadronisations on the signal meson side, as well as hadronisation and decays of the partner B hadron. This is commonly done with ML techniques like (recurrent) neural networks or boosted decision trees. The mistag probability estimates of these models (probability that predicted production flavour is wrong) usually need to have the property of probabilities. This calibration tool optimizes a GLM function to predict the mistag probabilities and takes into account the fact that neutral mesons can undergo oscillation before they decay. In addition, it provides helper functions to measure the performance and correlations of these models.

Documentation: Read the Docs

Installation

pip install lhcb_ftcalib

Command Line Interface Examples

Run ftcalib --help for a list of all options or read the docs

1. Calibrating opposite side taggers in a sample and saving result

ftcalib file:tree -OS VtxCh Charm OSElectronLatest OSMuonLatest OSKaonLatest \
        -mode Bd -tau B_tau -id B_ID -op calibrate -out output

2. Calibrating both tagging sides, combining them inidividually, and calibrating+saving the results

ftcalib file:tree -OS VtxCh Charm OSElectronLatest OSMuonLatest OSKaonLatest \
        -SS SSPion SSProton \
        -mode Bd -tau B_tau -id B_ID -op calibrate combine calibrate -out output

Note: The command line interface is by design not feature complete. Use the API to fine tune the calibration settings.

Requirements

  • uproot >= 4
  • iminuit >= 2.3.0
  • pandas < 1.5
  • numpy <= 1.21
  • scipy
  • matplotlib
  • numba == 0.53.1

For developers

Testing multiple python versions via tox

Click to expand

To test lhcb_ftcalib in different python environments, interpreters for each version need to be installed. Multiple python versions can be installed with pyenv:

CC=clang pyenv install 3.6.15
pyenv install 3.7.13
pyenv install 3.8.13
pyenv install 3.9.13
pyenv install 3.10.5

Whereby only missing versions need to be installed! Note that python 3.6 has issues with pip throwing segfaults if not built with clang. To make the newly installed versions globally available run

pyenv global 3.6.15 3.7.13 3.8.13 3.9.13 3.10.5

and add $HOME/.pyenv/shims to your PATH. To run the basic tests, execute

tox

in the lhcb_ftcalib directory

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

lhcb_ftcalib-1.3.4.tar.gz (123.0 kB view details)

Uploaded Source

Built Distribution

lhcb_ftcalib-1.3.4-py3-none-any.whl (70.8 kB view details)

Uploaded Python 3

File details

Details for the file lhcb_ftcalib-1.3.4.tar.gz.

File metadata

  • Download URL: lhcb_ftcalib-1.3.4.tar.gz
  • Upload date:
  • Size: 123.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for lhcb_ftcalib-1.3.4.tar.gz
Algorithm Hash digest
SHA256 9e17dc8722088406b91512942dc656331827d257afbadc4004fc8fc5a2d1ef74
MD5 f8c7e97013cc10c6924b6290d2c5cee1
BLAKE2b-256 d700c1f2a02f21b5de7855fb5180be6d4dd733e1b003c35b5b18023e782caab1

See more details on using hashes here.

File details

Details for the file lhcb_ftcalib-1.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for lhcb_ftcalib-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 38b4607fa77319caf2f28d02bd202bcd2bc48822e4f3df0d39db7fd173a86ff4
MD5 fc3d7a03caac55cc9eafc59d5ea00fc2
BLAKE2b-256 c2749638ad234c395c433943a5d13ab4d5df8a72df47d84453fff0812bd63e31

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