Geant4—a simulation toolkit

https://doi.org/10.1016/S0168-9002(03)01368-8Get rights and content

Abstract

Geant4 is a toolkit for simulating the passage of particles through matter. It includes a complete range of functionality including tracking, geometry, physics models and hits. The physics processes offered cover a comprehensive range, including electromagnetic, hadronic and optical processes, a large set of long-lived particles, materials and elements, over a wide energy range starting, in some cases, from 250eV and extending in others to the TeV energy range. It has been designed and constructed to expose the physics models utilised, to handle complex geometries, and to enable its easy adaptation for optimal use in different sets of applications. The toolkit is the result of a worldwide collaboration of physicists and software engineers. It has been created exploiting software engineering and object-oriented technology and implemented in the C++ programming language. It has been used in applications in particle physics, nuclear physics, accelerator design, space engineering and medical physics.

Introduction

Modern particle and nuclear physics experiments pose enormous challenges in the creation of complex yet robust software frameworks and applications. Of particular importance is the ever-increasing demand for large-scale, accurate and comprehensive simulations of the particle detectors used in these experiments. The demand is driven by the escalating size, complexity, and sensitivity of the detectors and fueled by the availability of moderate-cost, high-capacity computer systems on which larger and more complex simulations become possible. Similar considerations arise in other disciplines, such as: radiation physics, space science, nuclear medicine and, in fact, any area where particle interactions in matter play a role.

In response to this, a new object-oriented simulation toolkit, Geant4, has been developed. The toolkit provides a diverse, wide-ranging, yet cohesive set of software components which can be employed in a variety of settings. These range from simple one-off studies of basic phenomena and geometries to full-scale detector simulations for experiments at the Large Hadron Collider and other facilities.

In defining and implementing the software components, all aspects of the simulation process have been included: the geometry of the system, the materials involved, the fundamental particles of interest, the generation of primary particles of events, the tracking of particles through materials and external electromagnetic fields, the physics processes governing particle interactions, the response of sensitive detector components, the generation of event data, the storage of events and tracks, the visualisation of the detector and particle trajectories, and the capture for subsequent analysis of simulation data at different levels of detail and refinement.

Early in the design phase of the project, it was recognised that while many users would incorporate the Geant4 tools within their own computational framework, others would want the capability of easily constructing stand-alone applications which carry them from the initial problem definition right through to the production of results and graphics for publication. To this end, the toolkit includes built-in steering routines and command interpreters which operate at the problem setup, run, event, particle transportation, visualisation, and analysis levels, allowing all parts of the toolkit to work in concert.

At the heart of this software system is an abundant set of physics models to handle the interactions of particles with matter across a very wide energy range. Data and expertise have been drawn from many sources around the world and in this respect Geant4 acts as a repository that incorporates a large part of all that is known about particle interactions; moreover it continues to be refined, expanded and developed. A serious limitation of many previous simulation systems was the difficulty of adding new or variant physics models; development became difficult due to the increasing size, complexity and interdependency of the procedure-based code. In contrast, object-oriented methods have allowed us effectively to manage complexity and limit dependencies by defining a uniform interface and common organisational principles for all physics models. Within this framework, the functionality of models can be more easily seen and understood, and the creation and addition of new models is a well-defined procedure that entails little or no modification to the existing code.

Geant4 was designed and developed by an international collaboration, formed by individuals from a number of cooperating institutes, HEP experiments, and universities. It builds on the accumulated experience of many contributors to the field of Monte Carlo simulation of physics detectors and physical processes. While geographically distributed software development and large-scale object-oriented systems are no longer a novelty, we consider that the Geant4 Collaboration, in terms of the size and scope of the code and the number of contributors, represents one of the largest and most ambitious projects of this kind. It has demonstrated that rigorous software engineering practices and object-oriented methods can be profitably applied to the production of a coherent and maintainable software product, even with the fast-changing and open-ended requirements presented by physics research.

In the following sections we present a detailed overview of Geant4 and its features and capabilities, including the design and implementation of the various categories of physics models. Many new physics models have been developed, and others have been refined or extended. They have been created to support a growing range of applications for the software, including particle, nuclear, medical, accelerator and space physics. The code and documentation, as well as tutorials and examples, are available from our Web site [1].

