00001 #ifndef EVENTDISPLAY_HH
00002 #define EVENTDISPLAY_HH
00003
00004 #include "TObject.h"
00005 #include <TApplication.h>
00006 #include "TGFileDialog.h"
00007 #include <TGClient.h>
00008 #include <TRootCanvas.h>
00009 #include <TGMenu.h>
00010 #include <TGButton.h>
00011 #include <TGLabel.h>
00012 #include <TGNumberEntry.h>
00013 #include <TGeoMatrix.h>
00014
00015 #include <TROOT.h>
00016 #include <TRint.h>
00017 #include <TKey.h>
00018 #include <TCanvas.h>
00019 #include <TTree.h>
00020 #include <TH1I.h>
00021 #include <TFile.h>
00022 #include <TSystem.h>
00023 #include <TGeoManager.h>
00024 #include <TGeoMatrix.h>
00025 #include <RQ_OBJECT.h>
00026 #include <iostream>
00027 #include <sstream>
00028
00029 #include <string>
00030 #include <vector>
00031 #include <map>
00032
00033 #include <TGClient.h>
00034 #include <TGListBox.h>
00035 #include <TList.h>
00036
00037 #include "TRootHelpDialog.h"
00038 #include "TGDoubleSlider.h"
00039
00040
00041 #define PREVID 1
00042 #define NEXTID 2
00043
00044 #define UNDEFINED 0
00045
00046 typedef struct {
00047 UInt_t min;
00048 UInt_t max;
00049 TTree* tree;
00050 UInt_t type;
00051 } TreeInfo_t;
00052
00053 enum EMyMessageTypes {
00054 M_FILE_EVENT_OPEN,
00055 M_FILE_XML_OPEN,
00056 M_FILE_BROWSE,
00057 M_FILE_NEWCANVAS,
00058 M_FILE_CLOSEWIN,
00059 M_FILE_EXIT,
00060 M_HELP_ABOUT
00061 };
00062 using namespace std;
00063
00064
00065 class EventDisplay : public TGMainFrame {
00066 RQ_OBJECT("EventDisplay")
00067
00068 private:
00069 TGMenuBar *fMenuBar;
00070 TGPopupMenu *fMenuFile;
00071 TGPopupMenu *fMenuHelp;
00072 TGLabel *fLbRootFile;
00073 TGNumberEntryField *LbEventNum;
00074 TGNumberEntryField *deltaTMin;
00075 TGNumberEntryField *deltaTMax;
00076
00077 TGTextButton *prevButton, *exitButton , *nextButton, *zoomup, *zoomdown;
00078 TGCheckButton *fChkBut;
00079 TGCheckButton *fCaloTypeCheckBut;
00080 TGLayoutHints *fLayout;
00081 void Display();
00082 void Init();
00083 void DisplayMTEvent();
00084 void DisplayCaloEvent();
00085 void adjustSlider();
00086
00087
00088 TGDoubleHSlider* slider;
00089
00090
00091 UInt_t eventNum ;
00092 TFile *file;
00093 string steername;
00094
00095 UInt_t eventType;
00096
00097 TCanvas * c1;
00098 TCanvas * histCan;
00099 TH1I* dtHist;
00100 TGeoMaterial *mat ;
00101 TGeoMedium *med ;
00102 TGeoVolume *world ;
00103 TGeoManager *frame;
00104 std::map<string, TGeoVolume*> nodes;
00105 std::map<string, TGeoTranslation*> trans;
00106
00107 std::vector<TreeInfo_t*> treeInfos;
00108
00109 private:
00110 void fillTreeInfo(const TFile &file);
00111 TreeInfo_t* getTreeInfo(UInt_t eventNum);
00112
00113
00114 public:
00115 EventDisplay(const TGWindow *p, UInt_t w, UInt_t h);
00116 EventDisplay(std::string &rootfileName, const TGWindow *p, UInt_t w, UInt_t h);
00117 EventDisplay(std::string &rootfileName, std::string &xmlfileName, const TGWindow *p, UInt_t w, UInt_t h);
00118 ~EventDisplay();
00119 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00120 void PrevEvent();
00121 void NextEvent();
00122 void SetEventNum();
00123 void HandleMenu(int);
00124 void Zoom();
00125 void UnZoom();
00126 void DoSlider();
00127
00128 ClassDef(EventDisplay, 30)
00129
00130
00131 };
00132
00133
00134
00135
00136
00137 #endif