Package: atlas-ftag-tools
ATLAS FTAG Python ToolsThis is a collection of Python tools for working with files produced with the FTAGntuple dumper.
The code is intended to be used alibraryfor other projects.
Please see theexample notebookfor usage.QuickstartInstallationIf you want to use this package without modification, you can install frompypiusingpip.pipinstallatlas-ftag-toolsTo additionally install the development dependencies (for formatting and linting) usepipinstallatlas-ftag-tools[dev]DevelopmentIf you plan on making changes to teh code, instead clone the repository and install the package from source in editable mode withpython-mpipinstall-e.Include development dependencies withpython-mpipinstall-e".[dev]"You can set up and run pre-commit hooks withpre-commitinstall
pre-commmitrun--all-filesTo run the tests you can use thepytestorcoveragecommand, for examplecoveragerun--sourceftag-mpytest--show-capture=stdoutRunningcoverage reportwill display the test coverage.UsagePlease see theexample notebookfor full usage.
Additional functionality is also documented below.Calculate WPsThis package contains a script to calculate tagger working points (WPs).
The script isworking_points.pyand can be run after installing this package withwps \
    --ttbar "path/to/ttbar/*.h5" \
    --tagger GN2v01 \
    --fc 0.1Both the--taggerand--fcoptions 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 thettbarWPs get the efficiencies and rejections for thezprimesample, you can add--zprime "path/to/zprime/*.h5"to the command.
Note that a default selection of $p_T > 250 ~GeV$ to jets in thezprimesample.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--rejectionoption 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--outfileoption.Seewps --helpfor more options and information.Calculate efficiency at discriminant cutThe same script can be used to calculate the efficiency and rejection values at a given discriminant cut value.
The scriptworking_points.pycan be run after intalling this package as followswps \
    --ttbar "path/to/ttbar/*.h5" \
    --tagger GN2v01 \
    --fx 0.1
    --disc_cuts 1.0 1.5The--tagger,--fx, and--outfilefollow the same procedure as in the 'Calculate WPs' script as described above.H5 UtilsCreate virtual fileThis 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 theh5py documentationfor more information on virtual datasets.The script isvds.pyand can be run after installing this package withvds <pattern> <output path>The<pattern>argument should be a quotes enclosedglob pattern, for example"dsid/path/*.h5"Seevds --helpfor more options and information.h5moveA script to move/rename datasets inside an h5file.
Useful for correcting discrepancies between group names.
Seeh5move.pyfor more info.h5splitA script to split a large h5 file into several smaller files.
Useful if output files are too large for EOS/grid storage.
Seeh5split.pyfor more info.