Hi,
I am picking up my task to rewrite a code using RDataFrame after 1.5 years (Thank you Corona lock-down). I am still bumping into the issue of passing RDataFrame objects around between different routines. Please see the code below,
auto MakeDataFrame()
{
auto d = ROOT::RDataFrame(10).Define("fAap",[](){return 1;});
return d;
}
auto FilterDataFrame(ROOT::RDF::RNode &d,std::string &select)
{
auto d_cut = d.Filter(select);
return d_cut;
}
void mytest()
{
auto d1 = MakeDataFrame();
auto d2 = FilterDataFrame(d1,"fAap>0");
}
this results in the following error:
root [0] .L mytest.C
In file included from input_line_8:1:
/Users/eddyo/src/mytest.C:16:13: error: no matching function for call to 'FilterDataFrame'
auto d2 = FilterDataFrame(d1,"fAap>0");
^~~~~~~~~~~~~~~
/Users/eddyo/src/mytest.C:7:6: note: candidate function not viable: no known conversion from 'ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager, void>' to
'ROOT::RDF::RNode &' (aka 'RInterface< ::ROOT::Detail::RDF::RNodeBase, void> &') for 1st argument
auto FilterDataFrame(ROOT::RDF::RNode &d,std::string &select)
any help appreciated ,
Eddy
ROOT Version: 6.20.02
Platform: MacOSX
Compiler: -Dcxx14=ON ; Apple clang version 11.0.0