ApplyCommand("/event/verbose 1"); UImanager->ApplyCommand("/tracking/verbose 1"); … }"> ApplyCommand("/event/verbose 1"); UImanager->ApplyCommand("/tracking/verbose 1"); … }">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata,

Similar presentations


Presentation on theme: "IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata,"— Presentation transcript:

1 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) 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!

2 Geant4 User Interface (UI) 2 Geant4 UI  Geant4 supports various built-in UI commands.  UI command consists of command directory, command, and parameter. Ex) /run/beamOn 10  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/UsersG uides/ForApplicationDeveloper/html/AllResources/Control/U Icommands/_.html http://geant4.web.cern.ch/geant4/UserDocumentation/UsersG uides/ForApplicationDeveloper/html/AllResources/Control/U Icommands/_.html

3 Geant4 User Interface (UI) 3 ‘Hard-coded’ batch mode  Geant4 UI Command can be run in Geant4 source code. (called ‘Hard-coded’ batch mode)  Example: int main(int argc, char** argv) { … G4UImanager* UImanager = G4UImanager::GetUIpointer(); UImanager->ApplyCommand("/run/verbose 1"); UImanager->ApplyCommand("/event/verbose 1"); UImanager->ApplyCommand("/tracking/verbose 1"); … }

4 Geant4 User Interface (UI) 4 Batch mode with macro file  Geant4 simulation will run in batch mode with macro file.  Example: int main(int argc, 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); } … }

5 Geant4 User Interface (UI) 5 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/beamOn 100 ※ First ‘#’ is used for comment line in macro file.

6 Geant4 User Interface (UI) 6 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(int argc, char** argv) { … if(argc==1) { // Define UI session for interactive mode G4UIsession* session = new G4UIterminal(new G4UItcsh); session->SessionStart(); delete session; } … }

7 Geant4 User Interface (UI) 7 Interactive mode - Character UI (CUI)

8 Geant4 User Interface (UI) 8 Interactive mode - Graphical UI (GUI)  Geant4 supports various graphical user interface (GUI) by using G4UIExecutive class.  Example: int main(int argc, char** argv) { … if(argc==1) { // Define UI session for interactive mode G4UIExecutive* ui = new G4UIExecutive(argc, argv, “XX”); session->SessionStart(); delete session; } … }

9 Geant4 User Interface (UI) 9 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

10 Geant4 User Interface (UI) 10 Interactive mode - Qt UI  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/http://qt.digia.com/

11 Geant4 User Interface (UI) 11 Interactive mode - Qt UI  Enable/Disable specific geometry using “Scene tree”  Command (or Command parameter) check  Geometry viewer  Run specific macro, command alias, etc…

12 Geant4 User Interface (UI) 12 Interactive mode - Qt Demo


Download ppt "IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata,"

Similar presentations


Ads by Google