Number of events in a single bin

Hi,

This may be a very stupid question but I don’t know how I can do. I’m trying to get number of events in a single bin from RooDataHist but I can’t do that. The data set was generated as unbinned data following a certain pdf and converted into binned one as below:

unbinned_data = signal.generate (RooArgSet (x), nevent) binned_data = unbinned_data.binnedClone ()

And I can see the same plot between unbinned_data (which is converted into binned one automatically when I plot it by using RooAbsData.plotOn (binned_data, frame)) and binned_data.

I’m trying to make my own function which calculate the likelihood by myself so that I need those number of events for each bins. Please help me.

I found the way from manual (sorry for bugging you):

[code]# set the bin position to retrieve # of events
binned_data.get(i)

retrieve the # of events

nevents = binned_data.weight()[/code]