TPeakFindPanel.h

Go to the documentation of this file.
00001 /*********************************************************************
00002  
00003   Name:         TPeakFindPanel.cxx
00004   Created by:   Greg King
00005   $Id$
00006  
00007   Contents:     New Peak Find Panel
00008 
00009 *********************************************************************/
00010 
00011 #ifndef TPEAKFINDPANEL_H
00012 #define TPEAKFINDPANEL_H
00013 
00014 #include <iostream>
00015 
00016 #ifndef ROOT_TGFrame
00017 #include "TGFrame.h"
00018 #endif
00019 
00020 #include "TROOT.h"
00021 #include "TVirtualX.h"
00022 #include "TGResourcePool.h"
00023 #include "TGClient.h"
00024 #include "TGIcon.h"
00025 #include "TGLabel.h"
00026 #include "TGButton.h"
00027 #include "TGTextEntry.h"
00028 #include "TGNumberEntry.h"
00029 #include "TGMsgBox.h"
00030 #include "TGMenu.h"
00031 #include "TGCanvas.h"
00032 #include "TGComboBox.h"
00033 #include "TGSlider.h"
00034 #include "TGDoubleSlider.h"
00035 #include "RQ_OBJECT.h"
00036 #include "TGLayout.h"
00037 #include "TH1.h"
00038 #include "TF1.h"
00039 #include "TFitter.h"
00040 #include "TVirtualFitter.h"
00041 #include "TCanvas.h"
00042 #include "TRandom.h"
00043 #include "TGTab.h"
00044 #include "TList.h"
00045 #include "TGStatusBar.h"
00046 #include "TSpectrum.h"
00047 #include "TPolyMarker.h"
00048 
00049 class TPeakFindPanel : public TGTransientFrame
00050 {
00051 private:
00052   TGNumberEntry *fNumberOfPeaksNE, *fResolutionNE, *fSigmaNE, *fThresholdNE;
00053   TGCheckButton *fAttemptFitCB, *fAddPolyFitCB, *fDoUnzoomCB;
00054   TGTextButton *fFindTB, *fDefaultsTB, *fCloseTB, *fClearPolyTB;
00055   TGVerticalFrame *fMainFrame;
00056   TGHorizontalFrame *fNumberOfPeaksHF, *fResolutionHF, *fSigmaHF, *fThresholdHF;
00057   TGHorizontalFrame *fFindDefaultsHF, *fCloseClearPolyHF;
00058   TSpectrum *fSpectrum;
00059 
00060   Int_t fNfound;
00061   Float_t *fXpeaks; //! [fNfound]
00062   Float_t *fYpeaks; //!
00063 
00064   void FindPeak();
00065   void DrawPeak();
00066   void LayoutGUI();
00067   void LayoutMenuBar();
00068   void GetXYBounds( Double_t &, Double_t & );
00069   void InsertionSort( Float_t *, Float_t *, Int_t, Int_t );
00070   void Clear();
00071   void SetDefaults();
00072   TH1* GetHistogram();
00073 
00074 protected:
00075   enum ECommandIdentifiers
00076   {
00077       M_FILE_EXIT,
00078       M_ATTEMPT_FIT_PEAKS_BUTTON,
00079       M_ADD_POLY_BUTTON,
00080       M_DO_UNZOOM_BUTTON,
00081       M_FIND_BUTTON,
00082       M_DEFAULT_BUTTON,
00083       M_CLOSE_BUTTON,
00084       M_CLEAR_BUTTON,
00085       M_NUMBER_ENTRY_PEAKS,
00086       M_NUMBER_ENTRY_RESOLUTION,
00087       M_NUMBER_ENTRY_SIGMA,
00088       M_NUMBER_ENTRY_THRESHOLD
00089   };
00090 
00091   Double_t fSigma, fThreshold;
00092   Float_t fResolution;
00093   Int_t fNumberOfPeaks;
00094   TF1 *fFit;
00095   Bool_t fDoFit, fAddPoly, fDoUnzoom;
00096 
00097 public:
00098   TPeakFindPanel( TGWindow const *, TGWindow const *, UInt_t, UInt_t );
00099   virtual ~TPeakFindPanel();
00100 
00101   virtual void CloseWindow();
00102   virtual Bool_t ProcessMessage( Long_t, Long_t, Long_t );
00103 
00104   ClassDef( TPeakFindPanel, 1 );
00105 };
00106 
00107 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends

Generated on 15 Nov 2016 for Roody by  doxygen 1.6.1