120 likes | 272 Views
IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit. Sunanda Banerjee ( Saha Inst. Nucl . Phys., Kolkata, India) Min Cheol Han ( Hanyang Univ., Seoul, Korea) Steffen Hauf (XFEL, Hamburg, Germany)
E N D
IEEE Nuclear Science Symposium and Medical Imaging ConferenceShort CourseThe Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata, India) Min Cheol Han (Hanyang Univ., Seoul, Korea) Steffen Hauf(XFEL, Hamburg, Germany) Maria Grazia Pia (INFN Genova, Italy) MariaGrazia.Pia@ge.infn.it Seoul, 27 October 2013 http://www.ge.infn.it/geant4/events/nss2013/geant4course.html This course encompasses training material developed by several Geant4 members: thanks to all of them!
Geant4 User Interface (UI) • Geant4 UI • Geant4 supports various built-in UI commands. • UI command consists ofcommand directory, command, and parameter. Ex) /run/beamOn10 • Geant4 has a two types of UI processing (batch mode, interactive mode) • We can check the list of built-in commands in this web site.http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/AllResources/Control/UIcommands/_.html
Geant4 User Interface (UI) • ‘Hard-coded’ batch mode • Geant4 UI Command can be run in Geant4 source code.(called ‘Hard-coded’ batch mode) • Example: int main(intargc, char**argv) { … G4UImanager*UImanager= G4UImanager::GetUIpointer(); UImanager->ApplyCommand("/run/verbose 1"); UImanager->ApplyCommand("/event/verbose 1"); UImanager->ApplyCommand("/tracking/verbose 1"); … }
Geant4 User Interface (UI) • Batch mode with macro file • Geant4 simulation will run in batch mode with macro file. • Example: int main(intargc, char**argv) { … G4UImanager*UImanager = G4UImanager::GetUIpointer(); if(argc==1) { // Define UI session for interactive mode } else { // Define batch mode using UImanager class G4String command = "/control/execute " + argv[1]; UImanager->ApplyCommand(command); } … }
Geant4 User Interface (UI) • Batch mode with macro file • The example will be executed with below command:> example run.mac • Example - run.mac file: # Macro file: run.mac # set verbose level for this run /run/verbose 2 /event/verbose 0 /tracking/verbose 1 /gun/particle e- /gun/energy 1 GeV /run/beamOn100 ※ First ‘#’ is used for comment line in macro file.
Geant4 User Interface (UI) • Interactive mode - Character UI (CUI) • Geant4 provide character user interface (CUI) by using G4UIterminal class (or G4UIWin32 in windows OS) as interactive mode. • Example: int main(intargc, char**argv) { … if(argc==1) { // Define UI session for interactive mode G4UIsession* session = new G4UIterminal(new G4UItcsh); session->SessionStart(); deletesession; } … }
Geant4 User Interface (UI) • Interactive mode - Character UI (CUI)
Geant4 User Interface (UI) • Interactive mode - Graphical UI (GUI) • Geant4 supports various graphical user interface (GUI) by using G4UIExecutive class. • Example: int main(intargc, char**argv) { … if(argc==1) { // Define UI session for interactive mode G4UIExecutive*ui = new G4UIExecutive(argc, argv, “XX”); session->SessionStart(); deletesession; } … }
Geant4 User Interface (UI) • Interactive mode - Graphical UI (GUI) • User can choose a specific interface initial parameter of G4UIExecutive class. • ex) G4UIExecutive*ui = new G4UIExecutive(argc, argv, “xx”) (where xx = qt, xm, win32, gag, tcsh, …) Run with Xm GUI
Geant4 User Interface (UI) • Interactive mode - QtUI • The one of Geant4 GUI Application • Qt (UI) with OpenGL (Graphic viewer) • If GEANT4_USE_QT=1 when geant4 was installed, Qt is default UI in Geant4. • Homepage - http://qt.digia.com/
Geant4 User Interface (UI) • Interactive mode - Qt UI • Enable/Disable specific geometry using “Scene tree” • Command (or Command parameter) check • Geometry viewer • Run specific macro, command alias, etc…
Geant4 User Interface (UI) • Interactive mode - Qt Demo