Hi,
I have 2 trees, tree1 and tree2. Basically, I want to do: use selections in tree2 to get one merged tree of tree1 and tree2. So I think the right way is:
tree1->AddFriend(tree2);
TTree *newtree = tree1->CloneTree(0);
//loop entries
for () {
...
if ( selection is true )
newtree->Fill();
...
}
The problem of this approach is the merged tree: newtree only has tree1 although selection is satisfied. What I cannot understand is since I add tree2 as friend of tree1, why the merged tree is only containing tree1? How can I store tree2 with tree1 (I don’t care if tree1 and tree2 are parallel or merged in the new file)?
Cheers,
Zhiyi.