Splot not working on python

Hello,

I’m facing a problem to build a Splot for my fit using python3. I’m using the constructor below.

SPlot (const char *name, const char *title, RooDataSet &data, RooAbsPdf *pdf, const RooArgList &yieldsList)

And this is the error message:

none of the 5 overloaded methods succeeded. Full details:
SPlot::SPlot(const char* name, const char* title, RooDataSet& data, RooAbsPdf* pdf, const RooArgList& yieldsList, const RooArgSet& projDeps = RooArgSet(), bool useWeights = kTRUE, bool copyDataSet = kFALSE, const char* newName = “”, const RooCmdArg& fitToarg5 = RooCmdArg::none(), const RooCmdArg& fitToarg6 = RooCmdArg::none(), const RooCmdArg& fitToarg7 = RooCmdArg::none(), const RooCmdArg& fitToarg8 = RooCmdArg::none()) =>
TypeError: could not convert argument 4

The Fit before the Splot works fine. The problem appears when I add the line below.

sData = ROOT.RooStats.SPlot(“sData”,"",dataset,combinedPDF,ROOT.RooArgList(NSig,NBKG))

dataset is a RooDataSet
combinedPdf is a RooAddPdf
NSig and NBKG are RooRealVar

It seems that sPlot does not like ROOT.RooArgList(NSig,NBKG) argument. But it is working for fit.

Is it a bug or I’m doing something wrong?

Thanks!

Hi @JuanLeite,

To me it seems that the combinedPDF cannot be internally converted to type RooAbsPdf *. Can you please send us a code excerpt that reproduces the problem?

Cheers,
J.

Hello,

It’s actually complaining about argument 4 which in this case is combinedPDF, but I don’t see why if it’s a RooAddPdf (subclass of RooAbsPdf). Could you double check this?

Also, what ROOT version are you using?