Editing Parameter of Interests in Roofit workspace

Hello, I’m trying to reparameterize the POIs of a fit (mu_SemileptonicVBSMer,mu_SemileptonicVBSRes) in my workspace using factory:

	auto ws = static_cast<RooWorkspace*>(f->Get("combined"));
	auto mc = static_cast<RooStats::ModelConfig*>(ws->obj("ModelConfig"));
	auto simPdf = ws->pdf("simPdf");
	ws->factory("EDIT::simPdf_c(simPdf, mu_SemileptonicVBSRes=expr('(518.03*murestruth + 85.5*mumertruth + 447.62*murestruth)/1051.15', murestruth[1,-10,10], mumertruth[1,-10,10]), mu_SemileptonicVBSMer=expr('(18.09*murestruth + 412.67*mumertruth + 205.39*mumertruth)/636.15', murestruth, mumertruth))");
	auto simPdf_c = ws->pdf("simPdf_c");
	ws->writeToFile(wsfilename, false);

This sets the POIs as linear combination of new variables murestruth, mumertruth.

My issue is that when I open the workspace and ask for the parameter dependence, I get:


while they should contain the variables in the expression. But when I explicitly set the value of murestruth or mumertruth and get the pdf value, this value is changed, so something happens in the pdf, but the reparameterized POIs can’t be fitted.

I tried different syntaxes in the EDIT part (setting expr names, using @0 and @1 to call arguments) but this does not work either.

Does someone have an idea about what’s going wrong ?


Dear @Mathieum ,

I think @jonas may be able to help you.


Hi @Mathieum,

My issue is that when I open the workspace and ask for the parameter dependence, I get:

What do you mean by “asking for parameter dependence”?

I’m afraid the problem is that when you create the new pdf with EDIT, you are creating some mathematical object that RooFit doesn’t support.

If you mix parameters in the same channel of the RooSimultaneous, this could be not supported. Component coefficients of a RooAddPdf need to be completely independent in RooFit, for example. In that case, you have to do your fit before the reparametrization and then get the reparametrized variables later manually.

In other cases, for example if if the mu_SemileptonicVBSRes and mu_SemileptonicVBSMer parameters are affecting separate channels though, it should work in principle. In that case, I should follow up finding the problem.

So as a first step, can you share your full code, so we can see how the model actually looks like?

Hi @jonas, @vpadulan, thanks for your answers !

By this, I meant that after building the workspace, I did f.combined.obj("mu_SemileptonicVBSMer").Print("v") and f.combined.obj("mumertruth").Print("v"), returning no ‘servers’. I also checked the pdf variables and mumertruth and murestruth appear.

My analysis is a bit complex, I have several regions on which I define the 2 POIs (one for each category of regions)

addPOI("mu_SemileptonicVBSRes", {"Signals", {{P::nJet, 2}} }    , 1, -1, 3);
addPOI("mu_SemileptonicVBSMer", {"Signals", {{P::nFatJet, 1}} } , 1, -1, 3);

and after building the workspace I run a postprocessing code (the one I sent) to redefine the POIs as expressions depending on the murestruth and mumertruth parameters.

I can provide you a simplified workspace without systematics if you want to take a look, but since I’m a new user I can’t post it here…


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.