ROOT  6.06/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; //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);
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);
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)
TWO-DIMENSIONAL DECONVOLUTION FUNCTION This function calculates deconvolution from source spectrum ac...
Double_t * fPositionY
Definition: TSpectrum2.h:26
const char Option_t
Definition: RtypesCore.h:62
Advanced 2-dimentional spectra processing.
Definition: TSpectrum2.h:20
static Int_t fgAverageWindow
Definition: TSpectrum2.h:29
TH1 * fHistogram
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:158
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Double_t fResolution
Definition: TSpectrum2.h:27
void SetResolution(Double_t resolution=1)
resolution: determines resolution of the neighboring peaks default value is 1 correspond to 3 sigma d...
Definition: TSpectrum2.cxx:339
Int_t GetNPeaks() const
Definition: TSpectrum2.h:45
#define ClassDef(name, id)
Definition: Rtypes.h:254
Int_t fNPeaks
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
Int_t fMaxPeaks
Definition: TSpectrum2.h:22
Double_t * fPositionX
Definition: TSpectrum2.h:25
static void SetAverageWindow(Int_t w=3)
static function: Set average window of searched peaks see TSpectrum2::SearchHighRes ...
Definition: TSpectrum2.cxx:149
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
virtual void Print(Option_t *option="") const
Print the array of positions.
Definition: TSpectrum2.cxx:214
static Int_t StaticSearch(const TH1 *hist, Double_t sigma=2, Option_t *option="goff", Double_t threshold=0.05)
static function, interface to TSpectrum2::Search
Double_t * fPosition
Definition: TSpectrum2.h:24
double Double_t
Definition: RtypesCore.h:55
virtual ~TSpectrum2()
Destructor.
Definition: TSpectrum2.cxx:136
The TH1 histogram class.
Definition: TH1.h:80
const char * SmoothMarkov(Double_t **source, Int_t ssizex, Int_t ssizey, Int_t averWindow)
TWO-DIMENSIONAL MARKOV SPECTRUM SMOOTHING FUNCTION.
#define dest(otri, vertexptr)
Definition: triangle.c:1040
static TH1 * StaticBackground(const TH1 *hist, Int_t niter=20, Option_t *option="")
static function, interface to TSpectrum2::Background
virtual TH1 * Background(const TH1 *hist, Int_t niter=20, Option_t *option="")
TWO-DIMENSIONAL BACKGROUND ESTIMATION FUNCTION // This function calculates the background spectrum in...
Definition: TSpectrum2.cxx:203
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)
const Int_t n
Definition: legend1.C:16
static Int_t fgIterations
Definition: TSpectrum2.h:30
virtual Int_t Search(const TH1 *hist, Double_t sigma=2, Option_t *option="", Double_t threshold=0.05)
TWO-DIMENSIONAL PEAK SEARCH FUNCTION // This function searches for peaks in source spectrum in hin //...
Definition: TSpectrum2.cxx:258