I am trying to use a TSpectrum2 to find peaks in a TH2:
void locatePoints(TH2* hist){
TSpectrum2* spec = new TSpectrum2(100);
int n_peaks_found = spec->Search(hist,2,"col");
std::cout << n_peaks_found << " peaks found" << std::endl;
Double_t* x = spec->GetPositionX();
Double_t* y = spec->GetPositionY();
for (int i=0;i<n_peaks_found;i++){
std::cout << x[i] << " " << y[i] << std::endl;
}
}
This is almost an exact copy paste from this example: root.cern.ch/root/html/tutorial … ks2.C.html
Also the online documentation (root.cern.ch/doc/master/classTSpectrum2.html) says that the signature is:
Double_t * GetPositionX () const
However, I get the error:
If I replace Double_t with Float_t it seems to work. I just want to be sure, that this is the correct return type. Did it change at some point? I am using root 5.34.