Access to this full-text is provided by EDP Sciences.
Content available from The European Physical Journal Conferences
This content is subject to copyright. Terms and conditions apply.
Geant4 electromagnetic physics for Run3 and Phase2 LHC
Jonas Hahnfeld1,Vladimir Ivanchenko1,2,Mihaly Novak1,Luciano Pandola3,and Daren
Sawkey4,∗
1CERN, Geneva, Switzerland
2Princeton University, Princeton, New Jersey, USA
3INFN, Laboratori Nazionali del Sud, Catania, Italy
4Varian, A Siemens Healthineers Company, Toronto, Canada
Abstract. For the new Geant4 series 11.X, the electromagnetic (EM) physics
sub-libraries were revised and reorganized in view of requirements for simula-
tion of Phase-2 LHC experiments. EM physics simulation takes a significant
fraction of the available CPU during massive production of Monte Carlo events
for LHC experiments. We present the recent evolution of Geant4 EM sub-
libraries for the simulation of gamma, electron, and positron transport. Updates
of other components of EM physics are also discussed. These developments are
included in the new Geant4 version 11.1 (December 2022). The most impor-
tant modifications concern the reorganization of the initialization of EM physics
and the introduction of alternative tracking software. These modifications affect
the CPU efficiency of any simulation, and CPU savings depend on geometry
and physics configuration for the concrete experimental setup. We will dis-
cuss several methods: gamma general process, Woodcock tracking, transporta-
tion with multiple scattering process, alternative tracking manager, and the new
G4HepEm library. These developments provide a basis for the implementation
of EM particle transport on co-processors and GPU. We also will present very
recent updates in physics processes and in configuration of EM physics.
1 Introduction
Electromagnetic (EM) physics in Geant4 [1–3] plays a critical role [4] in simulation of high
energy physics, medical physics, space science, and other applications. Both speed and ac-
curacy are critically important, and the code is continually updated to improve these [5, 6].
The work presented here mostly reflects updates available in Geant4 version 11.1 (December
2022).
2 Geant4 EM code and physics evolution
An evolution of the EM physics libraries of Geant4 was started from Geant4 11.0. Obsolete
code was removed, and in several places the usage of common utilities replaced duplicated
code. In the remaining code, uniform approaches were introduced for class initialisation and
layout, access to parameters, and code formatting. The main purposes of these modifications
∗e-mail: [email protected]
EPJ Web of Conferences 295, 03018 (2024) https://doi.org/10.1051/epjconf/202429503018
CHEP 2023
© The Authors, published by EDP Sciences. This is an open access article distributed under the terms of the Creative
Commons Attribution License 4.0 (https://creativecommons.org/licenses/by/4.0/).
Figure 1. Energy loss distribution in 5.6 µm Si thin film by 100 MeV e−, comparing measurements (cir-
cles) [7] to Geant4 simulations using different fluctuation models. Red line, simulations with Geant4
version 10.7. Blue line, simulations with version 11.0 and G4UniversalFluctuation model. Dashed
green line (coincident with red line), version 11.0 and G4UrbanFluctuation model.
were to make the configuration of EM physics more transparent to users and to be more
consistent with usage at supercomputers.
In Geant4 version 11.1, this line of work was continued but with fewer modifications
to the EM code. The environment variable for EM physics that defines the path to the
EM physics data is checked only once in total, for all EM classes in all threads. The path
is then stored as a variable in the G4EmParameters class, and can be accessed by calling
G4EmParameters::GetDirLEDATA(). This process is faster than repeatedly checking the
environment variable.
An additional option to select the model of the fluctuations of the energy loss was in-
cluded. For all charged particles except ions, the default model used in Geant4 10.X series
was renamed to G4UrbanFluctuation for the 11.X series. This is the most accurate model,
and is used in the EM physics lists Opt0, Opt3, Opt4, Livermore, and Penelope. For ions
G4IonFluctuations class is used. A new fluctuation model, G4UniversalFluctuation, is used
in physics lists Opt1 and Opt2. This model is faster than the default and, for many applica-
tions, is equally accurate. For thin films, however, the G4UniversalFluctuation model has
reduced accuracy. Fig. 1 shows the energy loss distribution by 100 MeV e−in a 5.6 µm
thick Si layer. The G4UrbanFluctuation model reproduces the experimental data of Meroli
et al. [7] well. The G4UniversalFluctuation model does not reproduce the shape of the energy
deposition in this thin layer of silicon, and the mean value is biased. The list of alternative
fluctuation models may be extended, and also external models of fluctuations may be used.
Sampling of fluctuations may be disabled by using G4LossFluctuationDummy. Definition of
fluctuations may also be done per geometry region in custom EM physics configurations.
EPJ Web of Conferences 295, 03018 (2024) https://doi.org/10.1051/epjconf/202429503018
CHEP 2023
2
The EPICS2017 dataset [8] for photons is implemented [9] and, starting with Geant4 ver-
sion 11.1, is the default for G4EmLivermorePhysics and G4EmLivermorePolarizedPhysics
models. Compared to other datasets, this dataset has more data points, which enables lin-
ear (rather than logarithmic) interpolation. Due to a dataset review, these data for gamma
processes have a reduced systematic uncertainty on average [9].
For proton, alpha, and ion ionization, ICRU49 [10], ICRU73 [11] and ICRU90 [12] data
are used for energies below 2 MeV/amu. ICRU90 data are more detailed and more accurate,
so are the first choice, but they are available only for a limited number of projectiles and for
three target materials. The second choice is ICRU73 data, and for the remaining combinations
of projectile and target the ICRU49 data are used.
Code developed previously [13] to simulate the quantum entanglement of
MeV-scale photons from positron annihilation has been added to Geant4. It
is coded in the class G4eplusAnnihilation and enabled by the macro com-
mand /process/em/QuantumEntanglement true, and is called in the class
G4LivermorePolarizedComptonModel.
3 Methods to speed up simulation
One approach to speed up the simulation while maintaining accuracy is to eliminate unnec-
essary calculations of mean free path and/or other values at simulation steps.
Firstly this was introduced in Geant4 for the gamma transport as
G4GammaGeneralProcess [5], and is the default since Geant4 11.1. Prior to the in-
troduction of this process, for each step of a gamma particle, six mean free paths were
calculated, corresponding to the photoelectric effect, Compton scattering, e+e−pair produc-
tion, µ+µ−pair production, Rayleigh scattering, and the gamma-nuclear interaction. With the
general process, one interaction length is calculated using precomputed tables corresponding
to the total mean free path. If an interaction occurs in the step, the concrete process is
sampled. This method is already used by both ATLAS [14] and CMS [15].
A method for reducing steps is to combine the multiple scattering and transportation
processes into one process, which has access to both. This new G4TransportationWithMsc
process switches internally between transportation and multiple scattering until a real, dis-
crete interaction occurs. This produces identical physics but can show a large reduction
in the number of steps by charged particles. This process is enabled with physics list
G4EmStandard_opt1 in Geant4 11.1, and can also be enabled in other EM configurations
with the macro command /process/em/transportationWithMsc <argument>. Pass-
ing the argument Enabled turns on the combined process and produces identical results to
the known setup with two processes. The argument MultipleSteps additionally turns on the
internal optimization to avoid steps limited only by multiple scattering. This more aggressive
mode is expected to return statistically compatible results, but should be validated in the user
application. The G4TransportationWithMsc method is already used in CMS simulation [15].
An important caveat is that G4TransportationWithMsc does not work with parallel worlds.
In some geometries, stepping between geometrical boundaries during photon transport
can take a large portion of simulation time. Woodcock tracking [16] is a method of reducing
steps limited by boundaries, by choosing a fictitious cross section equal to the largest cross
section in the materials along the path of the photon. The effectiveness of this method strongly
depends on the application. So far, the implementation is not part of the main Geant4 repos-
itory, but it is planned to be part of the new library G4HepEm [17]. G4HepEm provides a
compact and effective simulation of e+,e−, and γtransport. In this new library, unlike in the
main Geant4 toolkit, a pragmatic approach to perform only necessary computations during
EM particle tracking is implemented. The crucial advantage is in maximum efficiency of the
EPJ Web of Conferences 295, 03018 (2024) https://doi.org/10.1051/epjconf/202429503018
CHEP 2023
3
code. An important feature of the G4HepEm library is to be compatible with the implemen-
tation of transport on GPU accelerators.
4 Optical physics updates
Geant4 version 11.1 includes the modelling of interfaces of thin coatings as developed by
Cappellugola et al. [18]. Interference phenomena and frustrated transmission beyond the
limit angle are considered. This is enabled with the CoatedDielectricDielectric boundary
process, and the user needs to specify the thickness and refractive index of the thin film.
The macro coated.mac included with the OpNovice2 example demonstrates usage of this
capability.
5 Summary
Simulation of electromagnetic interactions in Geant4 continues to undergo improvements in
both speed and accuracy. Concrete values of CPU performance improvements are strongly
dependent on the application and use case. ATLAS and CMS simulation productions have
become faster using the methods described here. The Geant4 series 11.X is expected to
provide a variant of EM physics that will be suitable for implementation on GPU and other
accelerators.
References
[1] Allison, J., et al., Nucl. Instrum. Meth. A 835 186-225 (2016).
[2] Allison, J., et al., IEEE Trans. Nucl. Sci. 53, 270-278 (2006).
[3] Agostinelli, S., et al., Nucl. Instrum. Meth. A 506, 250-303 (2003).
[4] Apostolakis J., et al., Front. Phys. 10, 913510 (2022).
[5] Ivanchenko, V., et al., EPJ Web of Conferences 245, 02009 (2020).
[6] Ivanchenko, V., et al., EPJ Web of Conferences 214, 02046 (2019).
[7] Meroli, S., et al., JINST 6P06013 (2011).
[8] https://www.oecd-nea.org/tools/abstract/detail/iaea1435/
[9] Li, Z., et al., Physica Medica 95, 94-115 (2022).
[10] ICRU Report 49, (1993)
[11] ICRU Report 73, (2005).
[12] ICRU Report 90, (2014).
[13] Watts, D.P., et al. Nat Commun 12, 2646 (2021). https://doi.org/10.1038/s41467-021-
22907-5; arxiv.org/abs/2012.04939
[14] Bandieramonte, M., talk at this conference.
[15] Srimanobhas, P., talk at this conference.
[16] Woodcock, E., et al. Proc. Conf. Applications of Computing Methods to Reactor Prob-
lems. Vol. 557. No. 2. Argonne National Laboratory, (1965).
[17] https://github.com/mnovak42/g4hepem; https://g4hepem.readthedocs.io/en/latest/index.html
[18] Cappellugola, L., et al., 2021 IEEE Nuclear Science Symposium (NSS) and
Medical Imaging Conference (MIC) and 28th International Symposium on Room-
Temperature Semiconductor Detectors, Oct (2021), Yokohama, Japan. pp.1-5,
10.1109/NSS/MIC44867.2021.9875513. hal-03863051
EPJ Web of Conferences 295, 03018 (2024) https://doi.org/10.1051/epjconf/202429503018
CHEP 2023
4