What happens when rebinning a histogram with non-divisible number of bins?

In summary, The TH1::Rebin function in ROOT allows for the rebinning of a histogram with a specified number of bins. If the number of bins is not an exact divider of the original histogram's bin number, the top limit of the rebinned histogram is reduced and the remaining bins are added to the overflow bin. The contents of the old bins are combined and added to the new bins according to the specified number. Any events that do not fit within the new histogram ranges are placed in the overflow bin.
  • #1
ChrisVer
Gold Member
3,378
464
Hi,

I am having one histogram that contains 101 bins.
I tried rebining it with the TH1::Rebin:
C:
 histogram->Rebin(2.);
But I got the warning message that 2 is not an exact divider of 101.

I looked in ROOT TH1 Rebin's page, and read this note:
If ngroup is not an exact divider of the number of bins,
the top limit of the rebinned histogram is reduced
to the upper edge of the last bin
that can make a complete
group. The remaining bins are added to the overflow bin.
Statistics will be recomputed from the new bin contents.

I don't understand what the execution of the program actually does to the bins. Is the initial histogram destroyed? I don't think I understand what they mean with the red-highlighted by me phrase...

Does it mean that it grouped the 100 bins together with 2, and it put the last bin events (101st) in the result's last bin (now 50th)? So more like grouping all the 2 bins in 1 and the last 3 in 1?
 
Technology news on Phys.org
  • #2
You get the contents of bin 1* and bin 2 in the new bin 1, bin 3 and 4 get combined to the new bin 2 and so on. The "top limit of the rebinned histogram" is the upper edge of bin 50, which is the same as the upper edge of the old bin 100. The contents of bin 101 go to the overflow.

*note: ROOT bins start at 1. Index 0 is reserved for underflow.
 
  • Like
Likes ChrisVer
  • #3
mfb said:
The contents of bin 101 go to the overflow.

Would it be too much to ask what does that mean too?:sorry: Like those events are discarded from the appearence of the histogram?
 
  • #4
ROOT has an overflow and underflow bin for all entries that do not fit to the histogram range. Everything that was in the old bin 101 is not within the histogram ranges any more.
 
  • Like
Likes ChrisVer

What is "ROOT-histogram Rebinning"?

ROOT-histogram Rebinning is a data analysis technique used in the ROOT framework, a scientific software tool for high-energy physics. It allows for the grouping of data points in a histogram into larger bins, reducing the number of bins and making the data easier to visualize and analyze.

Why is "ROOT-histogram Rebinning" necessary?

ROOT-histogram Rebinning is necessary because histograms with a large number of bins can be difficult to interpret and can obscure the underlying trends in the data. Rebinning allows for a more simplified and clearer representation of the data, making it easier to identify patterns and make accurate conclusions.

How do you perform "ROOT-histogram Rebinning"?

To perform "ROOT-histogram Rebinning", you must first have a histogram with a large number of bins. Then, using the ROOT software, you can specify the number of bins you want to group together and rebin the histogram accordingly. This can be done manually or through the use of specialized functions in the ROOT library.

What factors should be considered when choosing the number of bins for "ROOT-histogram Rebinning"?

The number of bins chosen for "ROOT-histogram Rebinning" should take into account the amount of data being analyzed, the desired level of detail, and the goals of the analysis. A larger number of bins may provide a more detailed view of the data, but too many bins can make it difficult to interpret the results.

Are there any limitations to "ROOT-histogram Rebinning"?

Yes, there are limitations to "ROOT-histogram Rebinning". Rebinning can alter the shape and appearance of the histogram, potentially masking important features in the data. It is important to carefully consider the implications of rebinning and to use it in conjunction with other data analysis techniques to ensure accurate results.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
3K
  • Advanced Physics Homework Help
Replies
3
Views
2K
Replies
3
Views
278
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • Precalculus Mathematics Homework Help
Replies
3
Views
1K
  • Precalculus Mathematics Homework Help
Replies
6
Views
1K
Replies
5
Views
2K
Replies
14
Views
3K
Replies
6
Views
9K
Back
Top