Hi all,
I’m a bit new to using RDataFrame, so I was wondering if someone had some insight on how to implement this. I have a function (let’s say a simple linear polynomial) that I wish to operate on every element in a tree, and want to change the coefficients in that function to see how the result changes. But it’s not clear to me how to pass those coefficients as arguments to Define, since it only seems to accept columns.
To make it a bit more clear, say I have some function:
double polyFunc(p0, p1, x) { return p0 + p1*x; }
And I am trying to do something like this:
double par0 = 0.3;
double par1 = 5.7;
auto rdfPoly = rdf.Define(“polyn1d”, polyFunc, {par0, par1, “xVals”});
Which doesn’t work since the third argument in Define only seems to accept columns.
My goal is to have some more complicated function whose parameters I can tweak, but I’m stuck on how to do this basic thing, if it’s possible. Any feedback would be greatly appreciated!
Thanks!