Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

ROOT- histogram Rebinning

  1. Jun 11, 2015 #1

    ChrisVer

    User Avatar
    Gold Member

    Hi,

    I am having one histogram that contains 101 bins.
    I tried rebining it with the TH1::Rebin:
    Code (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:
    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?
     
  2. jcsd
  3. Jun 11, 2015 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    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.
     
  4. Jun 11, 2015 #3

    ChrisVer

    User Avatar
    Gold Member

    Would it be too much to ask what does that mean too?:sorry: Like those events are discarded from the appearence of the histogram?
     
  5. Jun 11, 2015 #4

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: ROOT- histogram Rebinning
  1. Histograms in IDL (Replies: 0)

  2. Root programming (Replies: 3)

Loading...