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 <TGCanvas.h>
00020 #include <TTree.h>
00021 #include <TH1I.h>
00022 #include <TFile.h>
00023 #include <TSystem.h>
00024 #include <TGeoManager.h>
00025 #include <TGeoMatrix.h>
00026 #include <RQ_OBJECT.h>
00027 #include <iostream>
00028 #include <sstream>
00029
00030 #include <string>
00031 #include <vector>
00032 #include <map>
00033
00034 #include <TGClient.h>
00035 #include <TGListBox.h>
00036 #include <TList.h>
00037
00038 #include "TRootHelpDialog.h"
00039 #include "TGDoubleSlider.h"
00040
00041
00042 #define PREVID 1
00043 #define NEXTID 2
00044
00045 #define UNDEFINED 0
00046
00047 typedef struct {
00048 UInt_t min;
00049 UInt_t max;
00050 TTree* tree;
00051 UInt_t type;
00052 } TreeInfo_t;
00053
00054 using namespace std;
00055
00056 class Detector;
00057
00058 class EventDisplay : public TGMainFrame {
00059 RQ_OBJECT("EventDisplay")
00060
00061 private:
00062 TGMenuBar *fMenuBar;
00063 TGPopupMenu *fMenuFile;
00064 TGPopupMenu *fMenuHelp;
00065 TGLabel *fLbRootFile;
00066 TGNumberEntryField *LbEventNum;
00067
00068 TGTextButton *prevButton, *exitButton , *nextButton, *zoomup, *zoomdown;
00069 TGCheckButton *fChkBut;
00070 TGCheckButton *fShowOnlyMicromegas;
00071 TGLayoutHints *fLayout;
00072 void Display(bool updateDT);
00073 void Init(UInt_t width,UInt_t height);
00074 void DisplayMTEvent(bool updateDT);
00075 void DisplayCaloEvent(bool updateDT);
00076 void adjustSlider();
00077
00078
00079 TGDoubleHSlider* slider;
00080 TGVerticalFrame *mainFrame;
00081
00082
00083 UInt_t eventNum ;
00084 TFile *file;
00085 string steername;
00086
00087 UInt_t eventType;
00088
00089 TGStatusBar *fStatusBar;
00090 TCanvas * c1;
00091 TGCanvas * gCanvas;
00092 TH1I* dtHist;
00093 TGeoMaterial *mat ;
00094 TGeoMedium *med ;
00095 TGeoVolume *world ;
00096 TGeoManager *frame;
00097 std::map<string, TGeoVolume*> nodes;
00098 std::map<string, TGeoTranslation*> trans;
00099
00100 std::vector<TreeInfo_t*> treeInfos;
00101
00102 Detector *detector;
00103
00104 bool onlyMicromegas;
00105 bool hitMicromegas;
00106 bool drawChamber;
00107 TGToolBar *fToolBar;
00108
00109 TCanvas * dtCan;
00110 TGNumberEntryField *deltaTMin;
00111 TGNumberEntryField *deltaTMax;
00112 static std::vector<EventDisplay*> frames;
00113
00114 private:
00115 void fillTreeInfo(const TFile &file);
00116 TreeInfo_t* getTreeInfo(UInt_t eventNum);
00117 bool IsMicromegas(UInt_t chamberId);
00118 bool buildDetector();
00119 void OpenFile();
00120 void OpenXMLFile();
00121
00122
00123
00124
00125 public:
00126 EventDisplay(const TGWindow *p, UInt_t w, UInt_t h);
00127 EventDisplay(std::string &rootfileName, const TGWindow *p, UInt_t w, UInt_t h);
00128 EventDisplay(std::string &rootfileName, std::string &xmlfileName, const TGWindow *p, UInt_t w, UInt_t h);
00129 ~EventDisplay();
00130 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00131 void PrevEvent();
00132 void NextEvent();
00133 void SetEventNum();
00134 void HandleMenu(int);
00135 void Zoom();
00136 void UnZoom();
00137 void DoSlider();
00138 void SetSliderRange();
00139 void SliderReleased();
00140 void ShowChamberClick();
00141 virtual Bool_t HandleConfigureNotify(Event_t *event);
00142 void processZoom(void);
00143
00144
00145
00146 static void zoomC1(void);
00147
00148
00149
00150
00151 ClassDef(EventDisplay, 34)
00152
00153
00154 };
00155
00156
00157
00158
00159
00160 #endif