19 #include <TVirtualX.h> 20 #include <TGListBox.h> 21 #include <TGComboBox.h> 25 #include <TGNumberEntry.h> 26 #include <TGTextEntry.h> 31 #include <TGFileDialog.h> 32 #include <TGTextEdit.h> 33 #include <TGStatusBar.h> 34 #include <TGProgressBar.h> 35 #include <TGColorSelect.h> 37 #include <TGraphAsymmErrors.h> 38 #include <TRootEmbeddedCanvas.h> 39 #include <TLorentzVector.h> 54 using std::ostringstream;
59 using namespace genie;
69 this->BuildGUI(p,w,h);
110 fMain =
new TGMainFrame(p,w,h);
113 "CloseWindow()",
"genie::GNuMcMainFrame",
this,
"Close()");
128 fMain->SetWindowName(
"GENIE Event Viewer");
129 fMain->MapSubwindows();
155 TGGroupFrame * bf =
new TGGroupFrame(
156 fUpperFrame,
"Viewer Control Buttons", kHorizontalFrame);
159 new TGPictureButton(bf, gClient->GetPicture(
Icon(
"open"),32,32));
161 new TGPictureButton(bf, gClient->GetPicture(
Icon(
"next"),32,32));
163 new TGPictureButton(bf, gClient->GetPicture(
Icon(
"exit"), 32,32),
164 "gApplication->Terminate(0)");
167 fNextEventButton -> SetToolTipText(
"Get next event" , 1);
168 fExitButton -> SetToolTipText(
"Exit", 1);
171 "Clicked()",
"genie::masterclass::GNuMcMainFrame",
this,
"FileOpen()");
172 fNextEventButton -> Connect(
173 "Clicked()",
"genie::masterclass::GNuMcMainFrame",
this,
"NextEvent()");
176 bf -> AddFrame( fNextEventButton );
177 bf -> AddFrame( fExitButton );
193 ULong_t hintViewerTabsLayout =
194 kLHintsTop | kLHintsExpandX | kLHintsExpandY;
196 =
new TGLayoutHints(hintViewerTabsLayout, 5, 5, 10, 1);
205 TGCompositeFrame *
tf = 0;
214 fFeynmanTab =
new TGCompositeFrame(tf, w, h, kVerticalFrame);
220 ULong_t hintFeynmanTabLayout =
221 kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY;
223 new TGLayoutHints(hintFeynmanTabLayout, 5, 5, 10, 1);
232 fGHepTab =
new TGCompositeFrame(tf, w, h, kVerticalFrame);
234 fGHep =
new TGTextEdit(
fGHepTab, w, h, kSunkenFrame | kDoubleBorder);
235 fGHep->AddLine(
"GHEP:" );
237 ULong_t hintGHepTabLayout =
238 kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY;
240 =
new TGLayoutHints(hintGHepTabLayout, 5, 5, 10, 1);
251 TGCompositeFrame *
tf = 0;
262 TGCompositeFrame *
tf = 0;
270 Int_t parts[] = { 60, 20, 20 };
274 ULong_t hintStatusBarLayout =
275 kLHintsBottom | kLHintsLeft | kLHintsExpandX;
277 =
new TGLayoutHints(hintStatusBarLayout, 0, 0, 2, 0);
285 pic << gSystem->Getenv(
"GENIE") <<
"/data/icons/" << name <<
".xpm";
287 LOG(
"MasterClass",
pINFO) <<
"Loading icon: " << pic.str();
289 return pic.str().c_str();
299 fStatusBar->SetText(
"Asking for event file name...", 0);
301 static TString
dir(
".");
302 const char * kFileExt[] = {
"GHEP/ROOT event files",
"*.root", 0, 0};
305 fi.fFileTypes = kFileExt;
306 fi.fIniDir = StrDup(dir.Data());
308 new TGFileDialog(gClient->GetRoot(),
fMain, kFDOpen, &fi);
315 fStatusBar -> SetText( cmd.str().c_str(), 0 );
326 new TFile(fEventFilename.c_str(),
"READ");
328 dynamic_cast <TTree *> (
fEventFile->Get(
"gtree"));
344 <<
"Input tree header: " << *thdr;
346 fGHepTree->SetBranchAddress(
"gmcrec", &
fMCRecord);
TGGroupFrame * fImgButtonGroupFrame
unsigned int fViewTabHeight
THE MAIN GENIE PROJECT NAMESPACE
TRootEmbeddedCanvas * fEmbeddedCanvas
TGCompositeFrame * fUpperFrame
void BuildMainFrames(void)
TGCompositeFrame * fGHepTab
TGPictureButton * fNextEventButton
TGLayoutHints * fViewerTabsLayout
void PrintEventRecord(EventRecord *event)
void BuildStatusBar(void)
Q_EXPORT QTSManip setprecision(int p)
void BuildGUI(const TGWindow *p, UInt_t w, UInt_t h)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
ClassImp(GNuMcMainFrame) GNuMcMainFrame
MCTruthDisplay * fTruthDisplay
TGLayoutHints * fStatusBarLayout
NtpMCEventRecord * fMCRecord
unsigned int fViewTabWidth
const char * Icon(const char *name)
void BuildMCTruthTab(void)
TGPictureButton * fExitButton
void ShowEvent(EventRecord *ev_rec)
TGLayoutHints * fGHepTabLayout
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
TGGroupFrame * BuildImageButtonFrame(void)
TGCompositeFrame * fLowerFrame
void BuildFastSimCherenkovTab(void)
TGCompositeFrame * fMainFrame
virtual ~GNuMcMainFrame()
void BuildFastSimScintCaloTab(void)
void DrawDiagram(EventRecord *event)
TGPictureButton * fFileOpenButton
Event finding and building.
TGMatrixLayout * fButtonMatrixLayout
TGCompositeFrame * fFeynmanTab
TGLayoutHints * fFeynmanTabLayout