Bin integration


I am trying to use bin integration, instead of bin centre , in my binned likelihood fit, in roofit. How do i do that ?

For example here is what i am doing right now to fit
RooFitResult* fitr=pdf.fitTo(mc); // This uses bin center…how do i change this so that
// to use the bin integration ??

Here MC :
RooDataHist mc(“tree of b candidate”,“ntple candidates”, x , Import(*h));
h is 1D histogram…

Thank you…


There is no support for bin integration in RooFit. You can do however in ROOT using the “I” option in TH1::Fit


Hi Lorenzo,

I used ROOT as well as ROOFIT
In ROOT i used chi2, Log-likelihood fit (uses bin center) and log-likelihood with bin integration…
all the above three cases i get almost same answer for my fitting parameter… (by the way i am using exponential function
like [0]*exp(-x/[1] ).

This is how i fit the three different way my histogram:
TF1 decaym(“decaym”,"[0]*exp(-x/[1])", 0., 10.);
h->Fit(“decaym”); // default fit - chi2 fit
//h->Fit(“decaym”,“L”); // log likelihood fit
//h->Fit(“decaym”,“LI”); // log likelihood fit with bin integration, rather than using bin centre.

On the contrary, when i use roofit to fit the same histogram with roo-decay model (which is also exponential) with delta function resolution,
using binned chi2 fit: i get same as in root
using binned likelihood fit: i get 5% different in central value of my fitting parameter…why ?

This is how i do the fit in roofit
RooTruthModel tm(“tm”,"",gt);
RooDecay* decaym =new RooDecay(“decaym”,"", x , tau, tm,RooDecay::SingleSided);

for chi2-fit i use:
RooChi2Var chi2(“chi2”,“chi2”,decaym, data) ;
RooMinuit m(chi2) ;
m.migrad() ;
m.hesse() ;

but for likelihood fit:
RooFitResult* fitr=decaym.fitTo(data); // for likelihood fit

Is there something i am missing…why roofit likelihood method gives me complete different answer than other 4 methods (3 methods using root and chi-2 method in roofit) ?

If you want i can provide you the root file and code…


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.