er  dev
Public Types | Public Member Functions | Protected Attributes | List of all members
ERCalibrationSSD::PeakSearch Class Reference
Inheritance diagram for ERCalibrationSSD::PeakSearch:
Inheritance graph
[legend]

Public Types

enum  PeakSearchAlgorithm { SLIDING_WINDOW, GAUSS }
 

Public Member Functions

void SetPeakSearchMethod (const TString &peakSearchAlgorithm)
 
void SetFitMinSigma (const Double_t value)
 
void SetFitPeakThreshold (const Double_t value)
 
void SetSearchRadius (const Int_t value)
 
void SetSlideWindowWidth (const Int_t value)
 
std::list< Double_t > GetPeaksTSpectrum (TH1 *hist, const Double_t fitMinSigma, const Double_t fitPeakThreshold)
 
std::list< Double_t > SlidingWindowPeakSearch (TH1 *hist, const std::list< Double_t > &initGuess, const Int_t windowWidth, const Int_t searchRadius)
 Searchs peaks on a histogram by the "sliding window" algorithm. Algorithm: More...
 
std::list< Double_t > GaussPeakSearch (TH1 *hist, const std::list< Double_t > &initGuess, const Int_t searchRadius)
 Searchs peaks on a histogram by the 'gaus + pol1' fit. Algorithm: More...
 
std::list< Double_t > GetPeaks (TH1 *hist, const std::list< Double_t > &initGuess)
 Returns peaks according to set options. Restores histogram bin range (0, Nbins) after search by any method. More...
 

Protected Attributes

Int_t fPeakSearchMethod = SLIDING_WINDOW
 
Double_t fFitMinSigma = 6.
 
Double_t fFitPeakThreshold = 0.7
 
Int_t fSearchRadius = 10
 
Int_t fSlideWindowWidth = 10
 
std::vector< std::vector< float > > fIntegralInWindow
 

Detailed Description

Definition at line 1150 of file ERCalibrationSSD.cxx.

Member Function Documentation

std::list< Double_t > ERCalibrationSSD::PeakSearch::GaussPeakSearch ( TH1 *  hist,
const std::list< Double_t > &  initGuess,
const Int_t  searchRadius 
)

Searchs peaks on a histogram by the 'gaus + pol1' fit. Algorithm:

  1. set search_radius;
  2. for each init_peak in [initial guess peaks]: 2.1. make preliminary fit by 'clear' Gauss around the init_peak +- search_radius; 2.2. use 2.1 result as inital guess for fit by 'gaus + pol1' around the init_peak +- search_radius; 2.3. Mean value of the 2.2 fit is a peak position.

hist histogram to find peaks initGuess list of approximate positions of peaks searchRadius radius of a region around intial guess peak bounding sliding window moving

Returns
list of peaks

Definition at line 1295 of file ERCalibrationSSD.cxx.

std::list< Double_t > ERCalibrationSSD::PeakSearch::GetPeaks ( TH1 *  hist,
const std::list< Double_t > &  initGuess 
)

Returns peaks according to set options. Restores histogram bin range (0, Nbins) after search by any method.

Parameters
histhistogram to search peak
initGuessinitial guess for searching methods

Definition at line 1318 of file ERCalibrationSSD.cxx.

std::list< Double_t > ERCalibrationSSD::PeakSearch::GetPeaksTSpectrum ( TH1 *  hist,
const Double_t  fitMinSigma,
const Double_t  fitPeakThreshold 
)

Returns sorted list of peaks found by TSpectrum algorithm.

Parameters
histinput histogram to search peaks

Definition at line 1246 of file ERCalibrationSSD.cxx.

std::list< Double_t > ERCalibrationSSD::PeakSearch::SlidingWindowPeakSearch ( TH1 *  hist,
const std::list< Double_t > &  initGuess,
const Int_t  windowWidth,
const Int_t  searchRadius 
)

Searchs peaks on a histogram by the "sliding window" algorithm. Algorithm:

  1. set window_width;
  2. set search_radius;
  3. for each init_peak in [initial guess peaks]: 3.1. search window position on the interval [init_peak - search_radius, init_peak + search_radius] with maximal integral counts value; 3.2. Mean value in window with maximal integral value is a peak position

    Note: on each step of searching maximal integral postion the window fully lies inside the search interval

hist histogram to find peaks initGuess list of approximate positions of peaks windowWidth widht of the sliding window searchRadius radius of a region around intial guess peak bounding sliding window moving

Returns
list of peaks

Definition at line 1266 of file ERCalibrationSSD.cxx.


The documentation for this class was generated from the following file: