Hi,
I have a root find which have 5 Tbranch and each Tbranch have soem TBranchElement. So I want to write a code to group each event based on their Tbranches. that means for entry(1):
ah, I misunderstood. How were those created? A split branch does not (AFAICS) show up in this way, as the list of branches will only be the top level created branch.
Of course, you can always filter if that naming convention that I see holds, for example:mybranches = [b for b in mytree.GetListOfBranches() if not '_' in b.GetName()]
Cheers,
Wim
Thanks wlav. I aware of that but I just wanted to see if I can do it by ROOT itself. Actually I didn’t created the tree, I am just working on that. As I said I want write a function that deals with any tree with this structure. It is possible that Branches have different name format.
even if you didn’t create the tree, it’d still be helpful to know how it was created. If the split was done automatically by ROOT (but I don’t think so), then I’m sure it can be detected when reading back. If all those branches were explicitly created, then that’s it: there’s no reason for the I/O system to know that they belong together, as that information is then only available in the name, and hence parsing the name is all that can be done.