Re: [ROOT] Rebinning histograms

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Nov 18 2004 - 18:26:59 MET


Alberto,

What you try to do is like creating energy from vacuum!

If you double the number of bins, you cannot fill the new bins with only
the information from the old bins (the inverse is OK).

In case your histogram is the result of a projection from a Tree/ntuple,
you can reproject the ntuple into the new histogram.
This is done automatically when using the graphics editor (4.0/08 or newer).
In this case when you change the bin size or limits with the slider,
the histogram is refilled in real time from the tree buffers.

Rene Brun

Alberto Pulvirenti wrote:
> 
> Dear all,
> 
> sorry for the repetition, but I think it is the case to show what really
> happens to me.
> 
> I have created a simple macro where I create a histogram with a given
> number of bins and limits.
> I filled it randomy with a gaussian centered to the middle point of the
> histogram range.
> 
> Then, I changed the histogram binning, simply doubling the number of bins,
> and leavin the bin range unchanged.
> 
> What I obtain is in the second pad of the picture, that is the histogram
> is not any more centered to 0.
> Anyway, in the stats pavetext, the Mean is the same.
> 
> What wrong did I do?
> 
> Cheers,
>         Alberto
> 
>   --------------------------------------------------------------------------------
>             Name: c.gif
>    c.gif    Type: GIF Image (IMAGE/gif)
>         Encoding: BASE64
> 
>              Name: gaus.C
>    gaus.C    Type: Plain Text (TEXT/PLAIN)
>          Encoding: BASE64



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET