Tree friend columns with RDataFrame

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


@eguiraud Do you have an idea?

Hi,
no idea what might cause the issue, I don’t think we have seen it before.

However, since 6.18 we fixed a couple of issues in column name resolution in RDF: could you check whether things are still broken in ROOT v6.22?

If yes, please share the file with us so we can reproduce/debug.

Cheers,
Enrico

Things are working fine in v6.22
cheers,
Bohdan

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.