The origin of Geant4 development can be traced back to two studies done independently at CERN and KEK in 1993 [2]. Both groups sought to investigate how modern computing techniques could be applied to improve what was offered by the existing GEANT3 program [3], which was a benchmark and source of ideas and valuable experience. These two activities merged and a proposal was submitted to the CERN Detector Research and Development Committee (DRDC) [4] to construct a simulation program based on object-oriented technology. The resulting project was RD44, a worldwide collaboration that grew to include the efforts of 100 scientists and engineers, drawn from more than 10 experiments in Europe, Russia, Japan, Canada and the United States.

The design choices faced by RD44 and the decisions arrived at are described in later sections, but key to its success was a careful design adapting object-oriented methodology and an early decision to use the practical C++ language.

The R&D phase was completed in December 1998 [1] with the delivery of the first production release. Subsequently the Geant4 Collaboration was established in January 1999 to continue the development and refinement of the toolkit, and to provide maintenance and user support.

A Memorandum of Understanding (MoU) [5] signed by all participating parties governs the formal collaboration. It is subject to tacit renewal every 2 years and sets out a collaboration structure composed of a Collaboration Board (CB), a Technical Steering Board (TSB) and several working groups. The MoU also defines the way in which collaboration resources—money, manpower, expertise, and key roles and activities (such as program librarian and documentation manager)—are measured in Contribution Units (CU), and it further delineates how the boards are constituted depending on the CU count for each signatory. Participating groups include experimental teams and collaborations, laboratories and national institutes.

It is the CB's mandate to manage these resources and to monitor the agreed responsibilities among the affiliates. This body is also charged with the evolution of the MoU. The TSB, on the other hand, is the forum where technical matters, like software engineering details and physics model implementation issues, are discussed and decided and where priorities are given to user requests. Its primary tasks are the supervision of the production service and the user support and the overseeing of ongoing further development of the program. The TSB is chaired by the spokesperson of the Collaboration, who is appointed by and reports to the CB. The spokesperson is (re)elected every two years.

Every domain of the Geant4 software that corresponds to a releasable component (library) is individually managed by a working group of experts. In addition, there is a working group for each of the activities of testing and quality assurance, software management and documentation management. A coordinator who is selected by the TSB heads each group. There is also an overall release coordinator. This clean overall problem decomposition makes the distributed software design and development possible in a worldwide collaboration. Every group can work in parallel, allowing an optimal use of manpower and expertise.

The Collaboration provides documentation and user support for the toolkit. The support model is described in more detail in Section 3.6.

Documentation [6] includes installation, user and reference guides, and a range of training kits (see also Section 1.4). It is intended to cover the need of the beginner through to the expert user who wishes to expand the capabilities of Geant4.

User support covers help with problems relating to the code, consultation on using the toolkit and responding to enhancement requests. A user may also expect assistance in investigating anomalous results.

A Web-based reporting system and a list of frequently asked questions (FAQs) are available on the Geant4. Web site [1]. The Collaboration also runs a Web-based user forum [7], with sub-forums according to areas of different interest.

Regular releases of the source code and documentation are freely available on the Web.

The toolkit includes examples at three levels:

  • Novice: for understanding basic functionalities;

  • Extended: focused on specific domains of application (they may also need additional third party libraries);

  • Advanced: full programs created to utilise Geant4 in HEP experiments, and for space and medical applications.

They are intended to develop the user's understanding in many areas. Initial emphasis is on the classes describing the user's setup, which are required by the toolkit. These classes are explained in Section 2.4.

Geant4 also provides a training kit. It consists of a modular set of units, each covering a specific domain. The units contain descriptive material and examples, such as code excerpts, or plots with performance results. They are modular in themselves, providing different levels of coverage and complexity.

For the reader who wishes to obtain a broad overall view of the project from inception to realisation we describe basic principles of the design in Section 2.

Details that are needed to understand how to extend the toolkit, tailor it for special use and obtain optimal performance, are postponed to 4 The kernel, 5 Physics processes.

In between, we devote Section 3 to the important issue of the software process as it applies to a large, dispersed collaboration. It is here that the exploitation of modern software engineering techniques and object-oriented methods are discussed.

The basic algorithms and capabilities of the kernel are described in Section 4 and an overview of available physics processes and models is presented in Section 5. The latter also includes a sample of results and comparisons with GEANT3 and experimental measurements.

Additional capabilities are discussed in Section 6 and interactivity (user interfaces, visualisation and analysis) in Section 7.

Section snippets

General considerations

Geant4 is driven by the software needs of modern experiments. A typical software system contains components—event generator, detector simulation, reconstruction and analysis—that can be used separately or in combinations. The toolkit has been built as the basis for the simulation component. Thus it was required

  • to have well-defined interfaces to other components, and

  • to provide parts to be used by the other components.

