Skip to content

Convert btagging optimization ntuples into HDF5 files

Notifications You must be signed in to change notification settings

benedikt-voelkel/btag2hdf5

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Optimization Framework To HDF5 Converter

This converts ROOT files from the b-tagging optimization framework into HDF5 files for use with DL1 / IPRNN / whatever algorithm.

Setup

Assuming you have CVMFS, you can run the following to set up for the first time:

git clone git@github.com:dguest/btag2hdf5.git
cd btag2hdf5
. setup.sh
make

After building all the libraries should be permanently linked to CVMFS (thanks to some -rpath magic). There should be no need to run the setup script next time you log in.

If you don't have CVMFS

You'll need the following:

  • ROOT: use master branch for 6, root5 branch for version 5
  • boost: for program_options
  • HDF5: with the C++ bindings installed

Running

The executables will be built as ./bin/btag-*. For more "standard" b-taggers, you can use btag-write-track-jets. For studies with fat jets, there's also btag-write-fat-jets. Note that this is more experimental.

Note On Selection

There is some standard pt, eta, and JVT selection applied to jets. For details look in src/select_jet.cxx.

How to read the output

The output files should be easy to read with h5py:

from h5py import File

file = File('the-output.h5') # <- load file
jets = file['jets']          # <- get jets dataset

# you can read in slices
slice = jets[:1000]          # <- get the first thousand jets

# or select variables
pt = jets['pt']              # <- select the pt array

This step doesn't depend on ROOT, so it should be easy to install everything you need via pip.

About

Convert btagging optimization ntuples into HDF5 files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 92.9%
  • Makefile 6.3%
  • Shell 0.8%