Suppose I have two TTrees who are friends to each other. I want to make some selection using variables in both the friends. But how can I make the TTrees after the selection also friends to each other? I tried something like:
But sel_tree and sel_friendtree now have different orders of entries. How can I link them as friends? Alternatively, is there a way to merge them after the selection that doesn’t require setting all the branch names by hand?
[quote]Alternatively, is there a way to merge them after the selection that doesn’t require setting all the branch names by hand?[/quote]Not at the moment.
[quote]But sel_tree and sel_friendtree now have different orders of entries. [/quote]Why? The cut should be selecting the same entries in both cases …
Thanks for the answer. I realized what happened was that, after selection, sel_tree still sees the original friendtree as its friend. Even if I add sel_friendtree as sel_tree’s friend, sel_tree is always displaying entries from the original friendtree. So I solved my problem by using RemoveFriend(friendtree) before I do AddFriend(sel_friendtree).