Other design requirements are that it is modular and flexible, and that its

Software process

The term software process refers collectively to the set of processes used by an organisation or project to plan, manage, execute, monitor, control and improve its software-related activities. Software processes define the practices that are used in the production and evolution of the software.

Although the Geant4 software product has been in production and available to the public since December 1998, a number of modules (class categories) are still under active development and therefore require

Global structure

The kernel manages the tracking of particles taking account of the geometry, fields and physics processes. Efficiency is a key issue and various optimisation techniques are used. Geant4 provides ways of controlling the order of processing of tracks. User code is invoked when particles enter sensitive volumes so that hits and digitisations can be scored. All this is described below.

Geant4's logical structure and the user action classes were essentially described in 2.2 Global structure, 2.4 User

Scope

The Geant4 toolkit contains a large variety of complementary and sometimes alternative physics models covering the physics of photons, electrons, muons, hadrons and ions from 250eV up to several PeV. The hierarchical structure of the processes category was introduced in 2.3.4 Physics, 4.3 Process management. There are seven major sub-categories—electromagnetic, hadronic, transportation, decay, optical, photolepton_hadron, and parameterisation. The first two, electromagnetic and hadronic, are

Additional capabilities

The real power of the object-oriented approach lies in the ability to extend the basic functionality either by implementing classes derived from the kernel base classes or writing “plug-ins” which use Geant4.

An example of the former, in fact, is the whole of the physics processes; the kernel is written for the generic process defined by the abstract interface and any process which conforms to this interface can be used. Below we describe another extension, namely to “parameterised processes” or

Interactivity and visualisation

Interactivity and visualisation span three related categories, i.e., intercoms, interfaces, and visualisation categories. At the lowest level resides intercoms, which provides, amongst other things (see Section 2.2), command definition and interpretation tools. User interaction is realised through the concept of a “session” and graphical and non-graphical concrete sessions are available in the interfaces category.

Visualisation is a high level category which uses intercoms and—if interactive

Conclusion

The Geant4 toolkit provides a versatile and comprehensive software package for modern simulation applications that involve the interaction and passage of particles through matter. It can handle complex geometries efficiently and compactly, and allows visualization of the geometry and particle tracks through a variety of interfaces. It provides simulation for a wide range of physics processes based on theory, data or parameterisation. These treat, for example, hadronic interactions from thermal

Acknowledgements

The support for this work has come directly or indirectly from many sources. Primarily, we acknowledge the member institutes: European Organization for Nuclear Research (CERN), European Space Agency, Helsinki Institute of Physics (HIP), Inst. für Theoretische Physik, Johann Wolfgang Goethe Universität, Frankfurt, Jefferson Lab, Karolinska Institutet, KEK (Japan), Stanford Linear Accelerator Center (SLAC), TERA Foundation, TRIUMF (Canada) and Universitat de Barcelona and the Collaborating

