Model for hypotest with signal AND background uncertainties


I’m trying to use RooStats for my analysis, and some of the tutorials seem to come
tantalizingly close to what I’m doing, but I can’t seem to put the pieces together.
I’m pretty new to all this and the factory interface is a total mystery to me.

Currently I have from code I inherited:

  1. A RooHistPdf to define my signal pdf as a function of one observable, a particle mass.
  TH1* signalShape=(TH1*)(signalfile->Get(finalVarHist)->Clone("ss"));
  RooWorkspace w("myw");
  w.factory("mwr[520,2000]"); // observable is called mwr
  RooDataHist signals("signals","signals",RooArgList(*w.var("mwr")),signalShape) ;
  RooHistPdf signalPdf("sig_pdf","sig_pdf",RooArgList(*w.var("mwr")),signals);
  1. The signal yield as the sole parameter of interest
  1. Background fits to exponentials for two background processes ttbar and z+jets
  sprintf(temp,"Exponential::bkg_tt(mwr,%f)", tt_expfit_p1);  w.factory(temp);
  sprintf(temp,"Exponential::bkg_zj(mwr,%f)", zj_expfit_p1);  w.factory(temp);
  1. Background yields as nuisance parameters that have lognormal priors.
    sprintf(temp,"Lognormal::tt_xsec(tt_est[%f],tt_yield,%f)",tt_yield_mc,tt_yield_ferror); w.factory(temp);
    sprintf(temp,"Lognormal::zj_xsec(zj_est[%f],zj_yield,%f)",zj_yield_mc,zj_yield_ferror); w.factory(temp);
  1. Setting up to do the CLs method (showing the s+b model part):

  ModelConfig sb_model("S+B_model", &w); // signal+background, alternative hypothesis

(Don’t know how much further I need to show…some of what you see may be associated
with dead code, but I can’t tell for sure.)
To this picture I want to add the uncertainty to the total signal yield as a nuisance parameter.

I tried doing this with the signal yield directly but ended up with disaster.
It was suggested to me to use the signal efficiency as a nuisance parameter instead,
but once again, the workspace factory interface has me flummoxed, it all seems like magic.

Any tips, please? Thanks,
-Phil D.