auto hsimplePath = gROOT->GetTutorialDir(); hsimplePath += "/hsimple.root"; ROOT::RDataFrame df("ntuple", hsimplePath.Data()); auto df_cut = df.Filter([](float py) { return py > 0.f; }, {"py"}) .Define("px_plus_py", [](float px, float py) { return px + py; }, {"px", "py"}); auto df_cached = df_cut.Cache({"px_plus_py", "py"}); auto df_cached_implicit = df_cut.Cache(); auto h = df_cached_implicit.Histo1D("px_plus_py"); h->DrawCopy(); gROOT->GetListOfCanvases()->Draw()