Fitting with ranges on one variable

Hello,

Currently I am facing the problem that I want to fit a function to a data distribution using only events in side bands
for the fit. I tried to use the Range option to do that. It works nicely if I only use one range. As soon as I define a second side band and add it to the range, the fit range is ignored completely. The output by roofit reveals the problem.

[#1] INFO:Eval -- RooRealVar::setRange(x) new range named 'low' created with bounds [0,4] [#1] INFO:Eval -- RooRealVar::setRange(x) new range named 'high' created with bounds [6,10] [#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(nll_function_functionData_low) constructing test statistic for sub-range named low [#1] INFO:Eval -- RooRealVar::setRange(x) new range named 'NormalizationRangeForlow' created with bounds [0,10] [#1] INFO:Eval -- RooRealVar::setRange(x) new range named 'fit_nll_function_functionData_low' created with bounds [0,4] [#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(nll_function_functionData_low) fixing interpretation of coefficients of any RooAddPdf to full domain of observables [#1] INFO:Fitting -- RooAbsOptTestStatistic::ctor(nll_function_functionData_ high) constructing test statistic for sub-range named high [#1] INFO:Eval -- RooRealVar::setRange(x) new range named 'NormalizationRangeFor high' created with bounds [0,10] [#1] INFO:Eval -- RooRealVar::setRange(x) new range named 'fit_nll_function_functionData_ high' created with bounds [0,10]

It seems the lower bound gets constructed correctly, while the second range leads to the extension of the fitting range to 0, 10.
I attached a very simple script which should illustrate the problem.

Cheers,

Tobias
FitRangeTest.py (635 Bytes)

1 Like