// ## Preparation // A simple helper function to fill a test tree: this makes the example // stand-alone. void fill_tree(const char *treeName, const char *fileName) { ROOT::RDataFrame d(10); int i(0); d.Define("Xic_p_ProbNNp", [&i]() { return (double)i; }) .Define("Xic_p_ProbNNpr", [&i]() { auto j = i * i; ++i; return j; }) .Snapshot(treeName, fileName); } int df001_modified() { // We prepare an input tree to run on auto fileName = "df001_introduction.root"; auto treeName = "myTree"; fill_tree(treeName, fileName); ROOT::RDataFrame d(treeName, fileName, {"Xic_p_ProbNNp","Xic_p_ProbNNpr"}); const auto cns = d.GetColumnNames(); for(const auto& cn : cns) std::cout << cn.data() << std::endl; auto entries2 = d.Filter("Xic_p_ProbNNp < 5. && Xic_p_ProbNNpr < 5.").Count(); std::cout << *entries2 << " entries passed the string filter" << std::endl; return 0; }