Re: Frequency in Histos

From: Jacques Goldberg <Jacques.Goldberg_at_cern.ch>
Date: Tue, 13 Apr 2010 11:15:10 +0300


If the weight of each entry is set to 1 (which is the default), the contents of a bin has the same value as the number of events. If you want weights different from 1, then just add a second histogram with weight set to 1. and use that one to get the numbers of entries in each bin.

There may be fancier solutions, but this one quickly gives the result.

Jacques

xsatya wrote:
> Hi,
>
> Is there any way to find the frequency of each bin of any Histos?
> (TH1F, TH2F). GetBinContent(bin) gives only the contenct value, but
> waht I want is no of Entries in that bin. Could you please let me know
> if any ways.
>
> S
> --
> ---------------
> Research Student,
> High Energy Physics, India.
Received on Tue Apr 13 2010 - 10:15:17 CEST

This archive was generated by hypermail 2.2.0 : Tue Apr 13 2010 - 11:50:01 CEST