Skip to main content

Code style: black PyPI version codecov

ATLAS FTAG Python Tools

This is a collection of Python tools for working with files produced with the FTAG ntuple dumper. The code is intended to be used a library for other projects. Please see the example notebook for usage.

Quickstart

Installation

If you want to use this package without modification, you can install from pypi using pip.

pip install atlas-ftag-tools

To additionally install the development dependencies (for formatting and linting) use

pip install atlas-ftag-tools[dev]

Development

If you plan on making changes to teh code, instead clone the repository and install the package from source in editable mode with

python -m pip install -e .

Include development dependencies with

python -m pip install -e ".[dev]"

You can set up and run pre-commit hooks with

pre-commit install
pre-commmit run --all-files

To run the tests you can use the pytest or coverage command, for example

coverage run --source ftag -m pytest --show-capture=stdout

Running coverage report will display the test coverage.

Usage

Please see the example notebook for full usage. Additional functionality is also documented below.

Calculate WPs

This package contains a script to calculate tagger working points (WPs). The script is working_points.py and can be run after installing this package with

wps \
    --ttbar "path/to/ttbar/*.h5" \
    --tagger GN2v01 \
    --fc 0.1

Both the --tagger and --fc options accept a list if you want to get the WPs for multiple taggers. If you are doing c-tagging or xbb-tagging, dedicated fx arguments are available ()you can find them all with -h.

If you want to use the ttbar WPs get the efficiencies and rejections for the zprime sample, you can add --zprime "path/to/zprime/*.h5" to the command. Note that a default selection of $p_T > 250 ~GeV$ to jets in the zprime sample.

If instead of defining the working points for a series of signal efficiencies, you wish to calculate a WP corresponding to a specific background rejection, the --rejection option can be given along with the desired background.

By default the working points are printed to the terminal, but you can save the results to a YAML file with the --outfile option.

See wps --help for more options and information.

Calculate efficiency at discriminant cut

The same script can be used to calculate the efficiency and rejection values at a given discriminant cut value. The script working_points.py can be run after intalling this package as follows

wps \
    --ttbar "path/to/ttbar/*.h5" \
    --tagger GN2v01 \
    --fx 0.1
    --disc_cuts 1.0 1.5

The --tagger, --fx, and --outfile follow the same procedure as in the 'Calculate WPs' script as described above.

H5 Utils

Create virtual file

This package contains a script to easily merge a set of H5 files. A virtual file is a fast and lightweight way to wrap a set of files. See the h5py documentation for more information on virtual datasets.

The script is vds.py and can be run after installing this package with

vds <pattern> <output path>

The <pattern> argument should be a quotes enclosed glob pattern, for example "dsid/path/*.h5"

See vds --help for more options and information.

h5move

A script to move/rename datasets inside an h5file. Useful for correcting discrepancies between group names. See h5move.py for more info.

h5split

A script to split a large h5 file into several smaller files. Useful if output files are too large for EOS/grid storage. See h5split.py for more info.

Download files

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

Source Distribution

atlas_ftag_tools-0.2.9.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atlas_ftag_tools-0.2.9-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

Details for the file atlas_ftag_tools-0.2.9.tar.gz.

File metadata

  • Download URL: atlas_ftag_tools-0.2.9.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for atlas_ftag_tools-0.2.9.tar.gz
Algorithm Hash digest
SHA256 4026c5085ae47b930ad82e01a197364ea2d2efb2904dee7ba12f713d4e9f91d8
MD5 e0abe99942ae8671905700421d35695c
BLAKE2b-256 624c264ca827521957bc26303ada16669001d0a80251f14fdc1309874d6023c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for atlas_ftag_tools-0.2.9.tar.gz:

Publisher: testing.yml on umami-hep/atlas-ftag-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atlas_ftag_tools-0.2.9-py3-none-any.whl.

File metadata

File hashes

Hashes for atlas_ftag_tools-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 55e4f8327085b2c3232409149726fba4e440ac32efed406b00bb1b07678497df
MD5 f187db954a4d3d14f97231730e687544
BLAKE2b-256 97ebb0cf4cf7769198b0ae2980b1ace769d71c01c7213ce09d88a69c53907907

See more details on using hashes here.

Provenance

The following attestation bundles were made for atlas_ftag_tools-0.2.9-py3-none-any.whl:

Publisher: testing.yml on umami-hep/atlas-ftag-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page