File indexing completed on 2024-04-06 11:57:57
0001 #ifndef MusEcalGUI_hh
0002 #define MusEcalGUI_hh
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <TApplication.h>
0013 #include <TVirtualX.h>
0014 #include <TGButton.h>
0015 #include <TGResourcePool.h>
0016 #include <TGListBox.h>
0017 #include <TGListTree.h>
0018 #include <TGFSContainer.h>
0019 #include <TGClient.h>
0020 #include <TGFrame.h>
0021 #include <TGIcon.h>
0022 #include <TGLabel.h>
0023 #include <TGButton.h>
0024 #include <TGTextEntry.h>
0025 #include <TGNumberEntry.h>
0026 #include <TGMsgBox.h>
0027 #include <TGMenu.h>
0028 #include <TGCanvas.h>
0029 #include <TGComboBox.h>
0030 #include <TGTab.h>
0031 #include <TGSlider.h>
0032 #include <TGDoubleSlider.h>
0033 #include <TGFileDialog.h>
0034 #include <TGTextEdit.h>
0035 #include <TGShutter.h>
0036 #include <TGProgressBar.h>
0037 #include <TGColorSelect.h>
0038 #include <TRootEmbeddedCanvas.h>
0039 #include <TRandom.h>
0040 #include <TSystem.h>
0041 #include <TSystemDirectory.h>
0042 #include <TEnv.h>
0043 #include <TFile.h>
0044 #include <TKey.h>
0045 #include <TGDockableFrame.h>
0046 #include <TGFontDialog.h>
0047
0048 #include <map>
0049
0050
0051 #include "MEClickableCanvas.hh"
0052 #include "MECanvasHolder.hh"
0053 #include "MusEcal.hh"
0054 class MEPlotWindow;
0055 class MERunPanel;
0056 class MEChanPanel;
0057 class MELeafPanel;
0058 class MEMultiVarPanel;
0059
0060 class MusEcalGUI : public TGMainFrame, public MECanvasHolder, public MusEcal
0061 {
0062 enum { iHIST, iVS_CHANNEL, iMAP };
0063
0064 public:
0065
0066
0067 MusEcalGUI() {}
0068 MusEcalGUI( const TGWindow *p, UInt_t w, UInt_t h,
0069 int type=ME::iLaser, int color=ME::iBlue );
0070 virtual ~MusEcalGUI();
0071
0072 protected:
0073
0074
0075 void exitProg();
0076
0077 private:
0078
0079
0080 virtual void refresh();
0081 virtual void setType( int type, int color=0 );
0082 virtual void setLMRegion( int lmr );
0083 virtual void setTime( ME::Time );
0084
0085 virtual void setChannel( MEChannel* );
0086
0087 void welcome();
0088
0089 bool getTimeVector( std::vector< ME::Time >& );
0090 bool getHistoryVector( std::vector< ME::Time >&,
0091 std::vector< float >&,
0092 std::vector< bool >&,
0093 std::vector< float >&,
0094 bool& b_, float& miny, float& maxy );
0095 bool getHistoryVector( unsigned int& nrun,
0096 float* x, float* y, float* ex, float* ey,
0097 bool* ok, float& norm, float& min, float& max );
0098 void drawHistoryGraph( unsigned int n,
0099 float* x, float* y, float* ex, float* ey, bool* ok,
0100 int markerStyle, float markerSize, int markerColor,
0101 int lineWidth, int lineColor, const char* graphOpt="LPSame" );
0102
0103
0104 MERunPanel* _fRunPanel;
0105 friend class MERunPanel;
0106 void createRunPanel();
0107
0108
0109 MEChanPanel* _fChanPanel;
0110 friend class MEChanPanel;
0111 void createChanPanel( bool ifexists=false );
0112
0113
0114 MELeafPanel* _fLeafPanel;
0115 friend class MELeafPanel;
0116 void createLeafPanel();
0117
0118
0119 MEMultiVarPanel* _fMultiVarPanel;
0120 friend class MEMultiVarPanel;
0121 void createMultiVarPanel();
0122
0123
0124 int _ihtype;
0125 int _icateg;
0126 int _ihist;
0127 TString _psdir;
0128 void drawHist( int opt=0 );
0129 void drawAPDHist( int opt=0 );
0130 void drawPNHist( int opt=0 );
0131 void drawMTQHist( int opt=0 );
0132
0133 void drawAPDAnim( int opt=0 );
0134
0135 void historyPlot( int opt=0 );
0136 void leafPlot( int opt=0 );
0137 void multiVarPlot( int opt=0 );
0138
0139
0140 bool _normalize;
0141
0142
0143 enum { iHistoryVsTime, iHistoryProjection };
0144 int _historyType;
0145
0146 friend class MEPlotWindow;
0147 std::map< TString, MEPlotWindow* > _window;
0148 MEPlotWindow* getWindow( TString, int opt, int w, int h );
0149
0150
0151 friend class MEClickableCanvas;
0152 virtual void setPxAndPy( int px, int py );
0153 void windowClicked( MEPlotWindow* canv );
0154
0155
0156
0157
0158 void setupMainWindow();
0159 void setLMRMenu();
0160
0161 TGLayoutHints* fMenuBarLayout;
0162 TGLayoutHints* fMenuBarItemLayout;
0163 TGLayoutHints* fL1;
0164 TGLayoutHints* fL2;
0165 TGLayoutHints* fL5;
0166 TGLayoutHints* fLb;
0167 TGLayoutHints* fL8;
0168
0169
0170 TGDockableFrame* fMenuDock;
0171 TGMenuBar* fMenuBar;
0172
0173
0174 TGPopupMenu* f_File_Menu;
0175 TGPopupMenu* f_Hist_Menu;
0176
0177
0178 TGPopupMenu* f_Laser_Menu;
0179 TGPopupMenu* f_APD_Menu;
0180 TGPopupMenu* f_PN_Menu;
0181 TGPopupMenu* f_MTQ_Menu;
0182 TGPopupMenu* f_APD_Hist_Menu[ME::iSizeC];
0183 TGPopupMenu* f_PN_Hist_Menu[ME::iSizeC];
0184 TGPopupMenu* f_MTQ_Hist_Menu[ME::iSizeC];
0185
0186
0187 TGPopupMenu* f_TP_Menu;
0188 TGPopupMenu* f_TPAPD_Gain_Menu;
0189 TGPopupMenu* f_TPPN_Gain_Menu;
0190 TGPopupMenu* f_TPAPD_Hist_Menu;
0191 TGPopupMenu* f_TPPN_Hist_Menu;
0192
0193 TGPopupMenu* f_Channel_Menu;
0194 std::vector<TGPopupMenu*> f_tree_menu;
0195
0196
0197 TGPopupMenu* f_History_Menu;
0198 TGPopupMenu* f_History_L_Menu;
0199 TGPopupMenu* f_History_TPV_Menu;
0200 TGPopupMenu* f_History_LV_Menu[ME::iSizeC];
0201
0202
0203 TGHorizontalFrame* fHFrame1;
0204 TGHorizontalFrame* fHFrame2;
0205 TGVerticalFrame* fVFrame;
0206 MEClickableCanvas* fEcanvas;
0207
0208 TPad* _curPad;
0209
0210 public:
0211
0212
0213 void HandleFileMenu(Int_t);
0214 void HandleHistMenu(Int_t);
0215 void HandleHistoryMenu(Int_t);
0216 void HandleChannelMenu(Int_t);
0217
0218 ClassDef( MusEcalGUI, 0 )
0219 };
0220
0221 #endif
0222