Fit range and chiSquare

I’m fitting to a sub-range of a histogram. Do I need to tell chiSquare what sub-range I’m using?

This is what I’m doing now:Double_t chi2 = framex->chiSquare("curvetot","Hist",floatpars);The PDF is “curvetot” and the data is “Hist”, with a number of non-constant parameters = “floatpars”.

More detail, for reference:

RooRealVar *mass = new RooRealVar("mass","m(#Lambda_{b})",5619.51,"MeV"); RooDataHist *data = new RooDataHist("data","1D",RooArgList(*mass),h100); ... RooAbsReal * nll = totalPdf.createNLL(*data,Extended(kTRUE),Range(4300,5950)); ... RooPlot *framex = mass->frame(); data->plotOn(framex,Name("Hist"),MarkerColor(kBlack),LineColor(kBlack),DataError(RooAbsData::SumW2)); totalPdf.plotOn(framex,Name("curvetot"),LineColor(kBlue)); ... RooArgSet *floatpar = totalPdf.getParameters(data); int floatpars = (floatpar->selectByAttrib("Constant",kFALSE))->getSize(); Double_t chi2 = framex->chiSquare("curvetot","Hist",floatpars);


our math expert is unavailable at the moment. We will come back to you as soon as he will be online again.


Any movement on this?

Has the math expert returned? I’ve had a lot of trouble finding documentation on this.

See the answer at

Fit range and chiSquare