Skip to content

[RDF] When combining a JIT-ted Vary and Define, the varied values are missing in a Snapshot #20506

@hageboeck

Description

@hageboeck

Check duplicate issues.

  • Checked for duplicates

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

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions