Filter action in RDataFrame: JIT error on variables with similar names

Hi all,
I ran into the exception thrown by the TryToJitExpression function (https://root.cern.ch/doc/master/RDFInterfaceUtils_8cxx_source.html#l00531) when applying a filter action on variables with similar names. When using a define action to rename one of the variables, everything works fine.
I post the ouput of my script below, which illustrates the error. I hope this helps in debugging. If needed, I can make a small reproducer.

Cheers,
Marian

script without renaming variables (also note that I renamed the variable which didn’t raise the exception):

tree_trimmerRDF      INFO:    Applying Filter action: Xic_p_ProbNNp > 0.1 && ( abs(misID_DStar_M-145.4)>5.5 || (Xic_p_ProbNNpi < 0.4 && abs(KXicpXic_as_pi_M-1865.)>15) )
input_line_35:4:8: error: use of undeclared identifier 'Xic_p_ProbNNp'
return Xic_p_ProbNNp > 0.1 && ( abs(misID_DStar_M-145.4)>5.5 || (Xic_p_ProbNNpi < 0.4 && abs(KXicpXic_as_pi_M-1865.)>15) )
       ^
terminate called after throwing an instance of 'std::runtime_error'
  what():  Cannot interpret the following expression:
Xic_p_ProbNNp > 0.1 && ( abs(misID_DStar_M-145.4)>5.5 || (Xic_p_ProbNNpi < 0.4 && abs(KXicpXic_as_pi_M-1865.)>15) )

Make sure it is valid C++.
Aborted (core dumped)

script with renamed variables:

tree_trimmerRDF      DEBUG:   transforming Xic_p_ProbNNpi to a new branch: blabla
tree_trimmerRDF      INFO:    Applying Filter action: Xic_p_ProbNNp > 0.1 && ( abs(misID_DStar_M-145.4)>5.5 || (blabla < 0.4 && abs(KXicpXic_as_pi_M-1865.)>15) )
tree_trimmerRDF      INFO:   [========                                          ] (16% - ETA: 112s - 1 thread)

ROOT Version: nightlies
Platform: x86_64-slc6-gcc8-opt
Compiler: g++ (GCC) 8.2.0


Hi Marian,

thanks for reporting. It would be most useful if you could provide a simple standalone example also because we are investing in the mechanism used to identify column names in Define/Filter strings!

Cheers,
D

Hi Danilo,
The reproducer is attached.
Cheers,
Marian
df001_modified.C (887 Bytes)

@Danilo @marian that error usually means that RDF does not recognize Xic_p_ProbNNp as a TTree branch. Does it appear in the array returned by df.GetColumnNames()?

Hi @eguiraud,
yes it’s in the array. I attach the new file (i renamed Xic_p_ProbNNpi to Xic_p_ProbNNpr to test if the error was caused by the trailing i)

df001_modified.C (1000 Bytes)

Hi Marian,

thanks for creating the reproducer. There is indeed an issue recognising columns coming from trees. I do not know more at the moment but I added a bug in our tracker with a minimal reproducer: https://sft.its.cern.ch/jira/browse/ROOT-9929
We’ll keep you posted.

Cheers,
Danilo

Hi Marian,

the issue was due to branch names which were “contained” in other branch names, such as your Xic_p_ProbNNp and Xic_p_ProbNNpr.
This PR should solve the problem and is being tested by our CI on all supported platforms right now.

Cheers,
D

Hi Danilo,
Thanks a lot for the quick fix!
Cheers,
Marian

Hi Marian,

this is now in the master. Thanks again for reporting this glitch!

Cheers,
D

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