Is there any way to get a entry from a single bin?

I can get the total number of entries
histogram → GetEntries()
And also can get the sum of weights for each single bin
histogram → GetBinContent(bin)

Then how can I get an entry for each single bin?
Is there any way? I’ve checked TH1 class reference page but couldn’t find the solution.

Thanks
PS Happy new year


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


If you TH1::Fill with a constant “weight” (e.g., equal to 1), then TH1::GetBinContent divided by the “weight” returns its “number of entries” (i.e., how many times you filled/incremented this bin).