Hi,
My experiment has code based on RooFit framework to handle profile likelihood ratio to generate limit. I need to build a likelihood model with nuisance parameters to pass in. The snippet below is a simplified model, which contains one signal PDF, one background PDF, and one constraint function.
{
RooWorkspace* w = new RooWorkspace("w");
// observable
RooRealVar x("x","x",-10,10);
w->import(x);
w->defineSet("obs", "x");
// Parameter Of Interest
RooRealVar mu_sig("mu_sig","Signal expectation", -100., 1000.);
w->import(mu_sig);
w->defineSet("poi","mu_sig");
//Nuisance Parameters
RooRealVar mu_bkg("mu_bkg","background expectation", 0, 1000);
w->import(mu_bkg);
w->defineSet("nuis", "mu_bkg");
// signal + background model
w->factory("Gaussian::gauss_sig(x, m_sig[0], s_sig[1])");
w->factory("Gaussian::gauss_bkg(x, m_bkg[0], s_bkg[2])");
TString EventModel_str = "SUM::EventModel(mu_sig*gauss_sig, mu_bkg*gauss_bkg)";
w->factory(EventModel_str);
//constraint functions to limit the range of nuisance
w->factory("Gaussian::Constraint_bkg(mu_bkg, m_mu_bkg[10], s_mu_bkg[2])");
//w->factory("CBShape::Constraint_bkg(mu_bkg, m_mu_bkg[10], s_mu_bkg[2], alpha[2], n[5]))");
// Model with Constraint
TString TotalEventModel_str("PROD::TotalEventModel(EventModel,Constraint_bkg)");
w->factory(TotalEventModel_str);
//global observable
w->defineSet("gobs", "m_mu_bkg");
// Create Model Config
//----------------------
// SIGNAL plus BACKGROUND model
ModelConfig* SBmodel = new ModelConfig("SBmodel", w);
SBmodel->SetName("SBmodel");
SBmodel->SetPdf(*w->pdf("TotalEventModel"));
SBmodel->SetObservables(*w->set("obs"));
SBmodel->SetParametersOfInterest(*w->set("poi"));
SBmodel->SetNuisanceParameters(*w->set("nuis"));
SBmodel->SetGlobalObservables(*w->set("gobs"));
w->import(*SBmodel);
// BACKGROUND-only model
ModelConfig* Bmodel = (ModelConfig*) SBmodel->Clone();
Bmodel->SetName("Bmodel");
RooRealVar* firstPOI = (RooRealVar*) SBmodel->GetParametersOfInterest()->first();
firstPOI->setVal(0.);
Bmodel->SetSnapshot(*firstPOI);
w->import(*Bmodel);
}
Two questions:
-
When to define global observable? The example above set Gaussian mean
m_mu_bkg
as a global observable, but not the widths_mu_bkg
. I’ve also seen other examples online that only define the mean in the constraint function as global observable. Why? -
Can I use other built-in function (ex. Crystal Ball) for the constrain function instead of Gaussian? If yes, do I need to define all four parameters of Crystal Ball as the global observable? Is it sufficient to set the constraint parameters to constants (ex. use
setConstant(kTREU)
) instead of defining them as global observable?
Many Thanks,
Xin