qpym2.io.rdf#

Module Contents#

Functions#

read_rdf

Read a ROOT file and return the RDataFrame. Implements the branch definitions and filters.

create_rdf

Create a ROOT file with the RDataFrame. Implements the branch definitions and filters.

API#

qpym2.io.rdf.read_rdf(fname, treename, defs=[], filters=[], add_friends=[])#

Read a ROOT file and return the RDataFrame. Implements the branch definitions and filters.

Args:

fname (str): path to the ROOT file. treename (str): name of the tree. defs (list of (alias, def)): list of branch definitions. filters (list of string): list of filters. Default is None. add_friends (list of (fname, treename)): list of friend trees to be added.

If fname is None, use the same file.

Returns:

RDataFrame: the RDataFrame object.

qpym2.io.rdf.create_rdf(input_fname, input_treename, output_fname, output_treename, defs=[], filters=[], transforms=[], output_cols=[], input_add_friends=[])#

Create a ROOT file with the RDataFrame. Implements the branch definitions and filters.

Args:

input_fname (str): path to the ROOT file. input_treename (str): name of the tree. output_fname (str): path to the output ROOT file. output_treename (str): name of the output tree. defs (list of (alias, def)): list of branch definitions. filters (list of string): list of filters. output_cols (list of string): list of columns to be saved in the output

tree.

input_add_friends (list of (fname, treename)): list of friend trees to be added.

while reading the input. If fname is None, use the same file.