TPeakFindPanel.h

Go to the documentation of this file.
00001 /*********************************************************************
00002  
00003   Name:         TPeakFindPanel.cxx
00004   Created by:   Greg King
00005  
00006   Contents:     New Peak Find Panel
00007  
00008   $Log$
00009   Revision 1.2  2006/06/12 20:11:47  midas
00010   add unzoom option
00011 
00012   Revision 1.1  2005/11/29 19:29:36  chuma
00013   Added directories:  lib/, include/ and /mxml and their files.
00014   Added Makefile.
00015 
00016   Revision 1.2  2004/05/08 01:54:09  olchansk
00017   operate always on the histogram in the current pad
00018 
00019   Revision 1.1  2004/04/08 17:27:40  chuma
00020   Peak find added to context menu for right click on histograms.
00021   Updated TPeakFindPanel sources added to cvs at the same level as
00022   TTriumfFileGUI sources.  Clear All online histograms added to menu.
00023 
00024   Revision 1.1  2004/03/10 17:56:41  chuma
00025   Added TPeakFindPanel to CVS.  Peak finding works with the current pad only.
00026 
00027   Revision 1.1.1.1  2003/08/26 17:05:28  gking
00028   Initial Release of TPeakFindPanel
00029 
00030 
00031 *********************************************************************/
00032 
00033 #ifndef TPEAKFINDPANEL_H
00034 #define TPEAKFINDPANEL_H
00035 
00036 #include <iostream>
00037 
00038 #ifndef ROOT_TGFrame
00039 #include "TGFrame.h"
00040 #endif
00041 
00042 #include "TROOT.h"
00043 #include "TVirtualX.h"
00044 #include "TGResourcePool.h"
00045 #include "TGClient.h"
00046 #include "TGIcon.h"
00047 #include "TGLabel.h"
00048 #include "TGButton.h"
00049 #include "TGTextEntry.h"
00050 #include "TGNumberEntry.h"
00051 #include "TGMsgBox.h"
00052 #include "TGMenu.h"
00053 #include "TGCanvas.h"
00054 #include "TGComboBox.h"
00055 #include "TGSlider.h"
00056 #include "TGDoubleSlider.h"
00057 #include "RQ_OBJECT.h"
00058 #include "TGLayout.h"
00059 #include "TH1.h"
00060 #include "TF1.h"
00061 #include "TFitter.h"
00062 #include "TVirtualFitter.h"
00063 #include "TCanvas.h"
00064 #include "TRandom.h"
00065 #include "TGTab.h"
00066 #include "TList.h"
00067 #include "TGStatusBar.h"
00068 #include "TSpectrum.h"
00069 #include "TPolyMarker.h"
00070 
00071 class TPeakFindPanel : public TGTransientFrame
00072 {
00073 private:
00074   TGNumberEntry *fNumberOfPeaksNE, *fResolutionNE, *fSigmaNE, *fThresholdNE;
00075   TGCheckButton *fAttemptFitCB, *fAddPolyFitCB, *fDoUnzoomCB;
00076   TGTextButton *fFindTB, *fDefaultsTB, *fCloseTB, *fClearPolyTB;
00077   TGVerticalFrame *fMainFrame;
00078   TGHorizontalFrame *fNumberOfPeaksHF, *fResolutionHF, *fSigmaHF, *fThresholdHF;
00079   TGHorizontalFrame *fFindDefaultsHF, *fCloseClearPolyHF;
00080   TSpectrum *fSpectrum;
00081 
00082   Int_t fNfound;
00083   Float_t *fXpeaks; //! [fNfound]
00084   Float_t *fYpeaks; //!
00085 
00086   void FindPeak();
00087   void DrawPeak();
00088   void LayoutGUI();
00089   void LayoutMenuBar();
00090   void GetXYBounds( Double_t &, Double_t & );
00091   void InsertionSort( Float_t *, Float_t *, Int_t, Int_t );
00092   void Clear();
00093   void SetDefaults();
00094   TH1* GetHistogram();
00095 
00096 protected:
00097   enum ECommandIdentifiers
00098   {
00099       M_FILE_EXIT,
00100       M_ATTEMPT_FIT_PEAKS_BUTTON,
00101       M_ADD_POLY_BUTTON,
00102       M_DO_UNZOOM_BUTTON,
00103       M_FIND_BUTTON,
00104       M_DEFAULT_BUTTON,
00105       M_CLOSE_BUTTON,
00106       M_CLEAR_BUTTON,
00107       M_NUMBER_ENTRY_PEAKS,
00108       M_NUMBER_ENTRY_RESOLUTION,
00109       M_NUMBER_ENTRY_SIGMA,
00110       M_NUMBER_ENTRY_THRESHOLD
00111   };
00112 
00113   Double_t fSigma, fThreshold;
00114   Float_t fResolution;
00115   Int_t fNumberOfPeaks;
00116   TF1 *fFit;
00117   Bool_t fDoFit, fAddPoly, fDoUnzoom;
00118 
00119 public:
00120   TPeakFindPanel( TGWindow const *, TGWindow const *, UInt_t, UInt_t );
00121   virtual ~TPeakFindPanel();
00122 
00123   virtual void CloseWindow();
00124   virtual Bool_t ProcessMessage( Long_t, Long_t, Long_t );
00125 
00126   ClassDef( TPeakFindPanel, 1 );
00127 };
00128 
00129 #endif

Roody DOC Version 1.0.1 ---- TRIUMF ----
Contributions: Pierre-Andre Amaudruz - Joe Chuma - Doxygen - Greg King - Konstantin Olchanski - Matthias Schneebeli