A very introductory course intended for developing Geant4 Applications
Dr Hernán Asorey, Medical Physics Department, Centro Atómico Bariloche, Av. E. Bustillo 9500, (8400) San Carlos de Bariloche, Argentina
This is a 4-hours, work-in-progress and hands-on Geant4 course for beginners. We will build two basic applications from scratch: absorbed dose calculation and shielding effects. The course is separated in four sections:
- Introduction: Geant4 Generalities
- Building blocks: structure of an app and common practices
- The basics: simulating physical processes with Geant4
- Apps: build your first Geant4 Applications
- Lectures' slides (a single document): Google Slides. You can download the latest release of the pdf slides.
The apps directory contain two directories intended for:
- base: base application, mainly developed during the first lecture;
- final: final application codes, mainly developed during the second lecture.
You will find some root and Geant4 installation scripts and Dockerfiles in the utils directory.
Open your terminal, go to the utils
directory and then just run:
$ ./install-root-geant4.sh
Alternatively, you can download my updated root and Geant4 docker images from my docker hub repository. Please be sure you have correctly installed docker in your system, and then just pull the images:
$ docker pull asoreyh/root:latest # root version 6.28.04 (2023)
$ docker pull asoreyh/geant4:latest # G4 version 10.07.04 (2022)
Another option is to create your own docker images using the provided Dockerfiles
in the utils
directory. Open a terminal, go the utils
directory and then:
docker build -t asoreyh/root:6.28.04 -f Dockerfile.root .
docker build --progress=plain -t asoreyh/geant4:10.07.04 -f Dockerfile.g4 .
Of course, feel free to change them according to your need.
You will perform some extra steps to access the Geant4 OpenGL viewer in the docker container from the host computer. Before running the docker, in your terminal just run:
$ xhost +local:root
and run the Geant4 docker image (if you don’t download the docker images it will download them):
$ docker run --privileged -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix asoreyh/geant4:10.07.04
(please note you should change the image name if you build and use your own images).
A very introductory course intended for developing Geant4 Applications by Hernán Asorey is marked with CC0 1.0 Universal