Dear rooters,
I have a problem using TSpectrum.
I’m trying to understand the standart macro: https://root.cern.ch/root/html/tutorials/spectrum/peaks.C.html.
Program works well but when I’m trying to print positions of maximums I’ll get wrong values.
Here is how I try to get positions:
Double_t xp = xpeaks[p];
Int_t bin = h->GetXaxis()->FindBin(xp);
Double_t yp = h->GetBinContent(bin);
[b]cout<<"Xp= "<<xp<<" Yp="<<yp<<endl;[/b]
And here is the result for [color=#0040BF]peaks(4)[/color]:
Found 4 candidate peaks to fit
Xp= 5.39567e+20 Yp=0
Xp= 2.23206e+21 Yp=0
Xp= 8.73532e-313 Yp=577
Xp= 3.60739e-313 Yp=577
The question is how to get these positions correctly?
Thank you for help in advance!
Sergey