Skip to content

[RF] RooDataSetHelper doesn't respect RooRealVar range #11017

@dcervenkov

Description

@dcervenkov
  • Checked for duplicates

Describe the bug

I have some data in RDataFrame, and I want to fit them using RooFit. I book a RooDataSet using the RooDataSetHelper like this

auto data_set = df.Book<double, double>(
    RooDataSetHelper("data_set", "title", RooArgSet(var1, var2)), {"var1", "var2"});

The fit is wrong because the data_set doesn't respect the limits on var1 and var2, resulting in an incorrect normalization.

The only difference in the following simplified fits is that I used

auto data_set = df.Book<double, double>(

for the first one, and

auto data_set = df.Filter("var2>2005 && var2<2020").Book<double, double>(

for the second one.

all_wrong
all_right

Expected behavior

I expected the RooDataSet to account for the RooRealVar range.

To Reproduce

  1. Get any RDataFrame
  2. Create a RooRealVar with limits narrower than the corresponding data in the RDataFrame
  3. Use RooDataSetHelper to book a RooDataSet from the RDataFrame using the RooRealVar
  4. Fit the RooRealVar of the RooDataSet
  5. The fit will be wrong unless you cut on the RDataFrame to match the limits of the RooRealVar

Setup

ROOT 6.26/04
macOS 12.4
Brew install

Additional context

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions