def add_branch_to_rootfile(filename, treename, new_branch, branch_name,
    overwrite=True):
    """Add a branch to a given ROOT-Tree.

    Add some data (*new_branch*) to the ROOT-file (*filename*) into its tree
    (*treename*) under the branch (*branch_name*)

    Parameters
    ----------
    filename : str
        The name of the file (and its path)
    treename : str
        The name of the tree to save the data in
    new_branch : array-like
        The data to add to the root-file
    branch_name : str
        The name of the branch the data will be written too. This can either be
        a new one or an already existing one, which then will be overwritten.
        No "friend" will be created.
    overwrite : boolean
        NOT IMPLEMENTED!
    """
    from raredecay.tools import data_tools
    from raredecay.globals_ import out
    root_data = {'filenames': filename, 'treename': treename}
    status = data_tools.add_to_rootfile(root_data, new_branch=new_branch,
        branch_name=branch_name, overwrite=overwrite)
    if status == 0:
        out.add_output(['Added succesfully', new_branch, 'as', branch_name,
            'to', filename], obj_separator=' ')
    elif status == 1:
        out.add_output(['Did not add', new_branch, 'as', branch_name, 'to',
            filename,
            'because it already exists and overwrite is set to false'],
            obj_separator=' ')
