uproot5 icon indicating copy to clipboard operation
uproot5 copied to clipboard

Take an existing TTree and add a new TBranch

Open jpivarski opened this issue 1 year ago • 0 comments

This would be a major project, but it's frequently asked for. Users want to be able to do this:

with uproot.update("existing_file.root") as file:
    assert file["existing_tree"].num_entries == len(array)
    file["existing_tree"].new_branch(array)

such that the "existing_tree" has the same number of entries but a new TBranch.

This will involve overwriting the entire TTree metadata object (or creating one with a new cycle number), but it can reuse all of the TBasket data from the previous TTree, only adding new ones.

jpivarski avatar Mar 16 '23 13:03 jpivarski