Problem Adding Specializations to RooSimultaneous

Dear All,

I am attempting to modify a simultaneous fit model defined through
RooSimPdfBuilder using the addSpecializations feature. However, when
running I encounter the following error:

[#1] INFO:ObjectHandling – RooSimPdfBuilder::buildPdf: Customizing physics model model for mode {08T0}
[#0] ERROR:ObjectHandling – RooArgSet::::addOwned: can only add to an owned list
…error line repeated multiple times

Is there a modification I need to make to my model in order to avoid this problem?
The variables causing the problem are defined and added to the model as follows:

RooRealVar frac_nsig_08T1(“frac_nsig_08T1”,“frac_nsig_08T1”,0.0972);
RooRealVar frac_nsig_08T2(“frac_nsig_08T2”,“frac_nsig_08T2”,0.1133);
RooRealVar frac_nsig_08T3(“frac_nsig_08T3”,“frac_nsig_08T3”,0.1587);
RooRealVar frac_nsig_08T4(“frac_nsig_08T4”,“frac_nsig_08T4”,0.1319);
RooRealVar frac_nsig_08T5(“frac_nsig_08T5”,“frac_nsig_08T5”,0.1680);
RooRealVar frac_nsig_08T6(“frac_nsig_08T6”,“frac_nsig_08T6”,0.1058);

RooFormulaVar nsig_08T0(“nsig_08T0”,“nsig_08T0”,"(1.0-@0-@1-@2-@3-@4-@5)(@6)",RooArgList(frac_nsig_08T1,frac_nsig_08T2,frac_nsig_08T3,frac_nsig_08T4,frac_nsig_08T5,frac_nsig_08T6,nsig));
RooFormulaVar nsig_08T1(“nsig_08T1”,“nsig_08T1”,"@0
RooFormulaVar nsig_08T2(“nsig_08T2”,“nsig_08T2”,"@0*@1",RooArgList(frac_nsig_08T2,nsig));
RooFormulaVar nsig_08T3(“nsig_08T3”,“nsig_08T3”,"@0*@1",RooArgList(frac_nsig_08T3,nsig));
RooFormulaVar nsig_08T4(“nsig_08T4”,“nsig_08T4”,"@0*@1",RooArgList(frac_nsig_08T4,nsig));
RooFormulaVar nsig_08T5(“nsig_08T5”,“nsig_08T5”,"@0*@1",RooArgList(frac_nsig_08T5,nsig));
RooFormulaVar nsig_08T6(“nsig_08T6”,“nsig_08T6”,"@0*@1",RooArgList(frac_nsig_08T6,nsig));

RooArgSet specials(nsig_08T0,nsig_08T1,nsig_08T2,nsig_08T3,nsig_08T4,nsig_08T5,nsig_08T6);

RooSimPdfBuilder builder(model);
RooArgSet* config = builder.createProtoBuildConfig();
RooSimultaneous* simPdf = builder.buildPdf(*config,obs);

I am running in ROOT 5.26 with RooFit 3.12.
Any advice greatly appreciated



Hi Will,

It looks like I have accidentally broken this functionality of RooSimPdfBuilder when modifying ownership aspects in RooCustomizer to fix a memory leak.

What I concretely advise you is to use the new RooSimWSTool instead which operates on the RooWorkspace class that owns all contents.

For a quick introduction to workspaces see tutorial macro rf509. The functioning of RooSimWSTools
is shown in macro rf513. To migrate to these tools you should

  1. Create a blank workspace
  2. Import all your prototype pdfs in it (using RooWorkspace::import()
  3. Import all your specializations in it
  4. Call RooSimWSTool through the factory interface (as shown in rf513), or create an instance
    of it yourself that attaches to the workspace and call build() yourself


Thanks Wouter, I have now upgraded and things seem to be running correctly.