root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
https://root.cern
Other
2.64k stars 1.26k forks source link

[DF] SaveGraph output is wrong for varied Filters #10666

Open eguiraud opened 2 years ago

eguiraud commented 2 years ago

Reproducer:

import ROOT

df = ROOT.RDataFrame(1)
df2 = df.Define("x", "42").Vary("x", "ROOT::RVecI(5)", 5).Filter("x > 0")
s = df2.Sum("x")
ss = ROOT.RDF.Experimental.VariationsFor(s)
ROOT.RDF.SaveGraph(df, "graph.dot")

yields:

image

which is of course wrong.

We should instead hide the filters that are replicated for each systematic variation.

ikabadzhov commented 2 years ago

Step number 1. I just saw that the problem has nothing to do with jitted code. This is also broken:

   ROOT::RDataFrame df(1);

   auto df2 = df.Define("x", [] { return 1; })
                .Vary("x", []() { return ROOT::RVecI(3); }, {}, 3)
                .Filter([](int x) { return x > 0; }, {"x"});
   auto s = df2.Sum<int>("x");
   auto ss = ROOT::RDF::Experimental::VariationsFor(s);

   ROOT::RDF::SaveGraph(df, "res.dot");

I am taking a look now.