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");
// Parameter Of Interest
RooRealVar mu_sig("mu_sig","Signal expectation", -100., 1000.);
RooRealVar mu_bkg("mu_bkg","background expectation", 0, 1000);
// signal + background model
w->factory("Gaussian::gauss_sig(x, m_sig, s_sig)");
w->factory("Gaussian::gauss_bkg(x, m_bkg, s_bkg)");
TString EventModel_str = "SUM::EventModel(mu_sig*gauss_sig, mu_bkg*gauss_bkg)";
//constraint functions to limit the range of nuisance
w->factory("Gaussian::Constraint_bkg(mu_bkg, m_mu_bkg, s_mu_bkg)");
//w->factory("CBShape::Constraint_bkg(mu_bkg, m_mu_bkg, s_mu_bkg, alpha, n))");
// Model with Constraint
// Create Model Config
// SIGNAL plus BACKGROUND model
ModelConfig* SBmodel = new ModelConfig("SBmodel", w);
// BACKGROUND-only model
ModelConfig* Bmodel = (ModelConfig*) SBmodel->Clone();
RooRealVar* firstPOI = (RooRealVar*) SBmodel->GetParametersOfInterest()->first();
When to define global observable? The example above set Gaussian mean m_mu_bkg as a global observable, but not the width s_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?
Has lumi as a “global observable”, that’s the observable that someone else measured for you. Think e.g. that the luminosity parameter should be close to 10 / fb, so you introduce the “observable” lumi, and you add a luminosity parameter, which you want to constrain to be close to 10. So you set the Gaussian to:
Gauss(10 | paramLumi, 1)
to get a 10% uncertainty for the luminosity parameter, centred around the external measurement of 10 that you got from the lumi group of your experiment.
Some people interchange the role of x and mu in the gaussian distribution, but that doesn’t matter because it’s symmetric. Sigma on the other hand is a parameter of the constraint term, it cannot be an observable. An observable is something that you can measure.
Note that only the thing that has the role of x in the crystal ball is an observable. The parameters are parameters. And yes, most of the time you will set all parameters of the constraint term constant, because they should not be fitted. Only the parameter that is shared between the fit likelihood and the constraint likelihood will be floating in the fit.
Thanks for the reply. You mentioned “Some people interchange the role of x and mu in the gaussian distribution”. Was it a matter of interpretation? For instance, the someone else may claim the luminosity parameter is an expected value from a simulation, and lumi is the one that actually has impact on an experimental outcome. In this case, we would have lumi in the fit likelihood and paramLumi becomes global observable:
FitLikelihood(observable | paramA, paramB, lumi)
In the case of an asymmetric constraint function, it does matter which interpretation it is, right?
Another question. The shared parameters between fit likelihood and constraint likelihood are the nuisance parameters. In your example, paramLumi is the nuisance parameter, right? How does RooFit knows what to float? Does it float all parameters labeled as nuisance?
Yes, in my opinion a parameter of the fit likelihood should also be a parameter of the constraint likelihood. The “observed” value (the official lumi measurement of your experiment) then has the role of the global observable. In the Gaussian distribution there is no difference if you interchange the two, but you are right that it matters for other constraint functions.
Just read the constraint likelihood as “How likely is it that the luminosity is at the value lumi_par if we measured lumi_obs before”:
Gauss(lumi_obs | lumi_par, sigma)
RooFit floats all variables that are not constant, and not in the dataset (because these are observables).