#ifndef ROOT_TSpectrum2
#define ROOT_TSpectrum2
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
class TH1;
class TSpectrum2 : public TNamed {
protected:
Int_t fMaxPeaks;
Int_t fNPeaks;
Double_t *fPosition;
Double_t *fPositionX;
Double_t *fPositionY;
Double_t fResolution;
TH1 *fHistogram;
static Int_t fgAverageWindow;
static Int_t fgIterations;
public:
enum {
kBackIncreasingWindow =0,
kBackDecreasingWindow =1,
kBackSuccessiveFiltering =0,
kBackOneStepFiltering =1
};
TSpectrum2();
TSpectrum2(Int_t maxpositions, Double_t resolution=1);
virtual ~TSpectrum2();
virtual TH1 *Background(const TH1 *hist, Int_t niter=20, Option_t *option="");
TH1 *GetHistogram() const {return fHistogram;}
Int_t GetNPeaks() const {return fNPeaks;}
Double_t *GetPositionX() const {return fPositionX;}
Double_t *GetPositionY() const {return fPositionY;}
virtual void Print(Option_t *option="") const;
virtual Int_t Search(const TH1 *hist, Double_t sigma=2, Option_t *option="", Double_t threshold=0.05);
static void SetAverageWindow(Int_t w=3);
static void SetDeconIterations(Int_t n=3);
void SetResolution(Double_t resolution=1);
const char *Background(Double_t **spectrum,Int_t ssizex, Int_t ssizey,Int_t numberIterationsX,Int_t numberIterationsY,Int_t direction,Int_t filterType);
const char *SmoothMarkov(Double_t **source, Int_t ssizex, Int_t ssizey, Int_t averWindow);
const char *Deconvolution(Double_t **source, Double_t **resp, Int_t ssizex, Int_t ssizey,Int_t numberIterations, Int_t numberRepetitions, Double_t boost);
Int_t SearchHighRes(Double_t **source,Double_t **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);
static Int_t StaticSearch(const TH1 *hist, Double_t sigma=2, Option_t *option="goff", Double_t threshold=0.05);
static TH1 *StaticBackground(const TH1 *hist,Int_t niter=20, Option_t *option="");
ClassDef(TSpectrum2,1)
};
#endif