I have a pull distribution to which I am trying to fit a crystal ball line-shape. The data (a binned histogram) has been normalised, so effectively is weighted. As such, I used a min-chi2 fit.
When I perform the fit it converges successfully and the fit looks fine. However, the values and their errors are reported as:
EXT PARAMETER INTERNAL INTERNAL
NO. NAME VALUE ERROR STEP SIZE VALUE
1 alpha 5.43082e-01 1.76769e+01 6.66050e-05 -1.23972e+00
2 cbmean 9.14488e-02 1.46364e+00 6.06855e-07 9.14488e-04
3 cbsigma 3.69025e-01 1.03026e+00 3.76384e-06 -1.51646e+00
4 n 2.68776e+00 5.30508e+01 3.36110e-04 -1.24142e+00
I.e. the errors seem far too large. For example, the error on the mean places it outside the range of the fit!
Here is the code I am using:
using namespace RooFit;
double fitPull(std::string fileName, std::string histName, int rebin = 1) {
RooRealVar x("x","pull", -1, 1);
RooPlot* xframe = x.frame();
RooRealVar cbmean("cbmean", "cbmean" , 0.0,-100,100);
RooRealVar cbsigma("cbsigma", "cbsigma" , 0.5, 0,500) ;
RooRealVar n("n","", 3,0,100);
RooRealVar alpha("alpha","alpha", 0.53,0,20);
RooCBShape cball("cball", "crystal ball", x, cbmean, cbsigma, alpha, n);
RooGaussian gaus("gaus","gaus",x,cbmean,cbsigma);
TFile f(fileName.c_str());
TH1F *h = (TH1F*) f.Get((histName).c_str());
RooDataHist d("data","data",x,h);
RooChi2Var chi2("chi2","chi2",cball,d,DataError(RooAbsData::SumW2));
RooMinuit minuit(chi2);
minuit.migrad();
minuit.hesse();
d.plotOn(xframe);
cball.plotOn(xframe);
cball.paramOn(xframe);
xframe->Draw();
std::cout << xframe->chiSquare(4) << std::endl;
xframe->GetYaxis()->SetTitleOffset(1.5);
return 0;
}
Can anyone tell me if I am missing some important option in the fit?
Cheers,
Cameron