Command Line Applications


Convert a set of ROOT files into a single pytables HDF5 file.

$ twaml-root2pytables --help
usage: twaml-root2pytables [-h] -i INPUT_FILES [INPUT_FILES ...] -n NAME -o
                           OUT_FILE [-b BRANCHES [BRANCHES ...]]
                           [--tree-name TREE_NAME] [--weight-name WEIGHT_NAME]
                           [--auxweights AUXWEIGHTS [AUXWEIGHTS ...]]
                           [--selection SELECTION] [--detect-weights]
                           [--nthreads NTHREADS]

Convert ROOT files to a pytables hdf5 dataset via and

optional arguments:
  -h, --help            show this help message and exit
                        input ROOT files
  -n NAME, --name NAME  dataset name (required when reading back into
  -o OUT_FILE, --out-file OUT_FILE
                        Output h5 file (existing file will be overwritten)
  -b BRANCHES [BRANCHES ...], --branches BRANCHES [BRANCHES ...]
                        branches to save (defaults to all)
  --tree-name TREE_NAME
                        tree name
  --weight-name WEIGHT_NAME
                        weight branch name
  --auxweights AUXWEIGHTS [AUXWEIGHTS ...]
                        extra auxiliary weights to save
  --selection SELECTION
                        A selection string or YAML file containing a map of
                        selections (see `selection` argument docs in
  --detect-weights      detect weights in the dataset, --auxweights overrides
  --nthreads NTHREADS   number of threads to use via ThreadPoolExecutor

An example that uses the default --tree-name and --weight-name, while only saving the branches b1 and b2 and requiring the branch elmu to be true and pT_lep1 to be greater than 50 to save the event.

$ twaml-root2pytables -i file.root -o file.h5 --branches b1 b2 \
      --selection "(elmu == True) & (pT_lep1 > 50)"

The docs for the function that is being called:


command line application which converts a set of ROOT files into a pytables HDF5 file via the function and the to_pytables member function of the class.