Package de.gsi.math.spectra
Class TSpectrum
- java.lang.Object
-
- de.gsi.math.spectra.TSpectrum
-
public class TSpectrum extends java.lang.ObjectOriginal Author: Miroslav Morhac 27/05/99 clean up/java port: Ralph Steinhagen 18/04/18 THIS CLASS CONTAINS ADVANCED SPECTRA PROCESSING FUNCTIONS. ONE-DIMENSIONAL BACKGROUND ESTIMATION FUNCTIONS ONE-DIMENSIONAL SMOOTHING FUNCTIONS ONE-DIMENSIONAL DECONVOLUTION FUNCTIONS ONE-DIMENSIONAL PEAK SEARCH FUNCTIONS These functions were written by: Miroslav Morhac Institute of Physics Slovak Academy of Sciences Dubravska cesta 9, 842 28 BRATISLAVA SLOVAKIA email:fyzimiro@savba.sk, fax:+421 7 54772479 The original code in C has been repackaged as a C++ class by R.Brun The algorithms in this class have been published in the following references: [1] M.Morhac et al.: Background elimination methods for multidimensional coincidence gamma-ray spectra. Nuclear Instruments and Methods in Physics Research A 401 (1997) 113-132. [2] M.Morhac et al.: Efficient one- and two-dimensional Gold deconvolution and its application to gamma-ray spectra decomposition. Nuclear Instruments and Methods in Physics Research A 401 (1997) 385-408. [3] M.Morhac et al.: Identification of peaks in multidimensional coincidence gamma-ray spectra. Nuclear Instruments and Methods in Research Physics A 443(2000), 108-125. These NIM papers are also available as doc or ps files from: ftp://root.cern.ch/root/Spectrum.docftp://root.cern.ch/root/SpectrumDec.ps.gz ftp://root.cern.ch/root/SpectrumSrc.ps.gz ftp://root.cern.ch/root/SpectrumBck.ps.gz The original source documentation as well as examples can be found at http://root.cern.ch/
-
-
Field Summary
Fields Modifier and Type Field Description protected static intfgAverageWindowprotected static intfgIterationsprotected intfMaxPeaksprotected intfNPeaksprotected double[]fPositionprotected double[]fPositionXprotected double[]fPositionYprotected doublefResolution
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinalize()TSpectrum desctructorintgetNPeaks()double[]getPeakX()double[]getPeakY()static voidmain(java.lang.String[] argv)intSearch(double[] hinX, double[] hinY, double[] houtX, double[] houtY, double sigma, java.lang.String option, double threshold)ONE-DIMENSIONAL PEAK SEARCH FUNCTION This function searches for peaks in source spectrum in hin The number of found peaks and their positions are written into the members fNpeaks and fPositionX.intSearchHighRes(double[] source, double[] destVector, int ssize, double sigma, double threshold, boolean backgroundRemove, int deconIterations, boolean markov, int averWindow)ONE-DIMENSIONAL HIGH-RESOLUTION PEAK SEARCH FUNCTION This function searches for peaks in source spectrum It is based on deconvolution method.voidSetAverageWindow(int w)voidSetResolution(double resolution)
-
-
-
Field Detail
-
fgAverageWindow
protected static int fgAverageWindow
-
fgIterations
protected static int fgIterations
-
fMaxPeaks
protected int fMaxPeaks
-
fNPeaks
protected int fNPeaks
-
fPosition
protected double[] fPosition
-
fPositionX
protected double[] fPositionX
-
fPositionY
protected double[] fPositionY
-
fResolution
protected double fResolution
-
-
Constructor Detail
-
TSpectrum
public TSpectrum()
The TSpectrum() default constructor
-
TSpectrum
public TSpectrum(int maxpositions, double resolution)- Parameters:
maxpositions- maximum number of peaksresolution- determines resolution of the neighboring peaks default value is 1 correspond to 3 sigma distance between peaks. Higher values allow higher resolution (smaller distance between peaks. May be set later through SetResolution.)
-
-
Method Detail
-
finalize
public void finalize()
TSpectrum desctructor- Overrides:
finalizein classjava.lang.Object
-
getNPeaks
public int getNPeaks()
- Returns:
- number of peaks found
-
getPeakX
public double[] getPeakX()
- Returns:
- X coordinates of found peaks
-
getPeakY
public double[] getPeakY()
- Returns:
- Y coordinates of found peaks
-
Search
public int Search(double[] hinX, double[] hinY, double[] houtX, double[] houtY, double sigma, java.lang.String option, double threshold)ONE-DIMENSIONAL PEAK SEARCH FUNCTION This function searches for peaks in source spectrum in hin The number of found peaks and their positions are written into the members fNpeaks and fPositionX. The search is performed in the current histogram range. Function parameters:- Parameters:
hinX- histogram x of source spectrumhinY- histogram Y of source spectrumhoutX- out histogram of source spectrumhoutY- out histogram of source spectrumsigma- sigma of searched peaks, for details we refer to manualoption- string options passed to the algorithmsthreshold- (default=0.05) peaks with amplitude less than threshold*highest_peak are discarded. 0 < threshold <1 By default, the background is removed before deconvolution. Specify the option "nobackground" to not remove the background. By default the "Markov" chain algorithm is used. Specify the option "noMarkov" to disable this algorithm Note that by default the source spectrum is replaced by a new spectrum- Returns:
- number of found peaks
-
SearchHighRes
public int SearchHighRes(double[] source, double[] destVector, int ssize, double sigma, double threshold, boolean backgroundRemove, int deconIterations, boolean markov, int averWindow)ONE-DIMENSIONAL HIGH-RESOLUTION PEAK SEARCH FUNCTION This function searches for peaks in source spectrum It is based on deconvolution method. First the background is removed (if desired), then Markov spectrum is calculated (if desired), then the response function is generated according to given sigma and deconvolution is carried out.- Parameters:
source- vector of source spectrumdestVector- vector of resulting deconvolved spectrumssize- length of source spectrumsigma- sigma of searched peaks, for details we refer to manualthreshold- threshold value in % for selected peaks, peaks with amplitude less than threshold*highest_peak/100 are ignored, see manualbackgroundRemove- logical variable, set if the removal of background before deconvolution is desireddeconIterations- number of iterations in deconvolution operationmarkov- logical variable, if it is true, first the source spectrum is replaced by new spectrum calculated using Markov chains method.averWindow- averaging window of searched peaks, for details we refer to manual (applies only for Markov method)- Returns:
- number of found peaks
-
SetAverageWindow
public void SetAverageWindow(int w)
- Parameters:
w- average window of searched peaks- See Also:
SearchHighRes(double[], double[], int, double, double, boolean, int, boolean, int)
-
SetResolution
public void SetResolution(double resolution)
- Parameters:
resolution- determines resolution of the neighboring peaks default value is 1 correspond to 3 sigma distance between peaks. Higher values allow higher resolution (smaller distance between peaks. May be set later through SetResolution.
-
main
public static void main(java.lang.String[] argv)
-
-