ROOT  6.06/09
Reference Guide
TSpectrum.h
Go to the documentation of this file.
1 // @(#)root/spectrum:$Id$
2 // Author: Miroslav Morhac 27/05/99
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_TSpectrum
12 #define ROOT_TSpectrum
13 
14 #ifndef ROOT_TNamed
15 #include "TNamed.h"
16 #endif
17 
18 class TH1;
19 
20 class TSpectrum : public TNamed {
21 private:
22 
23  TSpectrum(const TSpectrum&); // Not implemented
24  TSpectrum& operator=(const TSpectrum&); // Not implemented
25 
26 protected:
27  Int_t fMaxPeaks; //Maximum number of peaks to be found
28  Int_t fNPeaks; //number of peaks found
29  Double_t *fPosition; //[fNPeaks] array of current peak positions
30  Double_t *fPositionX; //[fNPeaks] X position of peaks
31  Double_t *fPositionY; //[fNPeaks] Y position of peaks
32  Double_t fResolution; //resolution of the neighboring peaks
33  TH1 *fHistogram; //resulting histogram
34 static Int_t fgAverageWindow; //Average window of searched peaks
35 static Int_t fgIterations; //Maximum number of decon iterations (default=3)
36 
37 public:
38  enum {
52  };
53 
54  TSpectrum();
55  TSpectrum(Int_t maxpositions, Double_t resolution=1);
56  virtual ~TSpectrum();
57  virtual TH1 *Background(const TH1 *hist,Int_t niter=20, Option_t *option="");
58  TH1 *GetHistogram() const {return fHistogram;}
59  Int_t GetNPeaks() const {return fNPeaks;}
60  Double_t *GetPositionX() const {return fPositionX;}
61  Double_t *GetPositionY() const {return fPositionY;}
62  virtual void Print(Option_t *option="") const;
63  virtual Int_t Search(const TH1 *hist, Double_t sigma=2, Option_t *option="", Double_t threshold=0.05);
64  static void SetAverageWindow(Int_t w=3); //set average window
65  static void SetDeconIterations(Int_t n=3); //set max number of decon iterations
66  void SetResolution(Double_t resolution=1);
67 
68  //new functions January 2006
69  const char *Background(Double_t *spectrum, Int_t ssize,Int_t numberIterations,Int_t direction, Int_t filterOrder,bool smoothing,Int_t smoothWindow,bool compton);
70  const char *SmoothMarkov(Double_t *source, Int_t ssize, Int_t averWindow);
71  const char *Deconvolution(Double_t *source, const Double_t *response,Int_t ssize, Int_t numberIterations,Int_t numberRepetitions, Double_t boost );
72  const char *DeconvolutionRL(Double_t *source, const Double_t *response,Int_t ssize, Int_t numberIterations,Int_t numberRepetitions, Double_t boost );
73  const char *Unfolding(Double_t *source,const Double_t **respMatrix,Int_t ssizex, Int_t ssizey,Int_t numberIterations,Int_t numberRepetitions, Double_t boost);
74  Int_t SearchHighRes(Double_t *source,Double_t *destVector, Int_t ssize,Double_t sigma, Double_t threshold,bool backgroundRemove,Int_t deconIterations,bool markov, Int_t averWindow);
75  Int_t Search1HighRes(Double_t *source,Double_t *destVector, Int_t ssize,Double_t sigma, Double_t threshold,bool backgroundRemove,Int_t deconIterations,bool markov, Int_t averWindow);
76 
77  static Int_t StaticSearch(const TH1 *hist, Double_t sigma=2, Option_t *option="goff", Double_t threshold=0.05);
78  static TH1 *StaticBackground(const TH1 *hist,Int_t niter=20, Option_t *option="");
79 
80  ClassDef(TSpectrum,3) //Peak Finder, background estimator, Deconvolution
81 };
82 
83 #endif
84 
Int_t Search1HighRes(Double_t *source, Double_t *destVector, Int_t ssize, Double_t sigma, Double_t threshold, bool backgroundRemove, Int_t deconIterations, bool markov, Int_t averWindow)
Definition: TSpectrum.cxx:3318
const char Option_t
Definition: RtypesCore.h:62
static TH1 * StaticBackground(const TH1 *hist, Int_t niter=20, Option_t *option="")
Definition: TSpectrum.cxx:3348
const char * DeconvolutionRL(Double_t *source, const Double_t *response, Int_t ssize, Int_t numberIterations, Int_t numberRepetitions, Double_t boost)
Definition: TSpectrum.cxx:2114
int Int_t
Definition: RtypesCore.h:41
TH1 * GetHistogram() const
Definition: TSpectrum.h:58
Double_t * GetPositionY() const
Definition: TSpectrum.h:61
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
Double_t * fPositionX
Definition: TSpectrum.h:30
Int_t SearchHighRes(Double_t *source, Double_t *destVector, Int_t ssize, Double_t sigma, Double_t threshold, bool backgroundRemove, Int_t deconIterations, bool markov, Int_t averWindow)
Definition: TSpectrum.cxx:2640
virtual Int_t Search(const TH1 *hist, Double_t sigma=2, Option_t *option="", Double_t threshold=0.05)
Definition: TSpectrum.cxx:277
virtual ~TSpectrum()
Definition: TSpectrum.cxx:113
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
TH1 * fHistogram
Definition: TSpectrum.h:33
Double_t * fPositionY
Definition: TSpectrum.h:31
const char * Deconvolution(Double_t *source, const Double_t *response, Int_t ssize, Int_t numberIterations, Int_t numberRepetitions, Double_t boost)
Definition: TSpectrum.cxx:1666
static void SetAverageWindow(Int_t w=3)
Definition: TSpectrum.cxx:128
static Int_t fgAverageWindow
Definition: TSpectrum.h:34
static void SetDeconIterations(Int_t n=3)
Definition: TSpectrum.cxx:141
Double_t * GetPositionX() const
Definition: TSpectrum.h:60
double Double_t
Definition: RtypesCore.h:55
virtual TH1 * Background(const TH1 *hist, Int_t niter=20, Option_t *option="")
Definition: TSpectrum.cxx:154
static Int_t fgIterations
Definition: TSpectrum.h:35
Int_t fMaxPeaks
Definition: TSpectrum.h:27
The TH1 histogram class.
Definition: TH1.h:80
void SetResolution(Double_t resolution=1)
Definition: TSpectrum.cxx:397
Advanced Spectra Processing.
Definition: TSpectrum.h:20
Int_t GetNPeaks() const
Definition: TSpectrum.h:59
TSpectrum & operator=(const TSpectrum &)
Double_t * fPosition
Definition: TSpectrum.h:29
virtual void Print(Option_t *option="") const
Print TNamed name and title.
Definition: TSpectrum.cxx:262
static Int_t StaticSearch(const TH1 *hist, Double_t sigma=2, Option_t *option="goff", Double_t threshold=0.05)
Definition: TSpectrum.cxx:3335
Int_t fNPeaks
Definition: TSpectrum.h:28
const char * SmoothMarkov(Double_t *source, Int_t ssize, Int_t averWindow)
Definition: TSpectrum.cxx:1522
const Int_t n
Definition: legend1.C:16
const char * Unfolding(Double_t *source, const Double_t **respMatrix, Int_t ssizex, Int_t ssizey, Int_t numberIterations, Int_t numberRepetitions, Double_t boost)
Definition: TSpectrum.cxx:2378
Double_t fResolution
Definition: TSpectrum.h:32