Hi,
If the variable you want to use in the c++ function comes from python, some trickery is required, see the example code here: RDataFrame: Defining new column evaluated as a function of external values in Python
Basically you want to let the C++ interpreter know the value of the python function with TPython::Eval.
We know this is not optimal. Experimental PyROOT allows passing python functions to RDF, but it’s only worth it performance-wise for simple python lambdas.
Cheers,
Enrico