Class TSpectrum

In version 5 of ROOT, a very interesting TSpectrum class appeared. 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 a continuous background and statistical oscillations 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:

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 the 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 a 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:

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:

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