References (125)

  • C. Ferguson, General purpose source particle module for Geant4 SPARSET; Technical Note, Uos-GSPM-Tech, Issue 1.0,...
  • J. Sulkimo, J. Vuoskoski, GEREP, a boundary representation modeller proposal for Geant4, IT Division Internal Report,...
  • Data formats and procedures for the evaluated nuclear data file, National Nuclear Data Center, Brookhaven National...
  • H. Stocker

    Nucl. Phys. A

    (1992)
  • R. Engel et al.

    Phys. Rev. D

    (1998)
    R. Engel et al.

    Z. Phys. C

    (1996)
  • See Physics Reference Manual at the Geant4 Web page [1] under...
  • J. Apostolakis, et al., CERN-OPEN-99-034 and INFN/AE-99/18,...
  • T. Nakagawa

    JENDL-3 Japanese Evaluated Nuclear Data Library, Version 3, Revision 2

    J. Nucl. Sci. Technol.

    (1995)
  • FENDL/E2.0, The processed cross-section libraries for neutron-photon transport calculations, version 1 of February...
  • V. Lara, J.P. Wellisch, Pre-equilibrium and equilibrium decays in Geant4, Proceedings of the CHEP 2000 Conference,...
  • J.P. Bondorf et al.

    Phys. Rep.

    (1995)
  • M.R. Ataian

    EHS-NA22 Collaboration, π0 and η meson production in π+ p and K+p collisions at 250GeV/c

    Z. Phys. C

    (1992)
  • S. Giani, et al., Geant4: An object-oriented toolkit for simulation in HEP, CERN/LHCC 98-44,...Geant4 Web page:...
  • K. Amako, et al., Proceedings of CHEP94, San Francisco, CA, USA, LBL-35822...
  • GEANT—Detector description and simulation tool, CERN Program Library Long Write-up W5013, CERN...
  • A. Dellacqua, et al., Geant4: an object-oriented toolkit for simulation in HEP, CERN/DRDC/94-29 DRDC/P58,...
  • See MOU document at the Geant4 Web page [1] under...
  • See User Documents at the Geant4 Web page [1] under...
  • See Hypernews system at the Geant4 Web page [1] under User...
  • Geant4 Collaboration, Geant4 User Requirements Document, CERN,...
  • L. Lönnblad

    CLHEPa project for designing a C++ class library for high energy physics

    Comput. Phys. Commun.

    (1994)
    (See also:...
  • M. Asai

    Comput. Phys. Commun.

    (1998)
  • ISO 10303-203. Application protocol: configuration controlled design, Industrial automation systems and...
  • M. Asai, et al., Design of tracking and generic processes in Geant4, Proceedings of the MC2000 Conference, Lisbon,...
  • E. Gamma et al.

    Design Patterns

    (1995)
  • J.P. Wellisch

    Hadronic shower models in Geant4—the frameworks

    Comput. Phys. Commun.

    (2001)
  • A.B. Kaidalov et al.

    Phys. Lett. B

    (1982)
  • P.V. Degtyarenko et al.

    Chiral invariant phase space event generator. Inucleon anti-nucleon annihilation at rest

    Eur. Phys. J. A

    (2000)
  • P.V. Degtyarenko et al.

    Chiral invariant phase space event generator. IInuclear pion capture at rest and photo-nuclear reactions below the Delta(3,3) resonance

    Eur. Phys. J. A

    (2000)
  • P.V. Degtyarenko et al.

    Chiral invariant phase space event generator. IIImodeling of real and virtual photon interactions with nuclei below pion production threshold

    Eur. Phys. J. A

    (2000)
  • G. Cosmo, Software Process in Geant4, CERN-IT-2001-005; Proceedings of the CHEP 2001 Conference, Bejing, China,...
  • M. Paulk, et al., The Capability Maturity Model: Guidelines for Improving the Software Process, Addison-Wesley,...
  • D.A. Reo, et al., Measuring software process improvement: there's more to it than just measuring processes, ESI-FESMA...
  • G. Booch, Object-Oriented Analysis and Design with Applications, The Benjamin/Cummings Publishing Co., Menlo Park, CA,...
  • See Coding guidelines document from the Geant4 Web page...
  • J. Rumbaugh, M. Blaha, W. Premerlani, F. Eddy, W. Lornsen, Object-oriented modeling and design, Prentice-Hall...
  • D. Coleman, P. Arnold, S. Bodoff, C. Dollin, H. Gilchrist, F. Hayes, P. Jeremes, Object-oriented development: The...
  • ESA PSS-05-0 Issue2, ESA Software Engineering Standards, European Space...
  • ISO/IEC Joint Technical Committee 1 (JTC1), ISO/IEC DTR 15504 Software Process...
  • ISO/IEC Joint Technical Committee 1 (JTC1), ISO/IEC DTR 15504-5 Part 5: An Assessment Model and Indicator...
  • P. Cederqvist, et al., Version Management with CVS, Signum Support AB,...(See also:...
  • AFS is an acronym for the Andrew File System, developed at Carnegie-Mellon University, Pittsburgh, under a sponsorship...R. Campbell

    Managing AFS: The Andrew File System

    (1998)
  • R.M. Stallman, R. McGrath, GNU Make—a program for directing recompilation, ISBN 1-882114-79-5; Free Software...
  • See testing policy at the Geant4 Web page...
  • See Tag and Release Policy document from the Geant4 Web page...
  • See Problem Reporting System at the Geant4 Web page [1] under...
  • Bonsai Web page:...
  • Tinderbox Web page:...
  • LXR Web page:...
  • Bugzilla Web page:...
  • Cited by (23520)

    • Unfolding environmental γ flux spectrum with portable CZT detector

      2024, Nuclear Instruments and Methods in Physics Research, Section A: Accelerators, Spectrometers, Detectors and Associated Equipment
    • Energy profile of laser Compton slant-scattering γ-ray beams determined by direct unfolding of total-energy responses of a BGO detector

      2024, Nuclear Instruments and Methods in Physics Research, Section A: Accelerators, Spectrometers, Detectors and Associated Equipment
    View all citing articles on Scopus
    View full text