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.
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.
I am trying to plot my data, giving a few options with DrawOption:,
RooPlot* frame = topMass->frame(Bins(20),Title(“Mass distribution”)) ;
data->plotOn(frame, DrawOption(“Zp”)) ;
The result of this is in the attached plot.
Since my plot contains many empty bins, I do not want to draw these, so as to have only bins with non-zero entries. Is there a way to do this?
The option “p” should, as stated in the THistPainter page," Draw current marker at each bin except empty bins". But I sup…
What about :
May be @moneta has an idea ?
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.
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.