Hello,
The question is more if RDataFrame is able to resolve the correct type of the templated aggregator?
It works on a c++ level - simple example is attached test1.C (720 Bytes) as the functions have same names but different parameters, but I couldn’t get it work in RDataFrame Aggregate test2.C (1.5 KB)
(it’s supposed to run on a simple tree with two branches - int x and std::vector<int> vecypokus1.root (6.2 KB) )
//this doesn't work
//auto total1 = df.Aggregate(agg<int>,add_all,"x",all1);
//auto total2 = df.Aggregate(agg<std::vector<int>>,add_all,"y",all1);
//this works
auto total3 = df.Aggregate(aggscalar<int>,add_all,"x",all1);
auto total4 = df.Aggregate(aggvector<std::vector<int>>,add_all,"vecy",all1);
Ah that’s tricky, and the error message is horrible, sorry about that.
It’s because agg<int> and agg<std::vector<int>> are in principle ambiguous (they could both refer to both overloads) and the right overload can only be resolved when you call the function but RDF tries to figure out the signature of the function before calling it…