Having events at 0 while plotting RooPlot

Dear Experts,

I am importing histogram from root file and while plotting the histogram, I am having these additional events at 0, as shown in the following figure which shouldn’t be here.

Original histogram in root file is like this i.e. it contains only 32 events. None of the event occurs at zero.

Could anyone tell me why is this happening? Piece of code i’m using is:


But for the histograms having large number of events, the same code is working fine.

Thank you in advance!

Can you provide the root file ?

Here it is:
gamma.root (3.8 KB)

“energy” is the histogram i’m interested in.

Thank you!

It seems RootPlot uses the option E0:


… gives the same. Can you set the drawing option used by RooPlot ?


I guess i can change drawing options by:


I tried different drawing options, it changes the styles but additional events at still there.

I found this post. I think alot of people were having the same problem but there isn’t available a good solution for it.

What about : DrawOption(“E”) ?
May be @moneta has an idea ?

Indeed option E0 gives:

Which is a bit different from what you get as there is no error bars won the Point at ). So RooPlot seems to do something else. @moneta ta is the expert in that area.

With Option “E” it still plots error bars for events at 0.


Yes, so it is something else, not related to graphics.

RooPlot by default plots the Poisson error. You can have this behaviour for an histogram, by calling
This will give you an error bar for bins with zero entries.
There will be a remaining difference. For ROOT the error at bin 0 is ~ 1.8, while in RooFit is ~ 1.2. This is because RooFit uses for that case the 1-side 68% interval while ROOT the 2-side interval. It is a question of definition, but my preference is for keeping the same procedure (2-side intervals) independent of the number of observed events.


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