Calculating Asymmetry w/ RooSimWSTool

I’m upgrading some code to use RooSimWSTool rather than RooSimPdfBuilder, as W. Verkerke recommends. I need to do the equivalent of what is described in this thread:
[url]Calculating an Asymmetry using RooSimPdfBuilder - #2 by cschill
Briefly, I am performing a simultaneous fit where one of the fit parameters that must be be split is actually a RooFormulaVar:

RooFormulaVar Nsig_p("Nsig_p",...,RooArgList(*acp,*Nsig))

where really Nsig will be the RooRealVar that must be split while acp must not be split. W. Verkerke’s recommendation in this thread from 2010 (when RooSimPdfBuilder was preferred) was

I understand this solution would look something like willpv’s code in [url]Problem Adding Specializations to RooSimultaneous i.e.

RooRealVar Nsig_0("Nsig_0",...);
RooFormulaVar Nsig_p_0("Nsig_p_0",...,RooArgList(*acp,*Nsig_0))
...
RooArgSet specials(Nsig_p_0,...);

(I am not certain whether Nsig_0, etc. must be included in this RooArgSet, but willpv does not and W. Verkerke seems OK with this).

Is this solution still the way to do this using RooSimWSTool? If it is, what is the equivalent of addSpecializations() method for RooSimWSTool?

Thanks,
Jack W.

I have the same question

Hi manlara,

I’d forgotten I asked this question last year. Since then, I think I’ve figured it out. All that I would have needed to do to is add Nsig, but not acp, as one of the variables to be split in RooSimWSTool. I’m no longer working on what I was back then, but as I write this I’m working with a similar simultaneous pdf created with RoSimWSTool. The basic model involves two gaussians, one with a floating mean “mean” and the other with a mean “mean2” which is a RooFormulaVar equal to the sum of “mean” and a positive RooRealVar “mean_diff”. In RooSimWSTool, I split “mean and mean_diff”. RooSimWSTool then knows how to split the RooFormulaVar “mean2” for each state of the splitting category. I see output like

in the RooFit output.