Chapter 10.  Examples

10.1.  Introduction

The Geant4 toolkit includes several fully coded examples that demonstrate the implementation of the user classes required to build a customized simulation.

The new "basic" examples cover the most typical use-cases of a Geant4 application while keeping simplicity and ease of use. They are provided as a starting point for new Geant4 application developers.

The "novice" examples range from the simulation of a non-interacting particle and a trivial detector to the simulation of electromagnetic and hadronic physics processes in a complex detector. As a result of continuous Geant4 development and the enhancing of examples code most of these examples have become too complex for novice users. The new set of "basic" examples is now provided for beginners. The intention is to remove the "novice" examples completely in the next Geant4 release.

A set of "extended" examples implement simulations of actual high energy physics detectors and many require some libraries in addition to those of Geant4. The "advanced" examples cover cases useful to the development of the Geant4 toolkit itself.

All examples can be compiled and run without modification. Most of them can be run both in interactive and batch mode using the input macro files (*.in) and reference output files (*.out) provided. Most examples are run routinely as part of the validation, or testing, of official releases of the Geant4 toolkit.