Skip to content

Take an existing TTree and add a new TBranch #862

@jpivarski

Description

@jpivarski

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions