Hello,
I set up a test model consisting of a set of category-specific models wrapped in a RooSimultaneous, with an additional constraint term for a global observable. Here’s the setup code:
[code]RooWorkspace* w = new RooWorkspace(“w”,“w”);
w->factory(“dummy_cat[eemm,eeee,mmmm]”); //dummy channel identifier
w->factory(“dummy_obs[0,1]”); //dummy obs for single-bin pdf
w->factory(“myWeight[0.1,0,100]”); //the event weight in the dataset
w->defineSet(“obs”,“dummy_obs,dummy_cat,myWeight”);
RooDataSet data(“data”,“data”,*w->set(“obs”),“myWeight”);
w->cat(“dummy_cat”)->setIndex(0); //sets to eemm
w->var(“dummy_obs”)->setVal(0.5);
w->var(“myWeight”)->setVal(0.1);
data.add(*w->set(“obs”),0.5);
w->cat(“dummy_cat”)->setIndex(1);
data.add(*w->set(“obs”),0.5);
w->cat(“dummy_cat”)->setIndex(2);
data.add(*w->set(“obs”),0.5);
w->import(data);
w->factory(“dummy_alpha[1,-5,5]”);
w->factory(“dummy_alpha_nom[1]”); //global observable
w->factory(“binwidth1[1]”);
w->factory(“poi[1,0,10]”);
w->factory(“PROD::model(Gaussian::dummy_alpha_constraint(dummy_alpha_nom,dummy_alpha,1),
SIMUL::simPdf(dummy_cat,eemm=ASUM::eemm_model(binwidth1expr::N_eemm('10poidummy_alpha(dummy_obs>0)’,poi,dummy_alpha,dummy_obs)),
eeee=ASUM::eeee_model(binwidth1expr::N_eeee('5poidummy_alpha(dummy_obs>0)’,poi,dummy_alpha,dummy_obs)),
mmmm=ASUM::mmmm_model(binwidth1expr::N_mmmm('4poidummy_alpha(dummy_obs>0)’,poi,dummy_alpha,dummy_obs)) ))”);
[/code]
If I then call:
This gives me the expected answer of ~10 (i.e the value of the N_eemm). However, if instead I do:
And then do the above called to expectedEvents, I end up with ~30. It isn’t clear to me why making the NLL function object would cause the model’s expected event count to change, especially to something that seems wrong.
Can someone explain this behaviour to me? Thanks!
Will