TSpectrum change in root6

Hi rootos

Installed root6.02/02 yesterday and thought I’d test with some code that worked fine with 5.34.

It did not - I found the problem was with the float array element returned by TSpectrum.

[…]
h->Draw();
TSpectrum ss = new TSpectrum(1);
Int_t nfound = ss->Search(h,1,“new”,0.2);
xp = (Float_t
) ss->GetPositionX();
cout<<“xp[0]=”<<xp[0]<<endl; // in root6 this gives 0, in root 5.34 the position in x of the first peak found.

Could anyone advise me?

(I leave steps and input as an easy working example)

Cheers
Run84_120MeV_hists.root (185 KB)

There is no histogram “h” in your file… which one should we use ?

Any

in ROOT 6 it is a Double_t (see the doc).

Do:

Double_t *xp = ss->GetPositionX();
cout<<"xp[0]="<<xp[0]<<endl; 

Great, thanks!