Hi,
I am trying to do calculation with a friend tree variables in RDataFrame. But sometimes it works, sometimes it doesn’t!
Here is example code representing the problem:
ch = ROOT.TChain("tree1")
ch.Add("file.root")
ch2 = ROOT.TChain("tree2")
ch2.Add("file.root")
ch.AddFriend(ch2, "t2")
df = ROOT.RDataFrame(ch)
df2 = df.Define("col1", "sqrt(t2.px*t2.px + t2.py*t2.py + t2.pz*t2.pz)")\
.Define("col2", "abs(t2.phi1 - t2.phi2)")
It yields an error:
input_line_61:2:36: error: use of undeclared identifier '__rdf_arg_t2_phi2'
or if I use it in the function: Define("col2", "func(t2.phi1, t2.phi2)")
Error: input_line_66:7:199: error: use of undeclared identifier 't2'
Any idea why this can happen?
cheers
EDIT: I noticed this occured with python 2.7
same code with python 3.7 worked properly
ROOT Version: 6.18
Platform: Centos 7
Compiler: gcc 8.2