Dear Experts,
I’m sorry if this has been answered somewhere, but I haven’t been able to find it. I’m trying to implement a gaussian (luminosity) constraint in a confidence interval (frequentistCalculator). I’m puzzled as to how frequentistCalculator knows how much to vary the luminosity when it throws toys? Here’s a summary what I’m doing:
w = RooWorkspace("w","w")
# Set up constant+Gaussian S+B model
w.factory("x[0,10]")
w.factory('EXPR::bkgModel("1",x)')
w.factory('Gaussian::sigModel(x,mean[1],sigma[1])')
w.factory('SUM::model(mu[0,10]*sigModel,bkgModel)')
# Set up luminosity constraint
w.factory('Gaussian::lumiConstr(lumiObs[0,2],lumiNp[0,2],0.1)')
# Make model with constraint
w.factory('PROD::modelConstr(model,lumiConstr)')
# But how to set up the modelConfig so that it has all this information?
w.defineSet("poi","mu");
w.defineSet("nuis","lumiNp");
w.defineSet("globObs","lumiObs");
mc = ModelConfig("hypo",w)
mc.SetPdf(w.pdf("modelConstr"))
mc.SetObservables(RooArgSet(w.var("x")))
mc.SetParametersOfInterest(w.set("poi"))
mc.SetNuisanceParameters(w.set("nuis")) # do I need to do this, or is SetGlobalObservables enough?
mc.SetGlobalObservables(w.set("globObs"))
mc.SetSnapshot(w.set("poi"))
How do I provide the lumiConstr
gaussian constraint to modelConfig
? Is there the equivalent of ExternalConstraints
that works with pdf.fitTo()
? Thanks very much for any help with this.
(I’m following a procedure from these:
https://twiki.cern.ch/twiki/bin/view/RooStats/RooStatsTutorialsAugust2012#Create_Poisson_Counting_model
https://root.cern.ch/root/html/tutorials/roofit/rf604_constraints.C.html)