Home | News | Documentation | Download

CreateIntegral giving wrong results

I am trying to create the integral of the signal component of RooSumPdf in the Barlow-Beeston example given in root tutorials (here).

I create two ranges “window” (-20 to 20) and “window1” (-5 to 0) and the results of the signal integral are identical.

x.setRange(“window”,-20,20);
RooAbsReal * integral_sig1 = p_ph_sig1.createIntegral(RooArgSet(x), RooArgSet(x), “window”);
Double_t Asig1val = Asig1.getVal();
Double_t Asig1val_err = Asig1.getError();
Double_t integval_sig = integral_sig1->getVal();
Double_t dintegval_sig = integral_sig1->getPropagatedError(*result1, RooArgSet(x));
cout << "Asig1 : " << Asig1val << " +/- " << Asig1val_err << endl;
cout << "Signal Integral in window: " << integval_sig << " +/- " << dintegval_sig << endl;

x.setRange(“window1”,-5,0);
RooAbsReal * integral_sig2 = p_ph_sig1.createIntegral(RooArgSet(x), RooArgSet(x), “window1”);
integval_sig = integral_sig2->getVal();
dintegval_sig = integral_sig2->getPropagatedError(*result1, RooArgSet(x));
cout << "Signal Integral in window1: " << integval_sig << " +/- " << dintegval_sig << endl;

Root output:

Asig1 : 0.850507 +/- 0.235778
Signal Integral in window: 80.026 +/- 11.3836
[#1] INFO:Eval – RooRealVar::setRange(x) new range named ‘window1’ created with bounds [-5,0]
Signal Integral in window1: 80.026 +/- 11.3836

What am I doing wrong here?

Thanks.

https://root.cern/doc/v622/rf709__BarlowBeeston_8C.html

test.C (4.0 KB)

Hi @quantiser ,
this is one for @moneta I think.

Cheers,
Enrico

Hi,
The problem is in the integration of the RooParamHIstFunc class.
When computing the integral (see ROOT: roofit/roofit/src/RooParamHistFunc.cxx Source File ) the range is not considered.
I will open a github issue.

Cheers

Lorenzo

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.