Re: [ROOT] Help on TGraphErrors

From: Mina Nozar (nozarm@jlab.org)
Date: Tue Apr 03 2001 - 17:20:21 MEST


Hi Rene,

Thank you for your help!

Initializing TGraphErrors::ComputeRange parameters (to some best guess
values) worked fine.
(i.e. Double_t min_mass=1000., max_mass=2000.0, min_h = 0.,
max_h=0.);        // mass == x ;  h == y

But what worked better was to use your solution to initialize the
parameters:

Int_t imin_h = TMath::LocMin(gr->GetN(),gr->GetY());
Int_t imax_h = TMath::LocMax(gr->GetN(),gr->GetY());
Double_t max_h = gr->GetY()[imax_h];
Double_t min_h = gr->GetY()[imin_h];

The problem with using max_h and min_h at this stage was that the size
of the error bars is not taken into account.   Calling ComputeRange ,
takes care of that.

gr->ComputeRange(min_mass, min_h, max_mass, max_h);

Thank you again,
mina

--
Mina Nozar
nozarm@jlab.org ----- Phone:(757)269-6391 ----- FAX:(757)269-5800
Thomas Jefferson National Accelerator Facility
MS 12H, 12000 Jefferson Ave. Newport News, VA 23606



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:41 MET