TSpectrum.h

Go to the documentation of this file.
00001 // @(#)root/spectrum:$Id: TSpectrum.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Miroslav Morhac   27/05/99
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 #ifndef ROOT_TSpectrum
00012 #define ROOT_TSpectrum
00013 
00014 #ifndef ROOT_TNamed
00015 #include "TNamed.h"
00016 #endif
00017 
00018 class TH1;
00019 
00020 class TSpectrum : public TNamed {
00021 private:
00022 
00023    TSpectrum(const TSpectrum&); // Not implemented
00024    TSpectrum& operator=(const TSpectrum&); // Not implemented
00025 
00026 protected:
00027    Int_t         fMaxPeaks;       //Maximum number of peaks to be found
00028    Int_t         fNPeaks;         //number of peaks found
00029    Float_t      *fPosition;       //[fNPeaks] array of current peak positions
00030    Float_t      *fPositionX;      //[fNPeaks] X position of peaks
00031    Float_t      *fPositionY;      //[fNPeaks] Y position of peaks
00032    Float_t       fResolution;     //resolution of the neighboring peaks
00033    TH1          *fHistogram;      //resulting histogram
00034 static Int_t     fgAverageWindow; //Average window of searched peaks
00035 static Int_t     fgIterations;    //Maximum number of decon iterations (default=3)
00036 
00037 public:
00038    enum {
00039        kBackOrder2 =0,
00040        kBackOrder4 =1,
00041        kBackOrder6 =2,
00042        kBackOrder8 =3,
00043        kBackIncreasingWindow =0,
00044        kBackDecreasingWindow =1,
00045        kBackSmoothing3 =3,
00046        kBackSmoothing5 =5,
00047        kBackSmoothing7 =7,
00048        kBackSmoothing9 =9,
00049        kBackSmoothing11 =11,
00050        kBackSmoothing13 =13,
00051        kBackSmoothing15 =15
00052    };
00053 
00054    TSpectrum();
00055    TSpectrum(Int_t maxpositions, Float_t resolution=1);
00056    virtual ~TSpectrum();
00057    virtual TH1        *Background(const TH1 *hist,Int_t niter=20, Option_t *option="");
00058    TH1                *GetHistogram() const {return fHistogram;}
00059    Int_t               GetNPeaks() const {return fNPeaks;}
00060    Float_t            *GetPositionX() const {return fPositionX;}
00061    Float_t            *GetPositionY() const {return fPositionY;}
00062    virtual void        Print(Option_t *option="") const;
00063    virtual Int_t       Search(const TH1 *hist, Double_t sigma=2, Option_t *option="", Double_t threshold=0.05);
00064    static void         SetAverageWindow(Int_t w=3);   //set average window
00065    static void         SetDeconIterations(Int_t n=3); //set max number of decon iterations
00066    void                SetResolution(Float_t resolution=1);
00067 
00068    //new functions January 2006
00069    const char         *Background(float *spectrum, Int_t ssize,Int_t numberIterations,Int_t direction, Int_t filterOrder,bool smoothing,Int_t smoothWindow,bool compton);
00070    const char         *SmoothMarkov(float *source, Int_t ssize, Int_t averWindow);   
00071    const char         *Deconvolution(float *source, const float *response,Int_t ssize, Int_t numberIterations,Int_t numberRepetitions, Double_t boost );    
00072    const char         *DeconvolutionRL(float *source, const float *response,Int_t ssize, Int_t numberIterations,Int_t numberRepetitions, Double_t boost );    
00073    const char         *Unfolding(float *source,const float **respMatrix,Int_t ssizex, Int_t ssizey,Int_t numberIterations,Int_t numberRepetitions, Double_t boost);    
00074    Int_t               SearchHighRes(float *source,float *destVector, Int_t ssize,float sigma, Double_t threshold,bool backgroundRemove,Int_t deconIterations,bool markov, Int_t averWindow);   
00075    Int_t               Search1HighRes(float *source,float *destVector, Int_t ssize,float sigma, Double_t threshold,bool backgroundRemove,Int_t deconIterations,bool markov, Int_t averWindow);   
00076 
00077    static Int_t        StaticSearch(const TH1 *hist, Double_t sigma=2, Option_t *option="goff", Double_t threshold=0.05);
00078    static TH1         *StaticBackground(const TH1 *hist,Int_t niter=20, Option_t *option="");
00079 
00080    ClassDef(TSpectrum,3)  //Peak Finder, background estimator, Deconvolution
00081 };
00082 
00083 #endif
00084 

Generated on Tue Jul 5 14:24:32 2011 for ROOT_528-00b_version by  doxygen 1.5.1