Area under histogram changed

I have a histogram.

TH1F* Edep_histogram = new TH1F("Time_hist", "Distribution of time", 185, -5, 180);

When I do binning like this I am getting :

No. of Entries in the histogram: 22372
Area under the histogram: 22372.

However changing binning ,

TH1F* Edep_histogram = new TH1F("Time_hist", "Distribution of time", 1850, -5, 180); 

I am getting

No. of Entries in the histogram: 22372
Area under the histogram: 11807. 

Why this is happening?
I am getting Area using this line,

Double_t area = Edep_histogram->Integral(0, 180);
cout << "Area under the histogram: " << area << endl;

Check out the explanation of what is done (and the option “width”):
https://root.cern/doc/master/classTH1.html#aaf053a4b487c46b9e20c0bf534b34012
Also, note that the range passed to Integral is in bin numbers, not user coordinates (so maybe you want 1,180 and 1,1800).

Now I am getting same integral changing the bin numbers. However the maximum counts in the histogram changes after changing binning value e.g for 180 binning, max count is 1200 and for 1800 binning, maximum count is 150. Is it expected?

Yes it is expected, since the smaller is the is the bin, the smaller is the number of event falling in each bin.

As very rough of estimation if your bin width goes down by a factor ~10 you should expect also the counts of the maximum bin to goes down by a factor ~10.

1 Like

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