SearchHighRes Function

Hello Everyone,

I am trying to project a 2D spectrum to 1D and use a SearchHighRes function to find the peaks in the spectrum. However, I have difficulty using the parameters. Is there anyone who can help?
here is a small piece of my code.

for(int bin = 1; bin <= last_bin; bin++)
		double temp_ratio;
		TH1D *h = hp_energy->ProjectionY("_py", bin, bin);	
	
		TSpectrum *s = new TSpectrum(5); 
		Double_t *xpeaks; 
		Double_t *ypeaks;

		for (int j = 0; j < max_ch; j++) source[j]=h->GetBinContent(j + 1);
	
		nfound = s->SearchHighRes(source, dest, max_ch, 1.5, 4, kTRUE, 3, kTRUE, 3);	
		xpeaks = s->GetPositionX();
		ypeaks =  s->GetPositionY();
		printf("\n%d     ", bin);

_ROOT Version:_6.16/00
Platform: Ubuntu 18.04.3

regards,
Nastaran

Hi @n.saei90,
and welcome to the ROOT forum. What do you mean exactly when you say “I have difficulty using the parameters”? What problems are you encountering?

Cheers,
Enrico

in: https://root.cern/doc/master/group__tutorial__spectrum.html

several examples use this method:

FitAwmi.C
SearchHR1.C
SearchHR3.C
SearchHR3.C
SearchHR3.C
SearchHR3.C
Src.C
Src2.C
Src3.C
Src4.C
Src5.C

May be you should look at it to get some help ?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.