RooFit has both the binned and unbinned likelihood coded into RooNLLVar. This is triggered by setting the binnedL boolean flag on the last argument of RooNLLVar. RooNLLVar is constructed by RooAbsPdf but the binned likelihood flag is never used (Line 1081 and 1091). I suspect RooAbsPdf always uses the unbinned likelihood formula regardless of input data type.
I tried adding debugging messages in my local ROOT installation source code, in binned likelihood if-branch of RooNLLVar:
I tested them with a simple script (testBinned.C (398 Bytes) ). From stdout, it seems RooFit was using an unbinned likelihood when fitting to a RooDataHist object:
Hi,
When evaluating the likelihood RooFit uses the same code for binned and unbinned. It treats the binned case as N(ibin) events all located at the bin center.
This is normally fine, but in same case, function varying a lot within a bin, can cause a small bias.