Hi, I apologize if this question is answered elsewhere, I haven’t been able to find anything specific enough to help me with what I’m trying to do.
I have a number of root files that I have been chaining together and plotting; each of the files has two trees, each of which I have been able to plot successfully as you would expect.
What I would like to do is to plot a variable from one tree while placing a cut on one of the variables from the other tree.
In trying to set this up, it seemed I should make the two chains friends, so I have this syntax in my code:
ch1.AddFriend(“ch2”);
Both these chains have been declared and I can plot from them just fine. I get this error:
if I run my .C script with the semicolon off the “AddFriend” line above.
Any advice? I’m not certain that I’m using the correct syntax, but I haven’t been able to find anything more specific to help point me in the right direction. Thank you!
Hi @pcanal , I’m having the exact same problem, but in python. I have two trees that work perfectly fine by their own and when I try to add them as friends I get the error
Error in <TTreeFormula::Compile>: Bad numerical expression : "EventNumber"
as in my case I try to BuildIndex on friend tree using the EventNumber branch. How can I translate that solution to python?