Re: [ROOT] Getting a function maximum position

From: Nick van Eijndhoven (Nick@phys.uu.nl)
Date: Tue Jan 28 2003 - 16:21:05 MET


Hi Allister,
To my opinion, the TSpectrum class does what you want.
However, when I tried it some time ago, I got the opinion
that the found peak positions were sometimes somewhat
displaced w.r.t. the actual ones.
Perhaps this has now been fixed in some more recent Root versions.

                                           Cheers,
                                            Nick. 

-- 
Dr. Nick van Eijndhoven mailto:nick@phys.uu.nl http://www.phys.uu.nl/~nick
--------------------------------------------------------------------------
Org.:    Utrecht University, Faculty of Physics and Astronomy
Address: Princetonplein 5, NL-3584 CC Utrecht, The Netherlands
Phone:   +31-30-2532331(direct) +31-30-2531492(secr.)  Fax: +31-30-2518689
CERN:    +41-22-7679751(direct) +41-22-7675857(secr.)  Fax: +41-22-7679480
Offices: Buys Ballot laboratory Room 710 (Utrecht)   B23 1-020 (CERN)
--------------------------------------------------------------------------


Allister Levi Sanchez wrote:
> 
> Hi Root folks,
> 
> If I want to find automatically the x-axis position of a 1-d
> user-defined function's peak, is there a function that does like
> TF1::GetMaximumX()?  For now I have to resort to dividing a given x-axis
> range into small intervals and do a TF1::Eval() and save them into an
> array.  Then I do a TMath::Sort() on that array in order to find the
> peak's index, then convert the index into position value.  Of course, if
> the ROOT development team says that's an unnecessary feature, I'd
> respect that.  Or is there some Root class I overlooked that does the
> job?...
> 
> Cheers,
> Allister Levi Sanchez
> Niigata University
> Japan



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