RooFit - normalization problem of fit in a range


I’m having a normalization problem while trying to do an extended ML fit (its also happens for non extended fit but lets focus on the former).
I try to fit a Z peak (Nsconvolution(breit-wigner,gauss) + Nbexponent) and get mainly the Ns and Nb parameters.
The fit is done correctly when I have data points out of the fit range, however, the interpretation of the fit parameters is screwed up because of the larger normalization and therefore I get completely wrong Ns and Nb values. This is my problem.
If I constrain the observable RooRealVar variable (the “x” variable) to be identical as the fit range then both the fit and the Ns and Nb parameters interpretation are correct since the normalizations are the same.

The ranges are:
data points in 0->200,000 MeV
fit range in 60,000->120,000 MeV

I want to avoid plotting only the fit range since I have data also out of it…

Please see below my code.

double XFULLMIN = 0.;
double XFULLMAX = 200000.;
double XFITMIN = 60000.;
double XFITMAX = 120000.;

TFile* f = new TFile("file.root");
TTree* imassTree = (TTree*)f->Get("imassTree");

// --- imassTree has a branch called "imass"
// double m_imass;
// imassTree->SetBranchAdress("imass",&m_imass);
RooRealVar nsig("nsig","#signal events",1300,1,2000);
RooRealVar nbkg("nbkg","#background events",100,1,2000);
// --- Observable (same name as the tree branch)
RooRealVar imass("imass", "#hat{m}_{#mu#mu}", XFULLMIN, XFULLMAX, "MeV");   
// --- Signal Parameters
RooRealVar gaussSigma("gaussSigma", "Resolution", 3000., 100., 10000.);
RooRealVar breitWignerMean("breitWignerMean", "m_{Z^{0}}", 91000., XFITMIN, XFITMAX);
RooRealVar breitWignerGamma("breitWignerGamma", "#Gamma", 2495.2);
// --- fix the BW width parameter to the known value (PDG)
// --- Build the convolution of the Gauss and Breit-Wigner PDFs ---
RooVoigtian BreitGaussSignal("BreitGauss", "Breit-Wigner #otimes Gauss PDF", imass, breitWignerMean, breitWignerGamma, gaussSigma);

// --- Background Parameters
RooRealVar expMeasure("expMeasure", "Exponent measure", -1.e-6, -1.e-4, -1.e-8);
// --- Build the background exponential PDFs ---
RooExponential ExponentBG("ExponentBG", "Exponential BG", imass, expMeasure);
// --- redefine the generic PDFs in the fit range
RooExtendPdf sigE("sigE", "signalExtended",     BreitGaussSignal, nsig, "fitRange");
RooExtendPdf bkgE("bkgE", "backgroundExtended", ExponentBG,  nbkg, "fitRange");   
RooAddPdf model("model", "BreitGaussSignal #oplus ExponentBG", RooArgList(sigE,bkgE));
// --- for un-extended ML fit (not relevant here)
//RooRealVar fsig("fsig","signal fraction",0.9,0.,1.);
//RooAddPdf model("model", "BreitGaussSignal #oplus ExponentBG", RooArgList(BreitGaussSignal,ExponentBG), fsig);
// --- get the data set ---
RooDataSet* data = new RooDataSet("data", "data", imassTree, imass);
// --- Perform extended ML fit of composite PDF to data ---
model.fitTo(*data, Range("fitRange"), Extended(kTRUE));
// --- Perform a regular ML fit of composite PFD to data (not relevant here)
//model.fitTo(*data, Range("fitRange"));

// --- Plot toy data and composite PDF overlaid ---
TCanvas* canv_imass_roofit = new TCanvas("imass_roofit","imass_roofit",602,400);
RooPlot* frame = imass.frame();
data->plotOn(frame, XErrorSize(0));
RooArgSet* params = model.getVariables();

I saw the posts starting from Dec 06, 2005 (“RooAddPdf coefficient normalization”) and added this post there but got no reply…


Hello Noam,

I have the same problem with the fit range specified versus fit range taken
as a default from the underlying variable definition.

Did you ever get to some conclusion/solution ?


Same thing here!

[quote=“gorelov”]Hello Noam,

I have the same problem with the fit range specified versus fit range taken
as a default from the underlying variable definition.

Did you ever get to some conclusion/solution ?