Hi,
when I add a TTree with the same branches and leafs as friend to another tree, I cannot access the leafes of the friend.
I thought the “dot” notation would help, but this example
After some further investigation, I was able to figure out that the reason for my problem seems to be the TTree. By using TTree::CloneTree, I was able to create a tree with one Branch (attached to this post), that illustrates the problem:
What I would expect would be an error message like:
Error in <TTreeFormula::Compile>: Bad numerical expression : "Tree1.xx"
Is there a switch that causes this behavior of the TTree, or is this a bug in ROOT?
Cheers, J. comp.root (4.65 KB)
There is 2 issues. Your file contains one leaf with no name (zero length name). See TTree1->GetListOfLeaves()->ls();
In addition there was a bug in the ROOT code that meant that Tree1.BadName was matching this no-name leaf. This bug has been fixed in the CVS repository.
Hi,
thank you for your answer. In the meantime, I had a look in the code which created the tree. With help of your answer, i was able to spot the line causing the trouble.
A warning message has been added to the svn trunk and the missing name are replace by __noname1, __noname2, etc (where the number is the index of the leaf in the list of leaf of the branch).