Using RooSimultaneous as RooResolutionModel in RooAddModel

Dear all,
I’ve composed my resolution function with a RooSimultaneous and it fits correctly my data.
Now I want to add it with another RooResolutionModel.
The RooAddModel do it but requires a RooArgList &pdfList.

...
resolution_func_bkg = ROOT.RooSimultaneous("resolution_func_bkg", "resolution_func_bkg", is_one_track_only_res)

self.pdf_bkg_1trk = ROOT.RooAddModel("pdf_bkg_1trk", "pdf_bkg_1trk",
                                                       ROOT.RooArgList(resolution_func_bkg, self.function_pdf),
                                                       ROOT.RooArgList(f_delta_1trk))                                                       
...

I’ve tryed and this is the exception:

TypeError: none of the 3 overloaded methods succeeded. Full details:
  RooAddModel::RooAddModel(const char* name, const char* title, const RooArgList& pdfList, const RooArgList& coefList, bool ownPdfList = kFALSE) =>
    problem in C++; program state has been reset
  RooAddModel::RooAddModel() =>
    takes at most 0 arguments (4 given)
  RooAddModel::RooAddModel(const RooAddModel& other, const char* name = 0) =>
    takes at most 2 arguments (4 given)

I’ve checked and both RooSimultaneous and RooResolutionModel extend the class RooAbsPdf.
Options:

  • Is there any way to convert the RooSimultaneous into RooResolutionModel?
  • Is there any alternative for RooResolutionModels instead of RooSimultaneous? (Like RooAddModel for RooAddPdf)

Any other help is really welcome.

Hello Chiara,

I suspect that python deletes the temporary RooArgLists before C++ has a chance to properly construct the model. Please try something like

list1 = ROOT.RooArgList(resolution_func_bkg, self.function_pdf)
list2 = ROOT.RooArgList(f_delta_1trk)
self.pdf_bkg_1trk = ROOT.RooAddModel("pdf_bkg_1trk", "pdf_bkg_1trk", list1, list2)       

Regarding the RooSimultaneous question:

  • You only need a simultaneous pdf if you have something like channels that share the same observable, but they have different data. Is that the case? (I suppose it’s not, since there seems to be only a single pdf in the constructor.)
  • What is the is_one_track_only_res? A resolution function? Is it a PDF? If yes, put it in the resolution model directly.

Dear Stephan,
thank you for your answer.
I solved this issue using RooSimultaneous as last step in the model composition. It works now.
I also noticed that python deletes the temporary variables. I have been forced to create objects as instance of the class in order to avoid it. I’m wondering to re-write everything in C++…

Thanks.

Yes, just give every object a name or add them to a list etc.

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