Re: [ROOT] TGraph divide

From: Andy Haas (haas@fnal.gov)
Date: Fri Jul 23 2004 - 18:15:50 MEST


Hi Rene,
I would in principle be happy to implement this. Getting the errors
correct is very tricky, however. Assumptions have to be made about
the distributions from which the graphs are derived, and any
correlations between them. For many problems, the errors can not be
calculated correctly without knowing the actual histograms from which
the graphs were created. An example would be the ratio of two
efficiency curves, which share a common histogram as a denominator. I
do not suggest implementing a 'deafult' error calculation which
assumes Poisson-distributed uncorrelated data, since many users would
not realize that this formula is incorrect for their particular
situation. 
So, I think Tancredi really should use a loop, as it's not much code
anyways.
Cheers, Andy.

--- Rene Brun <Rene.Brun@cern.ch> wrote:
> Hi Tancredi,
> 
> We do not have a TGraphErrors::Divide function. However, after some
> gymnastic,
> you should be able to do the job via TGraphAsymmErrors::BayesDivide
> or the corresponding TGraphAsymmErrors constructor.
> See the description of this function at:
>
http://root.cern.ch/root/htmldoc/TGraphAsymmErrors.html#TGraphAsymmErrors:BayesDivide
> 
> You will have to transform your TGraphErrors to histograms before
> using this
> function.
> A direct interface TGraphAsymmErrors::Divide taking two TGraphs as
> input
> could be implemented.
> I am ccying this mail to Andy Haas the author of BayesDivide.
> Andy, would you like to implement TGraphAsymmErrors::Divide ?
> 
> Rene Brun
> 
> Tancredi Carli wrote:
> > 
> >  Hello,
> > 
> >   I have two objects of type TGraphErrors, let's say TG1 and TG2
> >  and I would like to divide them, e.g. TG3=TG1/TG2 and get
> >  the correct error treatment. Is there an function for this
> >  operation which I overlooked ?
> > 
> >  ..or do I have to get the values at each point by GetPoint
> >  make the division, calculate the error, create new objects
> >  and set the points ?
> > 
> >  Thank you for you help.
> > 
> >              Tancredi Carli
> > 
> > --
> > 
> >
>
+-------------------------------------------------------------------+
> > |  Tancredi Carli                     tancredi.carli@cern.ch     
>   |
> > |  CERN, Division EP                  phone  ++41 22 767 9606    
>   |
> > |  CH-1211 Geneva 23                  Room   40-1-C06            
>   |
> >
>
+-------------------------------------------------------------------+
> 



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