00001
00002
00003
00004
00005
00006
00007
00008
00009
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&);
00024 TSpectrum& operator=(const TSpectrum&);
00025
00026 protected:
00027 Int_t fMaxPeaks;
00028 Int_t fNPeaks;
00029 Float_t *fPosition;
00030 Float_t *fPositionX;
00031 Float_t *fPositionY;
00032 Float_t fResolution;
00033 TH1 *fHistogram;
00034 static Int_t fgAverageWindow;
00035 static Int_t fgIterations;
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);
00065 static void SetDeconIterations(Int_t n=3);
00066 void SetResolution(Float_t resolution=1);
00067
00068
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)
00081 };
00082
00083 #endif
00084