When to use Extended() in fitTo() function


So, I set up a model with a signal component (double gaus) and a background component (2nd order Chebychev) with:

RooAddPdf tot(“tot”,“Sig+bkg”,RooArgList(signal,bgd), RooArgList(yieldSig,yieldBgd))

In tutorial macro #202, a very similar model is built, and when the fit is called it is done with:
// Fit model to data, extended ML term automatically included
model.fitTo(*data) ;

I.e. there is no explicit inclusion of a RooFit::Extended() in the call of fitTo. However, in the roofit users manual it says:
"But fitting models with event count coefficients is essentially different: the ‘extended likelihood term’,
the extra piece of the likelihood that constrains the number of events predicted by the model to be
equal to the number of observed events in data must be added to the regular likelihood function for
the fit to succeed. You do this with the Extended() named argument in fitTo():
model.fitTo(data,Extended(kTRUE)) ; "

So I am confused - do I need to include the Extended() argument or not?

When I do use the Extended() argument, I also get an error complaining that a RooChebychev is not extendable, which is also confusing.


RooRealVar x(“x”,“Mass”, mass-100, mass+100);
RooRealVar mean("#overline(m)", “#overline(m)” , mass,mass-100,mass+100);
RooRealVar sigma("#sigma", “#sigma” , 6,0,50);
RooFormulaVar sigmaWide(“sigmaWide”,“2.75*@0”,RooArgList(sigma));

RooGaussian gaus(“gaus”, “Gaussian Peak”, x, mean, sigma);
RooGaussian gausWide(“gausWide”, “Gaussian Peak”, x, mean, sigmaWide);

RooRealVar narrowFrac(“f_n”,“f_n”,0.4,0,1);

RooAddPdf signal(“signal”,“signal”,RooArgList(gaus,gausWide),narrowFrac);

RooRealVar a0(“a0”,“a0”,0.8,-1,1);
RooRealVar a1(“a1”,“a1”,0.0,0,1);
RooChebychev bgd(“poly”,“poly”,x,RooArgList(a0,a1));

RooRealVar yieldSig(“yieldSig”, “Signal Yield”,6300,0,1e10);
RooRealVar yieldBgd(“yieldBgd”, “Background Yield”,4200,0,1e10);

RooAddPdf tot(“tot”,“Sig+bkg”,RooArgList(signal,bgd), RooArgList(yieldSig,yieldBgd));[/code]