MICC JINR Multifunctional
Information and Computing
Complex

RU

TSpectrum class

A very interesting TSpectrum class appeared In Version 5 of ROOT. It makes it easy to perform the most frequent operations that are required when analyzing physical data. The TSpectrum class contains the following spectrum processing functions:

  1. Background Assessment
  2. Smoothing
  3. Peak Search
  4. Deconvolution
  5. Transformations
  6. Visualization

One-dimensional and two-dimensional spectra can be studied. A detailed description of the class methods and algorithms on which they are built can be found here . It should be noted that the implementation of some methods depends on the version of ROOT.

Class Constructor

TSpectrum::TSpectrum(Int_t maxpositions)

maxpositions-the maximum number of peaks that you want to find in the spectrum. This parameter can be omitted.

Peak Search Functions

Int_t Search(const TH1* hist, Double_t sigma=2,Option_t* option, Double_t treshold = 0.05)

This function searches for peaks in the source spectrum, cutting off the continuous background and statistical oscillations, i.e. noise. The number of peaks found and their positions are recorded in the fNpeaks and fPositionX members. The search is performed in the current histogram range. The algorithm is based on smoothed second derivatives, which are compared with standard deviations. Therefore, sigma is also transmitted to the peak search function. Options:

  • hist - pointer to the source spectrum histogram
  • sigma - sigma of the required peaks
  • option - graphic option
  • treashold - (by default 0.05)  peaks with an amplitude less than the threshold * highest_peak are discarded.

By default, the background is deleted before deconvolution. Specify the “nobackground” option to not remove the background. By default, the Markov chain algorithm is used. Specify the “noMarkov” parameter to disable this algorithm. Note that by default the source spectrum is replaced by a new spectrum. By default, a polymarker object is created and added to the list of histogram functions. The histogram is drawn using the specified option and the polymarker object drawn over the histogram. The coordinates of polymarkers correspond to the npeaks peaks found in the histogram. A pointer to the polymarker object can be obtained later: → The option parameter has two values:

  • "goff" turns off storage and drawing of the polymarker, which the peaks are highlighted;
  • "nodraw" disables the final histogram drawing with search results.

Method

TH1* Background (const TH1* h, Int_t niter=20, Option_t option="");

calculates the background of the spectrum given by the histogram. The result is returned in the form of a histogram.
Options:

h - one-dimensional histogram
niter - the number of iterations (by default 20). Increasing the number of iterations will make the result smoother and lower.
option - can have the following values:
"nosmoothing" - turns off background smoothing, which is called by default
"same" - the original histogram and its background are drawn in one image.

This feature allows one to separate useless spectral information (continuous background) from the peaks. The function is based on the sensitive algorithm of non-linear iterative peak clipping, actually representing a second order difference filter (-1.2, -1). The algorithm is described in detail in ...