RooMCStudy segfault due to checkObservables

Hi All,

I am trying to do a RooMCStudy of a complex RooAddPdf, which has many dependencies. To make it simple, I have a double Crystal Ball for the peak and another Crystal Ball with the same parameters except the mu, which depends on another variable.

When I try to instantiate the RooMCStudy I find the following error messages

[#0] ERROR:InputArguments – RooAddPdf::checkObservables(kstBkgBsKstBase): ERROR: coefficient kstSignalL and PDF kstBkgBsKstGammaL have one or more dependents in common
[#0] ERROR:Generation – RooAbsGenContext::ctor: Error in PDF dependents
[#0] ERROR:InputArguments – RooAddPdf::checkObservables(kstBkgBsKstBase): ERROR: coefficient kstSignalL and PDF kstBkgBsKstGammaL have one or more dependents in common
[#0] ERROR:Generation – RooAbsGenContext::ctor: Error in PDF dependents
[#1] INFO:NumericIntegration – RooRealIntegral::init(kstBkgExpWideBase_clone_Int[B_MM]) using numeric integrator RooIntegrator1D to calculate Int(B_MM)
[#1] INFO:NumericIntegration – RooRealIntegral::init(kstBkgExpWideBase_clone_Int[B_MM]) using numeric integrator RooIntegrator1D to calculate Int(B_MM)
[#0] ERROR:InputArguments – RooAddPdf::checkObservables(kstBkgBsKstBase): ERROR: coefficient kstSignalL and PDF kstBkgBsKstGammaL have one or more dependents in common
[#0] ERROR:Generation – RooAbsGenContext::ctor: Error in PDF dependents

and then the constructor segfaults. While I understand that there is a dependence I don’t know why the generator checks it or how to solve it.
I just want to generate data following my RooAddPdf, but I’m guess I am doing something wrong… Any hints?

Thanks!
Albert

PS: It’s probably a stupid error, and prepare a working example wpuld take me some hours (my script is 1000+ lines long), so I have not yet created a minimal example in the hopes that my mistake is so stupid that somebody will notice it. If it’s not the case, please let me know what is needed to debuf this problem.

Hi,

If you construct a RooAddPdf of the following form

coef1§*Pdf1(x,p’) + coef2(p’’)*Pdf2(x,p’’’)

you cannot have any observables that are common between the coefficient functions and the
pdfs, i.e. p and p’’ cannot contain the observable x that you are generating. The error message
below indicates that that is in fact the case in your setup and it won’t work.

Wouter

NB: This factorizing assumption is used internally to perform the generation of a RooAddPdf
as a weighted sum of the component pdfs. If need be you can rewrite the RooAddPdf using
a RooGenericPdf expression, which doesn’t make such assumptions but will likely be (much) slower.