#include #include #include // scalar fill template void agg(std::vector &a, const T &b) { std::cout << "f1" << std::endl; a.push_back(b); } // vector fill template void agg(std::vector &a, const std::vector &b) { std::cout << "f2" << " "< void aggscalar(std::vector &a, const T &b) { std::cout << "f1" << std::endl; a.push_back(b); } // vector fill template void aggvector(std::vector &a, const T &b) { std::cout << "f2" << " "< const &a) { std::cout << "The vector elements are : "; for(int i=0; i < a.size(); i++) std::cout << a.at(i) << ' '; std::cout< add_all(std::vector a, std::vector b) { std::vector c =a; c.insert(c.end(), b.begin(), b.end()); return c; } int main(int argc, char **argv) { std::vector all1; ROOT::RDataFrame df("tree1","pokus1.root"); //this doesn't work //auto total1 = df.Aggregate(agg,add_all,"x",all1); //auto total2 = df.Aggregate(agg>,add_all,"y",all1); auto total3 = df.Aggregate(aggscalar,add_all,"x",all1); auto total4 = df.Aggregate(aggvector>,add_all,"vecy",all1); //print(*total1); //print(*total2); print(*total3); print(*total4); return 0; };