ROOT logo
#ifndef FINDPEAKDIALOG
#define FINDPEAKDIALOG
#include "TH1.h"
#include "TVirtualPad.h"
#include "TPad.h"
#include "TRootCanvas.h"
#include "TString.h"
#include "FhMarker.h"
#include "TGMrbValuesAndText.h"
//_____________________________________________________________________________________


class FindPeakDialog : public TObject {

private:
   Int_t fInteractive;
   TRootCanvas* fParentWindow; 
   TGMrbValuesAndText *fDialog;
   TString fFuncName;
   TVirtualPad *fSelPad;
   TH1     *fSelHist;
   TString fName;
	TString fPeakListName;
	FhMarkerList * fMarkers;
   Double_t fFrom;               // Used range, lower value
   Double_t fTo;                 // Used range, upper value
   Double_t fThreshold;          // Minimum peaks size used, unit: fraction compared to highest peak in range
                                 // Note: If height of peaks vary strongly use several ranges
                                 //       use dont clear list (see below)
   Double_t fSigma;              // Assumed peakwidth
   Double_t fTwoPeakSeparation;  // mimimum separation of two peaks, unit: sigma
   Int_t    fMarkow;					// use Markow algorithm
   Int_t    fRemoveBG;           // remove background before deconvolution
   Int_t    fShowMarkers;        // draw polymarker at found peak
   Int_t    fFindPeakDone;       // number of peaksearches executed
   Int_t    fUseTSpectrum ;      // trigger TSpectrum method
   Int_t    fUseSQWaveFold;      // trigger Square wave convolution  method
   Double_t fThresholdSigma;     // threshold in Square wave folding search
   Double_t fPeakMwidth;         // width Square wave folding search

   Int_t    fUseTSpectrumEntry ;
   Int_t    fUseSQWaveFoldEntry;
   Int_t    fThresholdEntry;
   Int_t    fSigmaEntry;
   Int_t    fMarkowEntry;
   Int_t    fRemoveBGEntry;
   Int_t    fThresholdSigmaEntry;
   Int_t    fPeakMwidthEntry;

public:
   FindPeakDialog(TH1 * hist, Int_t interactive =1);
   virtual ~FindPeakDialog();
   void RecursiveRemove(TObject * obj);
   void ExecuteFindPeak();
   void ClearList();
	void PrintList();
	void ReadList();
	Int_t FindPeakDone() { return fFindPeakDone; };
   void SaveDefaults();
   void RestoreDefaults();
   void CloseDialog();
   void CloseDown(Int_t wid);
   void CRButtonPressed(Int_t, Int_t, TObject*);
   void SetFrom( Double_t from) { fFrom = from; };
   void SetTo( Double_t to) { fTo = to; };
   void SetThreshold( Double_t threshold) { fThreshold = threshold; };
   void SetSigma( Double_t sigma) { fSigma = sigma; };
   void SetTwoPeakSeparation( Double_t twopeakseparation) { fTwoPeakSeparation = twopeakseparation; };
   void SetMarkow( Int_t markow) { fMarkow = markow; };
   void SetRemoveBG( Int_t removebg) { fRemoveBG = removebg; };
   void SetShowMarkers( Int_t showmarkers) { fShowMarkers = showmarkers; };
   void SetUseTSpectrum() {fUseTSpectrum =1; fUseSQWaveFold =0;};
   void SetUseSQWaveFold() {fUseTSpectrum =0; fUseSQWaveFold =1;};
   void SetThresholdSigma(Double_t val) {fThresholdSigma = val;};
   void SetPeakMwidth(Int_t val) {fPeakMwidth = val;};
   Double_t GetFrom() { return fFrom; };
   Double_t GetTo() { return fTo; };
   Double_t GetThreshold() { return fThreshold; };
   Double_t GetSigma() { return fSigma; };
   Double_t GetTwoPeakSeparation() { return fTwoPeakSeparation; };
   Int_t GetMarkow() { return fMarkow; };
   Int_t GetRemoveBG() { return fRemoveBG; };
   Int_t GetShowMarkers() { return fShowMarkers; };
   Int_t GetUseTSpectrum() {return fUseTSpectrum;};
   Int_t GetUseSQWaveFold() {return fUseSQWaveFold;};
   Double_t GetThresholdSigma() {return fThresholdSigma;};
   Int_t GetPeakMwidth() {return (Int_t)fPeakMwidth;};

ClassDef(FindPeakDialog,0)
};
#endif
 FindPeakDialog.h:1
 FindPeakDialog.h:2
 FindPeakDialog.h:3
 FindPeakDialog.h:4
 FindPeakDialog.h:5
 FindPeakDialog.h:6
 FindPeakDialog.h:7
 FindPeakDialog.h:8
 FindPeakDialog.h:9
 FindPeakDialog.h:10
 FindPeakDialog.h:11
 FindPeakDialog.h:12
 FindPeakDialog.h:13
 FindPeakDialog.h:14
 FindPeakDialog.h:15
 FindPeakDialog.h:16
 FindPeakDialog.h:17
 FindPeakDialog.h:18
 FindPeakDialog.h:19
 FindPeakDialog.h:20
 FindPeakDialog.h:21
 FindPeakDialog.h:22
 FindPeakDialog.h:23
 FindPeakDialog.h:24
 FindPeakDialog.h:25
 FindPeakDialog.h:26
 FindPeakDialog.h:27
 FindPeakDialog.h:28
 FindPeakDialog.h:29
 FindPeakDialog.h:30
 FindPeakDialog.h:31
 FindPeakDialog.h:32
 FindPeakDialog.h:33
 FindPeakDialog.h:34
 FindPeakDialog.h:35
 FindPeakDialog.h:36
 FindPeakDialog.h:37
 FindPeakDialog.h:38
 FindPeakDialog.h:39
 FindPeakDialog.h:40
 FindPeakDialog.h:41
 FindPeakDialog.h:42
 FindPeakDialog.h:43
 FindPeakDialog.h:44
 FindPeakDialog.h:45
 FindPeakDialog.h:46
 FindPeakDialog.h:47
 FindPeakDialog.h:48
 FindPeakDialog.h:49
 FindPeakDialog.h:50
 FindPeakDialog.h:51
 FindPeakDialog.h:52
 FindPeakDialog.h:53
 FindPeakDialog.h:54
 FindPeakDialog.h:55
 FindPeakDialog.h:56
 FindPeakDialog.h:57
 FindPeakDialog.h:58
 FindPeakDialog.h:59
 FindPeakDialog.h:60
 FindPeakDialog.h:61
 FindPeakDialog.h:62
 FindPeakDialog.h:63
 FindPeakDialog.h:64
 FindPeakDialog.h:65
 FindPeakDialog.h:66
 FindPeakDialog.h:67
 FindPeakDialog.h:68
 FindPeakDialog.h:69
 FindPeakDialog.h:70
 FindPeakDialog.h:71
 FindPeakDialog.h:72
 FindPeakDialog.h:73
 FindPeakDialog.h:74
 FindPeakDialog.h:75
 FindPeakDialog.h:76
 FindPeakDialog.h:77
 FindPeakDialog.h:78
 FindPeakDialog.h:79
 FindPeakDialog.h:80
 FindPeakDialog.h:81
 FindPeakDialog.h:82
 FindPeakDialog.h:83
 FindPeakDialog.h:84
 FindPeakDialog.h:85
 FindPeakDialog.h:86
 FindPeakDialog.h:87
 FindPeakDialog.h:88
 FindPeakDialog.h:89
 FindPeakDialog.h:90
 FindPeakDialog.h:91