createIntegral() not working in the tutorial

Dear Experts, I was trying to use createIntegral() in one script and as it was not working I tried to run the pyroot example from the tutorials (ROOT: tutorials/roofit/rf110_normintegration.py File Reference ) and I get the same error when I try to create the integral specifying NormSet and Range.

igx_sig = gx.createIntegral(xset, NormSet=xset, Range="signal")

The error log I get with ROOT 6.24/06 is:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: none of the 6 overloaded methods succeeded. Full details:
  RooAbsReal* RooAbsReal::createIntegral(const RooArgSet& iset, const RooArgSet& nset, const RooNumIntConfig& cfg, const char* rangeName = 0) =>
    TypeError: RooAbsReal::createIntegral got an unexpected keyword argument 'NormSet'
  RooAbsReal* RooAbsReal::createIntegral(const RooArgSet& iset, const RooCmdArg& arg1, const RooCmdArg& arg2 = RooCmdArg::none(), const RooCmdArg& arg3 = RooCmdArg::none(), const RooCmdArg& arg4 = RooCmdArg::none(), const RooCmdArg& arg5 = RooCmdArg::none(), const RooCmdArg& arg6 = RooCmdArg::none(), const RooCmdArg& arg7 = RooCmdArg::none(), const RooCmdArg& arg8 = RooCmdArg::none()) =>
    TypeError: RooAbsReal::createIntegral got an unexpected keyword argument 'NormSet'
  RooAbsReal* RooAbsReal::createIntegral(const RooArgSet& iset, const RooNumIntConfig& cfg, const char* rangeName = 0) =>
    TypeError: RooAbsReal::createIntegral got an unexpected keyword argument 'NormSet'
  RooAbsReal* RooAbsReal::createIntegral(const RooArgSet& iset, const char* rangeName) =>
    TypeError: RooAbsReal::createIntegral got an unexpected keyword argument 'NormSet'
  RooAbsReal* RooAbsReal::createIntegral(const RooArgSet& iset, const RooArgSet& nset, const char* rangeName = 0) =>
    TypeError: RooAbsReal::createIntegral got an unexpected keyword argument 'NormSet'
  RooAbsReal* RooAbsReal::createIntegral(const RooArgSet& iset, const RooArgSet* nset = 0, const RooNumIntConfig* cfg = 0, const char* rangeName = 0) =>
    TypeError: RooAbsReal::createIntegral got an unexpected keyword argument 'NormSet'

The error log that i get when I run with ROOT 6.20/06 is

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: none of the 6 overloaded methods succeeded. Full details:
  keyword arguments are not yet supported
  keyword arguments are not yet supported
  keyword arguments are not yet supported
  keyword arguments are not yet supported
  keyword arguments are not yet supported
  keyword arguments are not yet supported

I dont know why are there two different errors and why I cannot manage to make it work using the same code that in the tutorial :confused:.

Thanks for your help.

Apparently the solution to this issue is writing the integral line as it follows, and forget about creating the xset =RooArgSet(x) as it is done in the C example.

igx_sig = gx.createIntegral(x, nset =x, rangeName="signal")

Maybe it should be changed in the tutorials (?)

Hi @caetano.eirea !

Sorry for replying only now! RooFit is becoming nicer and nicer, especially and also from Python. So you have to watch out that you look at a tutorial that’s matching your ROOT version. If you select “Version v6.24” instead of “master” you’ll see that the tutorial changes to ROOT: tutorials/roofit/rf110_normintegration.py File Reference - which indeed has a different call to createIntegral. Makes sense?

Axel

1 Like

Yes, I didn’t know that by changing the versions the tutorials were also different. I will be careful next time.

Thank you very much for the advise.
Caetano

No problem at all! Yes, we keep the tutorials up to date with the code. Glad that clarified it!

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