00001
00002
00003
00004
00005
00006
00007
00008
00009
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;
00023 Int_t fNPeaks;
00024 Float_t *fPosition;
00025 Float_t *fPositionX;
00026 Float_t *fPositionY;
00027 Float_t fResolution;
00028 TH1 *fHistogram;
00029 static Int_t fgAverageWindow;
00030 static Int_t fgIterations;
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);
00051 static void SetDeconIterations(Int_t n=3);
00052 void SetResolution(Float_t resolution=1);
00053
00054
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)
00064 };
00065
00066 #endif
00067