Logo ROOT   6.07/09
Reference Guide
TSpectrum2.h
Go to the documentation of this file.
1 // @(#)root/spectrum:$Id$
2 // Author: Miroslav Morhac 17/01/2006
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 #ifndef ROOT_TSpectrum2
12 #define ROOT_TSpectrum2
13 
14 #ifndef ROOT_TNamed
15 #include "TNamed.h"
16 #endif
17 
18 class TH1;
19 
20 class TSpectrum2 : public TNamed {
21 protected:
22  Int_t fMaxPeaks; ///< Maximum number of peaks to be found
23  Int_t fNPeaks; ///< number of peaks found
24  Double_t *fPosition; ///< [fNPeaks] array of current peak positions
25  Double_t *fPositionX; ///< [fNPeaks] X position of peaks
26  Double_t *fPositionY; ///< [fNPeaks] Y position of peaks
27  Double_t fResolution; ///< *NOT USED* resolution of the neighboring peaks
28  TH1 *fHistogram; ///< resulting histogram
29 static Int_t fgAverageWindow; ///< Average window of searched peaks
30 static Int_t fgIterations; ///< Maximum number of decon iterations (default=3)
31 
32 public:
33  enum {
38  };
39 
40  TSpectrum2();
41  TSpectrum2(Int_t maxpositions, Double_t resolution=1); // resolution is *NOT USED*
42  virtual ~TSpectrum2();
43  virtual TH1 *Background(const TH1 *hist, Int_t niter=20, Option_t *option="");
44  TH1 *GetHistogram() const {return fHistogram;}
45  Int_t GetNPeaks() const {return fNPeaks;}
46  Double_t *GetPositionX() const {return fPositionX;}
47  Double_t *GetPositionY() const {return fPositionY;}
48  virtual void Print(Option_t *option="") const;
49  virtual Int_t Search(const TH1 *hist, Double_t sigma=2, Option_t *option="", Double_t threshold=0.05);
50  static void SetAverageWindow(Int_t w=3); //set average window
51  static void SetDeconIterations(Int_t n=3); //set max number of decon iterations
52  void SetResolution(Double_t resolution=1); // *NOT USED*
53 
54  //new functions January 2006
55  const char *Background(Double_t **spectrum,Int_t ssizex, Int_t ssizey,Int_t numberIterationsX,Int_t numberIterationsY,Int_t direction,Int_t filterType);
56  const char *SmoothMarkov(Double_t **source, Int_t ssizex, Int_t ssizey, Int_t averWindow);
57  const char *Deconvolution(Double_t **source, Double_t **resp, Int_t ssizex, Int_t ssizey,Int_t numberIterations, Int_t numberRepetitions, Double_t boost);
58  Int_t SearchHighRes(Double_t **source,Double_t **dest, Int_t ssizex, Int_t ssizey, Double_t sigma, Double_t threshold, Bool_t backgroundRemove,Int_t deconIterations, Bool_t markov, Int_t averWindow);
59 
60  static Int_t StaticSearch(const TH1 *hist, Double_t sigma=2, Option_t *option="goff", Double_t threshold=0.05);
61  static TH1 *StaticBackground(const TH1 *hist,Int_t niter=20, Option_t *option="");
62 
63  ClassDef(TSpectrum2,1) //Peak Finder, background estimator, Deconvolution for 2-D histograms
64 };
65 
66 #endif
67 
const char * Deconvolution(Double_t **source, Double_t **resp, Int_t ssizex, Int_t ssizey, Int_t numberIterations, Int_t numberRepetitions, Double_t boost)
This function calculates deconvolution from source spectrum according to response spectrum The result...
Double_t * fPositionY
[fNPeaks] Y position of peaks
Definition: TSpectrum2.h:26
const char Option_t
Definition: RtypesCore.h:62
Advanced 2-dimensional spectra processing.
Definition: TSpectrum2.h:20
static Int_t fgAverageWindow
Average window of searched peaks.
Definition: TSpectrum2.h:29
TH1 * fHistogram
resulting histogram
Definition: TSpectrum2.h:28
static void SetDeconIterations(Int_t n=3)
static function: Set max number of decon iterations in deconvolution operation see TSpectrum2::Search...
Definition: TSpectrum2.cxx:113
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Double_t fResolution
NOT USED resolution of the neighboring peaks
Definition: TSpectrum2.h:27
void SetResolution(Double_t resolution=1)
NOT USED resolution: determines resolution of the neighboring peaks default value is 1 correspond to ...
Definition: TSpectrum2.cxx:287
Int_t GetNPeaks() const
Definition: TSpectrum2.h:45
#define ClassDef(name, id)
Definition: Rtypes.h:254
Int_t fNPeaks
number of peaks found
Definition: TSpectrum2.h:23
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
Double_t * GetPositionX() const
Definition: TSpectrum2.h:46
Double_t * GetPositionY() const
Definition: TSpectrum2.h:47
TH1 * GetHistogram() const
Definition: TSpectrum2.h:44
const Double_t sigma
Int_t fMaxPeaks
Maximum number of peaks to be found.
Definition: TSpectrum2.h:22
Double_t * fPositionX
[fNPeaks] X position of peaks
Definition: TSpectrum2.h:25
#define dest(otri, vertexptr)
Definition: triangle.c:1040
static void SetAverageWindow(Int_t w=3)
static function: Set average window of searched peaks see TSpectrum2::SearchHighRes ...
Definition: TSpectrum2.cxx:104
LVector boost(const LVector &v, const BoostVector &b)
Boost a generic Lorentz Vector class using a generic 3D Vector class describing the boost The only re...
Definition: VectorUtil.h:329
TSpectrum2()
Constructor.
Definition: TSpectrum2.cxx:57
virtual void Print(Option_t *option="") const
Print the array of positions.
Definition: TSpectrum2.cxx:166
static Int_t StaticSearch(const TH1 *hist, Double_t sigma=2, Option_t *option="goff", Double_t threshold=0.05)
static function (called by TH1), interface to TSpectrum2::Search
Double_t * fPosition
[fNPeaks] array of current peak positions
Definition: TSpectrum2.h:24
double Double_t
Definition: RtypesCore.h:55
virtual ~TSpectrum2()
Destructor.
Definition: TSpectrum2.cxx:92
The TH1 histogram class.
Definition: TH1.h:80
const char * SmoothMarkov(Double_t **source, Int_t ssizex, Int_t ssizey, Int_t averWindow)
This function calculates smoothed spectrum from source spectrum based on Markov chain method...
Definition: TSpectrum2.cxx:736
static TH1 * StaticBackground(const TH1 *hist, Int_t niter=20, Option_t *option="")
static function (called by TH1), interface to TSpectrum2::Background
virtual TH1 * Background(const TH1 *hist, Int_t niter=20, Option_t *option="")
This function calculates the background spectrum in the input histogram h.
Definition: TSpectrum2.cxx:155
Int_t SearchHighRes(Double_t **source, Double_t **dest, Int_t ssizex, Int_t ssizey, Double_t sigma, Double_t threshold, Bool_t backgroundRemove, Int_t deconIterations, Bool_t markov, Int_t averWindow)
This function searches for peaks in source spectrum It is based on deconvolution method.
const Int_t n
Definition: legend1.C:16
static Int_t fgIterations
Maximum number of decon iterations (default=3)
Definition: TSpectrum2.h:30
virtual Int_t Search(const TH1 *hist, Double_t sigma=2, Option_t *option="", Double_t threshold=0.05)
This function searches for peaks in source spectrum in hin The number of found peaks and their positi...
Definition: TSpectrum2.cxx:206