Re: [ROOT] TProfile with variable bin sizes

From: Alberto Garcia Raboso (Alberto.Garcia.Raboso@cern.ch)
Date: Tue Feb 25 2003 - 19:41:37 MET


Hi Rene,

Among the options you propose, I find the last one the better. If you add 
two new arrays to always accumulate sum(w*x) ans sum(w*x*x), it would not 
enlarge too much the class, and you can have an option to dinamically 
decide if you want to use the geometrical or gravity center of the bin. In 
addition, it avoids to make users learn more things: if they want to use 
this new feature, they would only have to set the option. Finally, in the 
cases where you have large bins, it would permit you to check if the 
points in the bin are more or less distributed along the whole bin or 
there exists a large deviation to any of the sides of the bin.

Just an opinion...

Alberto

On Tue, 25 Feb 2003, Rene Brun wrote:

> Hi Alberto,
> 
> Your analysis is correct. A TProfile does not compute the mean/rms for each bin
> along x. I agree that this would be an interesting addition.
> This extension could be implemented in two ways
>   - new class TProfileX  deriving from TProfile with two additional
> arrays           to accumulate sum(w*x) and sum(w*x*x) for each bin
>   - extend the existing TProfile with again 2 possibilities
>     - by default compute the mean/rms per bin
>     - as an option
> It would be trivial to extend the Fit functions to take into account the errors
> per bin along x.
> 
> Comments are welcome.
> 
> Rene Brun
> 
> Alberto Garcia Raboso wrote:
> > 
> > Hi ROOTers,
> > 
> > I need a variable bin size profile, and so I have had a look on the code
> > to see what it makes. The problem is that ROOT takes the mean and the
> > standard deviation only along the y axis, but not in the x axis. Later on
> > I need to fit the points (x_{m}, y_{m}), where x_{m} is the mean of the
> > points alog the x axis, and y_{m} the mean along the y axis, weighted eith
> > the error along the y axis.
> > 
> > Does anybody know a way to do it, without having to use a TGraphErrors and
> > to calculate all the errors manually?
> > 
> > Thanks in advance,
> > 
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Alberto Garcia Raboso
> > Universidad Autónoma de Madrid (Spain)
> > E-Mail: Alberto.Garcia.Raboso@cern.ch
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Well, farewell, my hobbits! You should come safe to your own
> > homes now, and I shall not be kept awake for fear of your
> > peril. We will send word when we may, and some of us may yet
> > meet at times; but I fear that we shall not all be gathered
> > together ever again.
> > 
> >                       The return of the King. J.R.R. Tolkien
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Alberto Garcia Raboso
Universidad Autónoma de Madrid (Spain)
E-Mail: Alberto.Garcia.Raboso@cern.ch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Well, farewell, my hobbits! You should come safe to your own
homes now, and I shall not be kept awake for fear of your
peril. We will send word when we may, and some of us may yet
meet at times; but I fear that we shall not all be gathered
together ever again.

                      The return of the King. J.R.R. Tolkien
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:09 MET