Session 1 : Enoncé

Code for download: session1_start.tar.gz

Exercise:

  • 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
    . geant4.sh
  • 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 Web site  how to build and run the example.
  • Get familiar with the provided code
    • You can skip EDDetectorConstruction.cc and EDPrimaryGeneratorAction.cc which will be explored later
  • Learn 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
  • Add the run and event number in the viewer (use User Interface online help)

Solution: session1_solution.tar.gz