Simultaneous extended fits and fitting ranges


I am trying to do an extended simultaneous multi-dimensional fit over three samples. I have read the other posts regarding simultaneous fitting with different fitting ranges defined by RooCategory and setFitRange and am following the procedure there, ie, for oneof the fitted variables;

RooRealVar epm(“epm”, “M_{#eta’} (GeV/c^{2})”, 0.9, 1.0);

RooCategory modes(“modes”,“modes”);
modes.defineType(“1”, 1);
modes.defineType(“3”, 3);
modes.defineType(“5”, 5);

epm.setRange(“fitrange_1”, 0.93, 0.985);
epm.setRange(“fitrange_3”, 0.9, 1.0);
epm.setRange(“fitrange_5”, 0.945 , 0.97);

RooFitResult *fitres1 = Sim_Charged_PDF.fitTo(*data, Extended(kTRUE), Range(“fitrange”), SplitRange(kTRUE));

The three categories are all in the RooDataSet *data.

There’s two problems; first, the setRange works but the code returns literally millions of lines saying

RooAbsRealLValue::inFitRange(epm): value 0.915723 rounded up to min limit 0.945
RooAbsRealLValue::inFitRange(epm): value 0.980469 rounded down to max limit 0.97

when all the data points in each catergory already lie within the stated ranges, and there are only of order 3000 data points. It seems to be rounding all points to all ranges regardless of category. This slows down my code ridiculously, but the fit is performed within the given ranges. Is there anything I can do to get rid of this?

The second problem is also to do with the ranges. The fits are performed over the ranges specified, but I think the normalization is calculated over the entire region. The code returns:

RooRealVar::setRange(epm) new range named ‘fitrange_3’ created with bounds [0.9,1]
RooRealVar::setRange(epm) new range named ‘fitrange_5’ created with bounds [0.945,0.97]
RooRealVar::setRange(epm) new range named ‘fitrange_1’ created with bounds [0.93,0.985]

RooRealVar::setRange(epm) new range named ‘NormalizationRange’ created with bounds [0.9,1]

Is there a way to change the normalization range in the same way as the fit range?

Thank you for any help you can give,



What version of ROOT / Roofit are you using? I did recently make some fixes concerning the inFitRange() issue.

On the normalization issue: the normalization is identical to the fit range,
i.e. the ranges you specify.

The NormalizationRange you see created is used for any RooAddPdfs you may have in your p.d.f expression,for which the interpretation of the fraction coefficients also depends on the range of the observables. If no specific range is specified in the RooAddPdf for the interpretation of the coefficients (which is the default), then the default behavior in the calculation of the likelihood is to keep the interpretation of the coefficients in the original range of the observables. This feature ensures that the interpretation of the fraction coefficient is the same regardsless of which range of the data is fit. If you don’t want this, you explicitly specify the range to be used for the interpretation of RooAddPdf coefficients by passing an addition SumCoefRange(rangeName) argument to fitTo().


Hi Wouter,

Great, thanks I’ll try the SumCoefRange().

I’m using v5.14, but i have v5.10 available as well if that would help.

Thanks again,



You should try 5.17. The SumCoefRange is relatively new feature. The InFitRange()
message should also disappear with this release. If not, please let me know.


It’s in release 5.17.04 or later, in case anyone else is looking to use this function