TSpectrum2.h

Go to the documentation of this file.
00001 // @(#)root/spectrum:$Id: TSpectrum2.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Miroslav Morhac   17/01/2006
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_TSpectrum2
00012 #define ROOT_TSpectrum2
00013 
00014 #ifndef ROOT_TNamed
00015 #include "TNamed.h"
00016 #endif
00017 
00018 class TH1;
00019 
00020 class TSpectrum2 : public TNamed {
00021 protected:
00022    Int_t         fMaxPeaks;       //Maximum number of peaks to be found
00023    Int_t         fNPeaks;         //number of peaks found
00024    Float_t      *fPosition;       //[fNPeaks] array of current peak positions
00025    Float_t      *fPositionX;      //[fNPeaks] X position of peaks
00026    Float_t      *fPositionY;      //[fNPeaks] Y position of peaks
00027    Float_t       fResolution;     //resolution of the neighboring peaks
00028    TH1          *fHistogram;      //resulting histogram
00029 static Int_t     fgAverageWindow; //Average window of searched peaks
00030 static Int_t     fgIterations;    //Maximum number of decon iterations (default=3)
00031 
00032 public:
00033    enum {
00034        kBackIncreasingWindow =0,
00035        kBackDecreasingWindow =1,
00036        kBackSuccessiveFiltering =0,
00037        kBackOneStepFiltering =1
00038    };
00039 
00040    TSpectrum2();
00041    TSpectrum2(Int_t maxpositions, Float_t resolution=1);
00042    virtual ~TSpectrum2();
00043    virtual TH1  *Background(const TH1 *hist,int niter=20, Option_t *option="");
00044    TH1          *GetHistogram() const {return fHistogram;}
00045    Int_t         GetNPeaks() const {return fNPeaks;}
00046    Float_t      *GetPositionX() const {return fPositionX;}
00047    Float_t      *GetPositionY() const {return fPositionY;}
00048    virtual void  Print(Option_t *option="") const;
00049    virtual Int_t Search(const TH1 *hist, Double_t sigma=2, Option_t *option="", Double_t threshold=0.05);
00050    static void   SetAverageWindow(Int_t w=3);   //set average window
00051    static void   SetDeconIterations(Int_t n=3); //set max number of decon iterations
00052    void          SetResolution(Float_t resolution=1);
00053 
00054    //new functions January 2006
00055    const char   *Background(float **spectrum,Int_t ssizex, Int_t ssizey,Int_t numberIterationsX,Int_t numberIterationsY,Int_t direction,Int_t filterType);   
00056    const char   *SmoothMarkov(float **source, Int_t ssizex, Int_t ssizey, Int_t averWindow);   
00057    const char   *Deconvolution(float **source, float **resp, Int_t ssizex, Int_t ssizey,Int_t numberIterations, Int_t numberRepetitions, Double_t boost);
00058    Int_t         SearchHighRes(float **source,float **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);
00059 
00060    static Int_t        StaticSearch(const TH1 *hist, Double_t sigma=2, Option_t *option="goff", Double_t threshold=0.05);
00061    static TH1         *StaticBackground(const TH1 *hist,Int_t niter=20, Option_t *option="");
00062 
00063    ClassDef(TSpectrum2,1)  //Peak Finder, background estimator, Deconvolution for 2-D histograms
00064 };
00065 
00066 #endif
00067 

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