Hey RooFitters,
I recently encountered a bug when plotting a RooHistPdf and thought it may be useful for others to know the fix.
- Problem: when plotting a variable-bin-width RooHistPdf calling
RooFit::Range(...)
the normalization is off even if the range is the full range of the corresponding dataset - Solution: explicitly normalize the pdf using
RooFit::Normalization(...)
Attached is a little script which demonstrates the problem and shows the fix when you toggle any one of the boolean values doNotCallRange
, normalizeByHand
, or convertToLinearBinning
to true. The following screenshot shows the problem plot on the left and the fixed one on the right:
Cheers,
Etienne
plotHistPdf.C (1.9 KB)