Combining Channels with Unbinned EML fits for Upper Limits

Hello Lorenzo,

It sounds like your suggestion is to parameterize my fit in terms of the branching ratio and then apply the RooStats calculators. My question is then how one should go about doing that in an extended likelihood fit. I followed rf202_extendedmlfit.C in my code; the relevant section of my actual code is as follows:

	//Make model for fitting
	//Polynomial background 
	RooRealVar c1("c1", "c1", c1_poly, c1_poly_min, c1_poly_max);
	RooRealVar c2("c2", "c2", c2_poly, c2_poly_min,	c2_poly_max);
	RooRealVar c3("c3", "c3", c3_poly, c3_poly_min,	c3_poly_max);
	RooPolynomial bkg("bkg", "bkg", e_cm, RooArgList(c1, c2, c3));
	
	//Gaussian signal parameters
	RooRealVar m_G("mean_G", "mean_G", mean_G, mean_G_min, mean_G_max);
	RooRealVar s_G("sigma_G", "sigma_G", sigma_G, sigma_G_min, sigma_G_max);
	RooGaussian gauss("gauss", "Generic Gaussian Fit", e_cm, m_G, s_G);
	
	//Lock in constants
	m_G.setVal(mean_G);
	c1.setVal(-0.79884);
	c2.setVal(0.2355);
	c3.setVal(-0.024309);
	
	//Combine signal and background
	RooRealVar nsig("nsig","signal fraction",seed_sig_evts, min_sig_evts, max_sig_evts); 
	RooRealVar nbkg("nbkg","background fraction",seed_bkg_evts,min_bkg_evts,max_bkg_evts);
	RooAddPdf model("model","model",RooArgList(gauss,bkg),RooArgList(nsig,nbkg));
	
	//Fit model to data and check output
	RooFitResult* fitres = model.fitTo(data, Extended(kTRUE), Save()); //used with nsig

So it seems that I would need to make nsig a function of the branching ratio and known quantities like the reconstruction efficiency and initial number of events. Is that the case; would my code change to look like the following?

RooRealVar nsig("nsig","signal fraction",seed_sig_evts, min_sig_evts, max_sig_evts); 
RooRealVar nbkg("nbkg","background fraction",seed_bkg_evts,min_bkg_evts,max_bkg_evts);

//Transform between nsig and other parameters goes 
//here, creating a new RooRealVar named "NEW_PARAMETER"

RooAddPdf model("model","model",RooArgList(gauss,bkg),RooArgList(NEW_PARAMETER,nbkg));

If so, how would I go about doing that? I’ve tried making nsig a function of other variables before with no success. The closest source I could find for creating a RooRealVar from other RooRealVars is
[url]Product of two random variable but it has no answer.

I’m sorry if this is a really basic question, that’s probably why I’m stumped. If there’s a tutorial that I missed, I’d appreciate a link to it!

Thank you,

J. Rorie