I’ve been trying to use the TSpectrum class to identify the peaks in the spectrum taken with a residual gas analyser, but no peak is found. I played a bit with the sigma and threshold parameters, but I had no luck.
I attach the macro as well as the data set. Please change “basename” to the name of the directory where the data are.
Any help would be much appreciated.
findRGApeaks.C (8.1 KB)
2018.06.19_whileflushinggar_mod.txt (32.2 KB)
2018.06.19_whileflushinggar_bkg_mod.txt (33.0 KB)
ROOT Version: ROOT 6.12/06
Platform: OS X Yosemite 10.10.5
Compiler: Apple LLVM version 7.0.0 (clang-700.1.76)
Thread model: posix
yes the line:
int nfound = s->Search(h ,0.01,"nobackground",0.05);
gives nfound = 0 . I do not know why . The example https://root.cern/doc/master/peaks_8C.html gives a non nul value may be you can get some ideas from it.
Yes, no peaks are found, and thus none is fit.
I tried to change the 0.01 and 0.05 values, but still no peaks identified…
I am not really expert in that area I would suggest to start from a working example like the one I suggested or try to find more infos the the Search method documentation.
TSpectrum::Search() has difficulties searching for peaks if the Y axis has a range of < 1. I added the
int nfound = s->Search(h, 2, "nobackground", 0.05);
and everything works as expected (note I changed sigma to
Yes, I think the same, Search method probably does not like to work with value less than 1. I observed the same with the Background method; it is not able to evaluate non-integer background (it is 0 or 1, not between).
Maybe, you could open a bug report on JIRA to track the problem if someone is interested to solve it.
thanks for your reply! It did indeed work.
Done! Thanks for the suggestion.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.