Session 1 : Exercise – 2015

Code for download: session1_start.tar.gz


  • Geant4 is already installed on the machines in the directory /usr/local. We will first call the Geant4 script to define the environment needed to build & run Geant4 application:
    cd /usr/local/bin
  • Build & run the example:
    • Download the example source code session1_start.tar.gz. (The file will be saved as session1_start.tar in $HOME/Downloads directory.)
    • Untar the file:
      tar xvf session1_start.tar
    • Rename the example as exampleED:
      mv session1_start exampleED
    • Follow the instruction at the Geant4 examples Web site  how to build and run the example.
  • Get familiar with the provided code
    • You can skip and which will be explored later
  • Get familiar with  Geant4 Qt User Interface
    • Use the provided button (an arrow in a green circle) to run 1 event, observe the picture and the output in the Output window.
    • Run 1 event from the command line. You have to type this command in the Session window:
      /run/beamOn 1
    • Run 1 event via a selection of the command from the Help menu.
    • Set tracking verbose level to 1 and observe the output:
      /tracking/verbose 1
  • Add printing of the event number at the begin of event and another printing about the end of event in EDEventAction; see G4Event class functions at the Geant4 documentation

Solution: session1_solution.tar.gz