Check duplicate issues.
Description
When an expression like df.Vary("x").Define("y", "... x") is defined with strings, the resulting Define will only acquire variations when the computation graph is JITted and variations are created explicitly. RActionSnapshot wasn't doing this in the right place, so the columns were treated as if they were not affected by variations.
This means that the varied columns were missing from the output dataset, and during the RDF execution, the values of the nominal columns were used.
Reproducer
See below, based on a submission by @sscruz :
#20320 (comment)
ROOT::RDataFrame rdf(10);
auto df = rdf.Define("Muon_pt", "ROOT::RVec<float>(1, 1.)");
df = df.Vary("Muon_pt", "ROOT::VecOps::RVec<ROOT::VecOps::RVec<float>>({Muon_pt*0.5, Muon_pt*2})", {"down", "up"}, "muon_unc");
df = df.Define("Muon_2pt", "2*Muon_pt");
ROOT::RDF::RSnapshotOptions opts;
opts.fIncludeVariations = true;
auto snapshot = df.Snapshot("Events", fileName, {"Muon_pt", "Muon_2pt"}, opts); // Muon_2pt variations are missing
ROOT version
v6.38 / master
Installation method
--
Operating system
--
Additional context
No response