Geant4 11.5 Release Notes
The code and binary libraries for the supported systems are available
through our Source
Code Web page.
We are grateful for the efforts of Geant4 users who have provided
detailed feedback or comprehensive reports of issues.
We thank in particular those who have contributed corrections,
improvements or developments included in this release.
Please refer to the
Geant4
User Documentation for further information about using Geant4.
Contents
- Supported and Tested Platforms
- Supported CLHEP, VecGeom and PTL versions
- Items for migration of the user code
- New Developments and Capabilities
- Expected effects on physics and performance
- Known Run-Time Problems and Limitations
- Compilation Warnings
- Geant4 Software License
- Detailed list of changes and fixes
1. Supported and Tested Platforms
Platforms:
- Linux, gcc-16.2.0.
Tested on 64 bit architectures (Intel or AMD) with
Alma Linux 10 (based on RedHat Linux Enterprise 10).
- macOS 27.2 Golden Gate with Apple LLVM/clang-21.
Tested on 64 bit architectures (Apple Silicon).
- Windows-11 with Visual C++ 19.5 (Visual Studio 2026), 64 bits.
More verified and tested configurations (64 bits):
- Linux, 11.5/12.1/13.3/14.3/15.2, clang-20/23
- Linux, Intel-icx 2026.1
- macOS 15.8/26.7 with Apple LLVM/clang-17/21
2. Supported CLHEP, VecGeom and PTL versions
This release of Geant4 has been verified with
CLHEP, release 2.4.7.2.
Use of a different CLHEP version may cause incorrect simulation results.
NOTE: an internal module of the relevant CLHEP classes is provided and can be
used as alternative to an external CLHEP library installation.
A configuration option allows a Geant4 installation to use the
VecGeom Library
primitives, to replace the original Geant4 solids.
VecGeom version 2.2.1 should be adopted when using such configuration.
PTL version 3.0.1 or later is required for external installation of the
PTL tasking library.
CMake 3.16 is the minimum version required to build Geant4.
3. Items for migration of the user code
Listed here is some relevant information on developments included in this
release.
Note that for all users a full re-installation of libraries (or a full
re-compilation) and a re-compilation of user applications is required.
General
- Applied clang-format to the entire code base, included examples.
Standardised end-of-file as newline and removed trailing whitespaces.
- Updated header guards to style/format according to coding guidelines
in all modules.
Geometry
- Custom user code which visits all volumes in a geometry hierarchy can be
refactored to use the new geometry traversal capabilities provided by
G4VolumeTreeWalker or G4TouchableWalker.
Electromagnetic and optical physics
- New dataset G4EMLOW-9.0 is required and should be used.
Hadronic physics
- In the method G4CascadeFinalStateAlgorithm::GenerateCosTheta() of
Bertini-like model (BERT), reverted to the original algorithm for 4-or-higher
body generation of cos(theta), to fix an observed symmetric double bump
in the Feynman-x distribution; the update also repairs unphysical bumps
in certain spectra of secondary pions coming from h+A interactions and
does not induce any additional unphysical effects in the simulated spectra
of secondary pions, protons, and neutrons resulting from h+A interactions.
Note that the switch to roll back BERT as in Geant4 version 11.2 remains
available.
- In G4DeexPrecoParameters, changed the default FermiBreakUp model, from
G4FermiBreakUpVI to G4FermiBreakUpAN. No user modification is needed.
- Extension of the INCLXX intranuclear cascade model for in-flight antideuteron
nuclear interactions. No user modification is needed.
- New hadronic dataset G4RadioactiveDecay-6.1.4 is required and
should be used.
Solid State physics
- Removed obsolete phonon module and extended example, processes are now
integral part of the
G4CMP package.
Physics Lists
- The NuDEX model can be used for neutron capture also in FTFP_BERT_HP,
QGSP_BERT_HP, FTFP_INCLXX_HP, QGSP_INCLXX_HP and Shielding physics lists.
- The QGSP_BERT_HP physics list has been restored to its Geant4 11.1 configuration.
The "experimental" (i.e. not recommended for physics studies) QGSP_BERT_HP
physics list has been renamed to QGSP_BERT_HP_VI, as it was in Geant4 versions
11.2, 11.3 and 11.4.
- The obsolete DNA option 1, 3, 5, 7 and all G4EmDNAPhysics_stationary*
constructors have been removed.
Visualization and Modeling
- Support for Qt-5 is deprecated in this release and its configuration will
be removed in future. Qt-6 is now the default Qt version in use.
Data Sets
- This release introduces new data set versions.
Please see the corresponding details in
Section 9 of this document.
- New data set versions: G4RadioactoveDecay-6.1.4, G4EMLOW-9.0.
- In order to use ParticleHP for charged particles
(protons, deuterons, tritons, He3 and alphas), an optional data
set G4TENDL-1.4 is required, and can be optionally
downloaded in addition.
- Optional nuclear data sets for use with the LEND (Low Energy
Nuclear Data) Cross Section and Model can be optionally downloaded
here:
LEND_GNDS2.0_ENDF.BVII.1 (2.87 Gb),
LEND_GNDS2.0_ENDF.BVIII.0 (4.24 Gb),
LEND_GNDS2.0_ENDF.BVIII.1 (5.78 Gb).
The G4LENDDATA environment variable should be used to switch
the path to the appropriate nuclear data library unpacked and
installed.
4. New Developments and Capabilities
General
- Keep G4cout and G4cerr file destinations independent in G4MTcoutDestination,
preserving the other stream's files when replacing or restoring a destination.
Preserve file redirection when buffering is requested.
- Fixed all known event-loop run-time leaks reported by Valgrind.
- Added support for FPE handling on macOS with Apple Silicon.
Geometry & Field
- Parallelised overlap checks for placed volumes in G4GeomTestVolume using
the available tasking thread pool, or a temporary local pool in MT builds.
- Parallelised EstimateCubicVolume() and EstimateSurfaceArea()
calculations in G4VSolid, using the tasking infrastructure on demand.
- Parallelised GetMass() calculation G4LogicalVolume for independent
daughter contributions using the tasking infrastructure on demand.
- Introduced G4TouchableWalker to traverse the complete tree of touchable volumes,
allowing a G4VTouchableVisitor-derived class to visit every touchable in the
geometry hierarchy. When it encounters a replicated physical volume (replica,
parameterised volume, division or replicated slice), it visits each instance
and the volumes contained within it.
- Building on this interface, G4TouchableCollector creates a list of touchables
that are instances of a specified logical or physical volume.
- Introduced G4VolumeTreeWalker to visit each physical and logical volume in a
hierarchy. It calls a class derived from G4VVolumeTreeVisitor for each volume
visited. In this traversal, a replicated physical volume (replica,
parameterised volume, division or replicated slice) and its contents are
visited only once per encounter in the geometry tree.
- In G4LogicalVolume, refined the storage of key attributes which are constant
during simulation - those for logical volumes used only in placement and
replica physical volumes. In logical volumes used by "varying" physical
volumes (parameterised, divisions, replicated slices) the values of these
attributes change. These volumes are marked as "mutable" and maintain a
per-thread instance of the attributes. This reduces the per-thread memory
use in applications with large geometries, and enables caching of common
attributes.
- Optimised G4Polycone, G4GenericPolycone and G4Polyhedra queries with
solid-specific fast paths, cached trigonometry and candidate tables for large
solids. Accelerated polycone/polyhedra queries for large, stepped and
non-convex RZ profiles.
- Improved G4Para's directional distance queries, G4Polycone/G4Polyhedra
performance scaling on the number of Z sections, G4ExtrudedSolid and
G4TessellatedSolid performance and memory scaling on the number of facets.
- Accelerated sphere/torus queries by replacing atan2-based phi checks and
using a scale-normalised analytical Newton quartic in torus.
- Accelerated G4MultiUnion's accurate DistanceToIn(p) safety with a
component bounding-box hierarchy. Accelerated queries for faceted twisted
solids.
- Sanity check and fixes in G4Tubs, G4Cons, G4CutTubs, G4Sphere and G4Torus,
as well as in G4Hype, G4Paraboloid, and G4EllipticalTube.
- Added explicit selection of the field integration driver through
G4FieldParameters and dedicated UI command. Optimised field propagation
and added optional diagnostics.
Persistency
- In GDML, added support for importing/exporting G4DisplacedSolid entities.
Extended GDML schema with new element displacedSolid and updated to
version 3.2.0.
- Added optional high-precision GDML export.
Electromagnetic physics
- Optimised computation of mass ratio for ions in G4VEnergyLossProcess.
- Updated G4UrbanMscModel with final optimisation of the step limit
algorithm, used in EM physics option3.
- Added G4MesoscopicMoleculeCounter and added hooks for
G4MoleculeCounterManager into G4DNAEventScheduler to record snapshots.
- Extended the Geant4-DNA option 4 physics constructor from 10 keV
to 10 MeV.
- Added multiple ionisation for protons, alphas and carbon ions in Geant4-DNA
DNA physics constructors.
- Added ionisation for deuteron in Geant4-DNA physics constructors.
Hadronic physics
- Updated LEND model to GIDI+ 3.35.0-3 and pugixml v1.15.
Added a thick-target Bremsstrahlung model.
- In hadronic de_excitation model, limit energy non-conservation to 0.5 MeV
in G4UnstableFragmentBreakUp. Fixed thread safety issues in G4FermiBreakUpAN
and set it as the default Fermi-BreakUp model.
- Extension of INCLXX for in-flight antideuteron nuclear interactions.
Materials
- Added a new material G4_BlackBody in G4NistMaterialBuilder, needed for
simulation of Compton process on black body photons.
Run, Scoring
- In G4MTRunManager, added interface for initializing event seeds, enabling
flexible integration with external schedulers without requiring additional
code changes.
- In G4MaterialScanner, G4MatScanMessenger and G4MSSteppingAction,
calculate hadronic interaction length from hadron inelastic cross-sections
instead of relying on the empirical formula of G4Material.
- Added options for writing scan results to a file from material scanner.
- Introduced UI command /run/undertakeOptimisation to force geometry
optimization and added to G4RunMessenger.
- Added drawing methods for scorers; added options to refresh or overlay
new scoring mesh.
Examples
- New extended example volumeTreeVisitors, demonstrating the use of
G4TouchableWalker, its associated G4VTouchableVisitor interface and the
concrete class G4TouchableCollector. It uses the G4TouchableCollector
concrete class, collecting a list of touchables which correspond to a
logical or physical volume.
It uses and demonstrates G4LogicalVolumeUsageVisitor to answer how many
logical volumes are used in placements, in replicas and in parameterised
volumes, and what overlap is there. If a volume is used in a replica or
parameterised volume, it shows how it can be marked as "mutable", i.e.
additional properties can vary depending on the current thread.
- New advanced application ML_LWFA, implementing a simulation framework
based on Geant4 for modeling plasma-accelerated particle beams. It integrates
traditional Monte Carlo methods with machine learning-based ONNX beam generation,
allowing flexible, high-fidelity simulations of beam transport through dipole
and quadrupole fields according to the PALLAS experiment.
5. Expected effects on physics and computing performance
Geometry
- Significant speed-up (of the order of 5-10%) is expected in complex
geometry setups, such as those of the LHC experiments, thanks to the
developments made on geometry primitives and on volumes dispatching.
Electromagnetic physics
- Electromagnetic showers remain stable as in previous Geant4 versions.
Hadronic physics
- Hadronic showers remain stable for most physics lists, except for FTFP_BERT_ATL
for which the energy response increases by a few percent, and the longitudinal
shower shapes become shorter by about 5-10%. This is due to the changes in the
BERT model, which is used in the physics list FTFP_BERT_ATL in a wider range of
hadron projectile energies (3-12 GeV) with respect to all other
reference physics lists (where BERT is used in the range of 3-6 GeV).
For the sake of stability of hadronic showers, it is worth reminding that it is
possible to roll back the BERT model as it was in Geant4 version 11.2.
6. Known Run-Time Problems and Limitations
For a complete list of outstanding run-time problems and to submit any
problem you may find while running this version of Geant4, please refer
to the
Geant4 Problem
Reporting System.
7. Compilation Warnings
There may be a few compilation warnings on some platforms.
We do not believe that any of these lead to incorrect run-time behaviour.
8. Geant4 Software License
A Software License applies to the Geant4 code.
Users must accept this license in order to use it.
The details and the list of copyright holders is available at
https://cern.ch/geant4/license
and also in the text file LICENSE distributed with the source code.
9. Detailed list of changes and fixes
These are the main new features/fixes included in this release since the
last patched public release (for more detailed lists of fixes/additions,
please refer to the corresponding History files provided in most packages):
Configuration
- CMake
- Include optional dependency include paths and linker flags in build-tree
and installed geant4-config scripts, including Xerces-C for GDML
support. Keep GUI dependencies separate for --without-gui queries
and order external libraries after the Geant4 libraries that use them.
Corrected Qt6 OpenGLWidgets flags and include VTK libraries and visualization
definitions, retaining macOS framework support.
Addressing problem report
#2496.
- Make geant4-config --check-datasets exit with a non-zero status
when any dataset is not found, so that scripts can check the installation.
- In G4InterfaceOptions.cmake, find Qt before SoQt and VTK to preserve access
to Qt's dependency find modules and avoid WrapVulkanHeaders configuration
warnings when both drivers are enabled.
- Preserve resolved library paths, including versioned libraries, and select
Windows import libraries instead of DLLs, respecting configuration
mappings.
- Added the GEANT4_BUILD_FIELD_STATISTICS option to enable collection of
detailed per-thread field-propagation statistics.
- Detect VecGeom exit-normal API support when configuring VecGeom wrappers,
retaining the existing minimum dependency version and older-adapter
compatibility.
- Suppress false-positive warnings from Intel/icx compiler for use of
__COMMON__ macro in G4CMakeRuless_cxx.cmake.
- Honour dataset environment variables in geant4-config, if set.
Based on
GitHub PR #110.
- Added build type for test coverage monitoring.
Currently only enabled for GNU/Clang compilers.
- Support opt-in builds with CMAKE_UNITY_BUILD by using target-level private
include paths and excluding sources that conflict in combined translation
units.
- Added first setup for Doxygen-ation of toolkit code.
- New data sets G4RadioactiveDecay-6.1.4, G4EMLOW-9.0.
- Updated tag-IDs for 11.5.
- Documentation
- Preliminary configuration and build of Doxygen docs for the toolkit code.
- Added global and geometry directories to Doxyfile.
Analysis
- Internal changes:
- In G4THnMessenger, define UI alias to the id of newly created histogram.
Alias name is the histogram name.
- Removed redundant G4TH*ToolsManager.hh, G4TP*ToolsManager.hh header files
with template specialization declarations; the P-files contained erroneous
header guards which hid an obsolete declaration in P2-file.
- Added headers required for used declarations.
- Updated use of G4tools headers to use .hh extension.
- Fixes:
- Fixed redundant n-tuple locking and analysis file error handling.
Use std::defer_lock in G4RootPNtupleManager::AddNtupleRow()
and Merge() to avoid unnecessary mutex acquisition and release
before g4tools performs its own locking. Addressing problem report
#2789.
- Return nullptr on Root and HDF5 file creation failures so callers correctly
detect failure instead of accepting invalid file tuples.
Release HDF5 resources on initialization failures, invalidate groups when
attribute writing fails, and propagate file/group close errors while
attempting all close operations.
- Pass the stored compression level to lazily created file managers so
/analysis/compression takes effect before the first OpenFile
call. Completes the fix for problem report
#2625.
- Keep n-tuple and description indices aligned when skipping inactive or
deleted n-tuples in G4RootMainNtupleManager::Merge(),
preventing an MT crash.
- Read GetNtupleActivation() from the booking manager so merging
workers return the configured activation before the first fill,
without warnings about missing n-tuple descriptions.
- Replaced per-value dynamic_cast checks with g4tools class-ID casts in
G4TNtupleManager, G4RootNtupleManager and G4RootPNtupleManager,
preserving type-mismatch diagnostics and return values.
- Borrow the Root file handle in G4RootPNtupleManager::AddNtupleRow()
and Merge(), avoiding shared-pointer copies and contended
reference counts on every row while retaining ownership in the n-tuple
description.
- Broadcast /analysis/closeFile so workers created later replay
queued open/close commands consistently. Preserve workers-first closing
on the master and skip duplicate physical closes for non-merging workers.
Always close/reset merged-worker n-tuples even when no physical file
is open.
- Fixed /analysis/ntuple/setActivationToAll UI command which was
incorrectly changing global activation selection instead of n-tuple
activation.
- Fixed n-tuple analysis issues reported in dnaphysics and microdosimetry.
Digitization & Hits
- Added draw() method for Probe. Added options to refresh or overlay
new scoring mesh; added options to write more than one color charts;
optimised the background black painting behind the texts in color chart;
added/modified drawing and related UI commands based on above changes.
Cleaned up the implementation of log-scale color map.
- Calculate parameterised dose-scoring volumes on a cloned solid to preserve
navigation geometry. Fixes alternating-bin energy deposits with coupled
transportation and dose scoring. Addressing problem report
#2447.
- In G4SDParticleFilter, added addIon() for Z,A,E,flb.
In G4ScoreQuantityMessenger, added /score/filter/ion and
/score/filter/ions UI commands. Calls associated methods in
G4SDParticleFilter.
Based on GitHub PR #108.
Electromagnetic Processes
- DNA:
- Updated G4DNADoubleIonisationModel, G4DNATripleIonisationModel and
G4DNAQuadrupleIonisationModel to enable the usage of stationary mode
through G4EmParameters.
- G4DNARuddIonisationDynamicModel: fixed max energy transfer.
- G4DNARuddIonisationDynamicModel, G4DNARuddIonisationExtendedModel: at
initialisation, changed the order of definition of type of charged
particle to enable deuteron ionisation in DNA.
- G4DNAIonisation: use EM parameters to define energy limits for a model.
- G4DNAIonisation, G4DNARuddIonisationDynamicModel and
G4DNARuddIonisationExtendedModel: use updated EM parameters.
- G4DNAElastic: use correct type of ions.
- Added verbose for PhyChem processes.
- Updated molecule counter dump templates and added counter output method.
- In G4DNARuddIonisationDynamicModel and G4DNARuddIonisationExtendedModel,
apply correction factor only on cross-section of Hydrogen.
In G4DNARuddIonisationExtendedModel, correction to delta-electron energy
distribution is now different for neutral hydrogen and helium. Improved
initialisation of static data. Addressing problem report
#2710.
- G4DNARuddIonisationExtendedModel, G4DNARuddIonisationDynamicModel: fixed
Bragg peak position for deuteron.
- G4DNAMolecularReactionTable: added protection, checking (R1, R2), to avoid
adding double reactions.
- In G4DNABornIonisationModel, use Verbose() instead of
WorkerVerbose().
- Fixed "out of bounds" access in Event Molecule Counter.
- In G4DNAEmfietzoglouExcitationModel, G4DNAEmfietzoglouIonisationModel
and G4DNAUeharaScreenedRutherfordElasticModel, modified for extension
of DNA option4 to 10 MeV.
- Added G4MesoscopicMoleculeCounter and added hooks for
G4MoleculeCounterManager into G4DNAEventScheduler to record snapshots.
- In G4DNAPTBExcitationStructure, fixed index retrieval for N2 in function
ReplaceMaterial(). Addressing problem report
#2756.
- Fixes in the calculation of the scattering angles in classes
G4DNAChampionElasticModel, G4DNAELSEPAElasticModel, G4DNAIonElasticModel,
G4DNAPTBElasticModel, G4DNAScreenedRutherfordElasticModel and
G4DNAUeharaScreenedRutherfordElasticModel.
- In G4DNAIRT::MakeReaction(), make IRT chemistry reproducible.
- G4DNASmoluchowskiReactionModel: in FindReaction(), fixed double
counting of a coordinate (k index), causing SBS chemistry losing
reactions (in the Brownian bridge).
- Fixed RBEBV formula for DNA materials in G4DNACPA100IonisationModel.
Every ionisation now ejects an electron with the default (fast) sampling
of option 6. Before, when the sampled energy transfer was not above the
binding energy, the H2O+ was created but no electron (0.8 % of the
ionisations above 100 eV, 2-11 % between 11 and 20 eV):
sample the energy transfer again for the same shell when
it is not above the binding energy; just above a shell threshold, scale
it from the next table row instead of interpolating it from 0.
- In G4DNAEmfietzoglouExcitationModel, G4DNABornExcitationModel1,
G4DNABornExcitationModel2 and G4DNARPWBAExcitationModel, create the
excited water molecule only when the excitation happens. Before, when
the sampled level was at or above the particle energy, the particle
kept its energy and nothing was deposited, but the chemistry still got
an excited water molecule and its products.
Emfietzoglou (option 4): 1-14 % of the excitations of 10-13.77 eV
electrons, 1.9 % of all excitation steps of 1 keV electrons.
Born model 1: up to 56 % of the excitations at 10 eV.
Results without chemistry do not change.
- In G4DNAOneStepThermalizationModel, for Terrisol1990 below 1 eV,
interpolate in the table interval that contains the energy.
Terrisol1990 uses the last value of its table above 9 eV.
It raised a fatal exception, but options 4 and 6 hand electrons up
to 10 and 11 eV to the solvation model: with this model and
chemistry the first electron solvated above 9 eV aborted
the run.
- Moved G4ITReactionSet::Instance() to the source file, so
that it can be called from outside the library on Windows DLL builds.
- Fixed reported Coverity defects in G4DNAQuinnPlasmonExcitationModel and
G4DNAELSEPAElasticModel.
- Fixed compilation warning on Intel/icx compiler for variable defined but
not used in G4_NO_VERBOSE mode in
G4ITTransportation::AlongStepDoIt().
- Fixed header guard in G4DNACPA100LogLogInterpolation.
- Added headers required for used declarations.
- Requiring new data set G4EMLOW-9.0.
- Low Energy
- G4PenelopeOscillatorManager: use a local static G4ThreadLocal object to
release each worker's manager and oscillator tables at thread exit.
Remove the raw singleton pointer and recursive self-deletion.
Reset cleared table pointers, making Clear() safe before
table creation, on repeated calls and before rebuilding material
tables.
- Muons
- G4EnergyLossForExtrapolator: in order to avoid data race in the MT mode,
implemented backward propagation only for materials used in geometry,
and ignore base material approach. Use FindIndex() in
TrueStepLength as per use in other functions.
- G4EnergyLossForExtrapolator, G4TablesForExtrapolator: technical
modifications according to changes in utils module. No changes in
physics behavior.
- In G4TablesForExtrapolator, fixed reported Coverity defect on memory
leak at exit.
- In G4MuPairProductionModel, G4EnergyLossForExtrapolator, make static
initialisation safe for the MT mode.
- G4MuPairProductionModel, G4RiGeMuPairProductionModel: fixed reversed
bounds on the number of integration subintervals for restricted energy
loss and microscopic cross-sections, restoring the intended range of
1 to 8. Validation against composite Simpson integration for six
elements and muon energies from 851 MeV to 1 PeV
reduces the maximum relative energy-loss error in the tested cases
from 2.60% to 0.235% for both models.
The large errors only appear in unrestricted or high-cut dE/dx at
T >= 10TeV.
- Standard
- Updated G4UrbanMscModel with final optimisation of the step limit
algorithm, used in EM physics option3.
- G4CoulombScattering: provide correct printout at initialisation (do not
limit per particle type).
- G4eplusAnnihilation: added a new limitation for positronium that cannot be
formed in vacuum; the current limit is set to the density of the media
(1.e^-5 g/cm3).
- G4OrePowellAtRestModel, G4PolarizedOrePowellAtRestModel: minor change in
info printout to be uniform.
- Utils
- G4EmParameters, G4EmLowEParameters: added member functions to
enable/disable the usage of multiple ionisation for DNA physics.
Added corresponding command in G4EmLowEParametersMessenger.
- G4LossTableBuilder: in order to avoid data race in backward propagator,
added extra logical parameter to public methods; should not affect any
existing application.
- G4EmDataRegistry, G4VMultipleScattering: added new methods for use in
parallel initialisation of EM physics.
- G4VEnergyLossProcess: optimised computation of mass ratio for ions.
- G4EmDataHandler: fixed destruction at exit.
- G4EmParameters, G4EmLowEParameters: added extra parameters and extended
information printout for energy transition between DNA and standard
models. Defined new parameters for e-, protons, and ions.
- G4EmLowEParameterMessenger: added UI commands for transition energies.
- In G4EmTableUtil, added a new method IsForPrinting() allowing
to select the list of particles for print of the process/model information
in one place. This list is extended to deuterons and some hadrons,
for which hadronic information is printed but EM information was
not printed.
- G4VEmProcess, G4VEnergyLossProcess, G4VMultipleScattering and
G4TransportationWithMsc: use IsForPrinting() method from
G4EmTableUtil to identify particles, for which the default printout
is needed; the method IsForPrinting() from G4EmParameters is
not used.
- In G4VEmProcess, fixed possible read out of boundary.
Addressing problem report
#2770.
- G4EmParameters: simplified usage of the flag for printing EM parameters,
it is now only used for dumping of the EM parameters table of this class,
so atomic pattern is not needed; added warning to corresponding methods,
only verbose is used in consumer classes.
- G4LossTableManager: added new methods RunNumber() and
ThreadID(); internal variable run is now incremented
in one place of the code both in the master and worker threads; do not
set flags into the class G4EmParameters.
Skip registered energy-loss processes with no particle during table
construction and verbose diagnostics. Custom
tracking managers may leave ordinary processes registered but
unprepared.
- G4EmDataRegistry: use protection locks in several methods to avoid
potential data race in the case of non-standard use of the class; removed
obsolete private method.
- G4EmSaturation, G4EmBiasingManager: use std::size_t.
- G4EmCalculator: fixed reported Coverity defects.
- G4EmTableUtil now takes the G4EmModelManager as an argument, such that it
is callable from the G4TransportationWithMsc as well. The shared helper is
now used in both G4VMultipleScattering and G4TransportationWithMsc.
- Build cross-section tables for multiple-scattering models on master thread
for G4TransportationWithMsc.
- G4EmBiasingManager: skip null secondary entries in both
directional-splitting overloads, preventing crashes with Livermore
Compton atomic relaxation. Addressing problem report
#2746.
- In G4EmParametersMessenger, fixed typo in parameter name.
Addressing problem report
#2775.
- Xrays
- G4QuasiScintillation: skip generating real optical photons if quasi
optical photon is created, following the same logic used in
G4QuasiCerenkov.
- In G4Scintillation and G4QuasiScintillation, fixed crash on empty integrals
and fatal error on missing constants for components that are skipped.
Added a warning when scintillation components are empty.
Addressing problem report
#2768.
- G4CerenkovQuasiTrackInfo, G4ScintillationQuasiTrackInfo: added Clone()
method. This method is used when cloning G4Track for sub-event.
- In G4XrayReflection, minor update of surface attenuation.
Error Propagation
- Fixed sign of (lambda, zPerp) multiple-scattering correlation in
G4ErrorFreeTrajState. Addressing problem report
#2767.
Based on
GitHub PR#117.
Event
- G4PrimaryTransformer: added SetCheckPrimaryMass()/GetCheckPrimaryMass()
to enable or disable the primary mass check while preserving its tolerance
and exception severity. The check remains enabled by default.
In G4EvManMessenger, added /event/checkPrimaryMass UI command, available
in PreInit and Idle states and broadcast it to workers. Mention
the command in the mass warning and correct the reported exception origin.
Addressing problem report
#2666.
- G4SingleParticleSource: moved the position, momentum direction and energy
getters out of line to keep access to the particle-property cache inside
the event library, avoiding separate cache instances across Windows DLL
boundaries. Addressing problem report
#2508.
- Fix in G4SPSAngDistribution, where unsynchronized shared Theta/Phi members
were corrupting the primary momentum direction for user-defined angular
distributions. Addressing problem report
#2796.
Externals
- Disable unity builds for all bundled dependencies in the parent CMake
directory, keeping this policy independent of upstream dependency updates.
- G4tools:
- General modernization of classes in tools/lina (linear algebra):
removed unused classes, member functions; removed deprecated/duplicated
member functions, updated client code to use single form where needed;
refactored box/line/plane/vec/quat/mat into single forms; refactored
colorf to use composition; preliminary refactor of matrix classes.
- Modernised, simplified and optimised string-related functions.
- Maintenance fixes highlighted by implementing unit tests for string
related functionality.
- Removed obsolete rtausmef RNG; C++ Standard Library provides
sufficient quality and distributions for use within tools itself.
- In tools/sg/group, added takeover_nodes() method to transfer
nodes from another group.
- In toolx/sg/text_freetype_marker, override char_height_touched()
to properly handle the field height.
- Tidy unused/irrelevant/redundant code from within tools/sg plotting.
- Fixed compilation warnings for "missing braces around initializer",
observed with gcc-11.5. Addressing the problem report
#2705.
- Fixed HDF5 Boolean scalar serialization in toolx/hdf5/T_tools.hh by
converting through an int buffer, preserving the existing file datatype.
Prevents reading uninitialised bytes beyond histogram axis flags, reported
by Valgrind in AnaEx01 example, and overwriting adjacent bytes when
reading them.
- Omit entry-offset tables for fixed-size scalar int, float and double
n-tuple columns, storing entries with a fixed byte stride.
- Updated branch metadata and both flushed and embedded basket headers
consistently, including MPI basket reconstruction.
- Retain entry-offset tables for variable-size columns.
- Move MT basket preparation and compression outside the shared file mutex
in all three n-tuple layouts, allowing workers to compress concurrently.
Keep file-offset allocation, writes and branch metadata updates locked.
Write each basket group under one lock in the column-wise layout that
preserves rows, maintaining alignment between columns.
Retain the serial basket write path and bound the compressed-buffer memory
retained while preparing a basket group.
- Clear the branch basket pointer before transferring ownership in
pfill() and end_pfill(), preventing use-after-free
during cleanup after a failed basket write.
- Migrated G4tools headers/includes to use .hh extension for clarity and
discoverability. Extension chosen for consistency with remainder of
toolkit.
- Rationalised header and namespace ordering for clarity.
- PTL:
- Protect thread-ID map removal in ThreadPool::destroy_threadpool()
with the same mutex used for registration and lookup. Joining one worker
does not prevent other workers from accessing the global map; concurrent
removal could corrupt it and cause an invalid free during pool
destruction.
- Use acquire ordering when successfully claiming a TaskSubQueue, paired
with release ordering in ReleaseClaim(), to synchronize accesses
to the underlying task list. Relaxed ordering did not protect queue
contents between successive owners and caused data races during
insertion/removal.
General Processes
- Biasing
- Moved processes classes G4UserSpecialCuts, G4SpecialCuts, G4MaxTimeCuts
and G4MinEkineCuts from physics_lists/constructors/limiters module.
- Fixed G4BiasingProcessInterface to preserve the parallel-world biasing
operator across scoring-mesh boundaries, preventing importance biasing
from being disabled. Addressing problem report
#2620.
- Fixed memory leak in G4ImportanceProcess by deleting the ghost step in
the destructor. Release ghost-step and process touchable handles in
EndTracking() on the tracking thread, avoiding use of thread-local
allocators from the master during process deletion.
- Fixed G4ImportanceConfigurator to retain each thread's importance process
and remove it from its process manager and process table before deletion.
Made track-terminator lookup thread-specific and prevented duplicate
configuration within a thread. Removed unnecessary G4MULTITHREADED guards
around mutex declaration and locking.
- Cuts
- Refactored ScanAndSetCouple() in G4ProductionCutsTable to
avoid re-visiting shared logical volumes reachable via multiple paths
in the volume hierarchy.
- Parameterisation
- G4FastSimulationManagerProcess: in StartTracking(), call
PrepareNewTrack() from G4PathFinder only when a ghost
(parallel) world is navigated.
- Scoring
- Replaced leaked thread-local scratch pointers in G4ParallelWorldProcess and
G4ParallelWorldScoringProcess with local static thread local G4FieldTrack
end-state objects and automatic ELimited step-limit values, scoped to the
navigation branch of AlongStepGetPhysicalInteractionLength().
Avoid scratch-storage allocation and retention, including when the safety
shortcut is taken.
- Solid State
- Removed obsolete phonon module, processes now integral part
of the G4CMP package.
- Transportation
- In G4Transportation, offer the end-point isotropic safety to
G4PropagatorInField via UpdateSafety(..) when transport and
propagator use the same navigator. This avoids recomputing the end-point
safety at every step when steps are short (e.g. with small step limits
in a field).
Geometry
- Updated Doxygen documentation with grouping commands to organise
classes/functions documentation by category/subcategory.
- Biasing
- In G4WeightWindowStore, optimised GetLowerWeight() to avoid
copying the energy-to-weight map. Addressing problem report
#2802.
- In addition to the above, use upper_bound() instead of a
linear scan, preserving strict energy boundaries and error handling
for NaN energies.
- Divisions
- In G4PVDivision and G4ReplicatedSlice, adapted to new scheme of providing
a separate, per-thread instances of a logical volume's solid, material,
mass and cuts-couple attributes. For the new split-class mechanism
(trigerred at runtime) these classes signal the need to use separate
per-thread state by calling MarkMaterialMutable() from
G4LogicalVolume.
- In G4ReplicatedSlice, enhanced parameter checks in the constructor;
CheckAndSetParameters() takes a non-const pLogical,
so it can mark the logical volume mutable.
- Magnetic Field
- Preserve concrete stepper types in G4FieldSetup: construct type-specific
integration drivers for built-in field steppers instead of instantiating
their drivers with G4MagIntegratorStepper as the template parameter:
create G4IntegrationDriver for regular steppers; retain type-specific
FSAL driver construction; use polymorphic fallback for user-provided
steppers; support both magnetic and electromagnetic field configurations;
correct driver ownership during repeated field updates.
- Added explicit field integration driver selection: added a driver type
to G4FieldParameters and exposed it through the /field/driverType
UI command.
- Support explicit selection of the integration, FSAL, and interpolation
drivers while retaining the existing stepper-based choice as the default.
Validate driver and stepper compatibility in G4FieldSetup.
- Optimised field propagation and added optional diagnostics:
reuse FSAL endpoint derivatives across chord advances when the complete
retained field-track state is unchanged, and invalidate cached derivatives
when tracking starts or the equation or stepper changes.
Added G4FieldPropagationStats with optional per-thread counters for field
and RHS evaluations, integration and chord trials, reintegrations,
interpolation reuse and FSAL derivative reuse.
- Reduced the chord-error calculation from two square roots to one.
- Removed legacy integration-driver counters superseded by
G4FieldPropagationStats, and restrict endpoint-distance checks to
G4DEBUG_FIELD builds.
- In G4BorisDriver, fixed AccurateAdvance() to return false when
integration stops before reaching the requested curve length, so chord
advancement reports the actual distance advanced. Addressing problem report
#2805.
- Fixed out-of-bounds accesses in G4BogackiShampine45 and G4TsitourasRK45
DistChord() for six integration variables by sizing buffers for
the full state and preserving the initial time for the auxiliary step.
Addressing problem report
#2790.
- Fixed header guard in G4MonopoleEq.
- Management
- In G4VSolid, parallelised EstimateCubicVolume() and
EstimateSurfaceArea() using the tasking infrastructure on
demand, splitting Monte Carlo samples into deterministic chunks with
local random streams and reductions.
- In G4LogicalVolume, parallelised GetMass() for independent
daughter contributions using the tasking infrastructure on demand.
Warm cubic-volume caches before parallel mass traversal, avoiding lock
ordering deadlocks in lazily computed composed solids while preserving
on-demand initialisation.
- Added G4GeomTaskHelper to factorise setup and cleanup of geometry tasking
thread pools, PTL thread data and registered task-local workspace callbacks.
Added an independent seed stream and G4QuickRand seeding helper for
on-demand geometry calculations, avoiding use of the simulation random
engine.
- Added G4GeometryManager switches to force serial processing for
GetMass() and GetPointOnSurface() related estimates
and geometry overlap checks.
- In G4LogicalVolume, refined the storage of key attributes which are
constant during simulation for specific volumes types, i.e. logical
volumes used only in placement and replicas physical volumes.
The attributes are the solid, material, and cuts-couple pointers, and the
value of the mass; for these instances the 'master' value is always used
and a slot for "per-thread" values is NOT created.
Logical volumes used by "varying" physical volumes (parameterised,
divisions, replicated slices) are marked as "mutable" and maintain a
per-thread (split) instance of the attributes, as they can have
multiple values.
- Added a class, G4ParameterisationChecker, which checks for a parameterised
replica-family logical volume which is inconsistent with orthodox
expectations (e.g. a parameterisation keeps the same logical volume for
all daughter volumes). Marks these as "mutable" and provides (temporary)
work-around.
- Added a shared recursive polyhedron-cache mutex in G4VSolid to avoid lock
ordering deadlocks for nested solids.
Documented cache lifetime constraints.
- Avoid duplicate tree search done in G4RunManagerKernel when invoking
CheckRegions(), by adding a Boolean return value to
SetWorld() in G4Region, to indicate if the volume is placed
in the world or not.
- In G4Region, added static CollectRegions() function to collect the
regions below a logical volume, visiting each logical volume once, and
SetWorldPhysical(). BelongsTo() keeps its early exit
and now visits each logical volume once.
- Added out-of-line HasSubInstance() checks to G4LogicalVolume and
G4Region to keep splitter static-data accesses within the geometry library,
avoiding dllimport template-instantiation errors in Windows DLL builds.
- In G4LogicalCrystalVolume, replaced old and obsolete G4LatticePhysical
name string with G4LogicalCrystalVolume in a verbose message.
- In G4UAdapter use VecGeom exit-normal output when available, including
the supporting-plane flag, avoiding a separate normal query.
Retain compatibility with older VecGeom versions and the ordinary
distance-only path. Evaluate the fallback exit normal at a non-negative
distance for wrong-side points.
Return the VecGeom exit normal also for non-supporting exit planes, keeping
validNorm tied to the supporting-plane flag. Requires VecGeom to
provide requested normals for all finite exits.
- Fixed GetPolyhedron() cache locking in G4UAdapter and
G4ReflectedSolid; delete the old reflected polyhedron when rebuilding.
Exposed EstimateSurfaceArea() of G4VSolid, resolving its
ambiguity with VecGeom shapes.
- Navigation
- Parallelised overlap checks for placed volumes in G4GeomTestVolume
using the available tasking thread pool, or a temporary local pool in
MT builds. Temporary results are cached by G4GeomTestVolume and
reported in geometry traversal order. Parameterised and other
specialised physical volumes retain their existing serial overlap
checks.
- Added task-local geometry and solids workspaces, deterministic random
seeds and surface sampling warm-up, including constituents of
G4MultiUnion, for safe concurrent overlap calculations.
Made UI commands for checking overlaps master-only commands to avoid
repeating the full overlap check on every worker in MT/tasking
applications.
- Reuse G4GeomTaskHelper in G4GeomTestVolume to share the tasking pool,
PTL thread-data and task-local geometry workspace setup with geometry
management code while preserving the overlap-check execution policy.
Use the independent G4GeomTaskHelper seed stream for parallel overlap
checks and composed-solid surface warm-up, avoiding use of the simulation
random engine.
- Added /geometry/test UI commands to force serial processing for
GetMass() and GetPointOnSurface() related estimates and
overlap checks.
- Introduced new classes G4TouchableWalker and interface
G4VTouchableVisitor, allowing perusal of the full tree of touchables,
i.e. all the trunk and leaf volumes of the geometry (descending every
copy of replicas and/or parameterised volumes).
A concrete example visitor class G4TouchableCollector identifies any
touchables that are instances of a particular logical or physical
volume.
- Added new classes G4VolumeTreeWalker and G4VVolumeTreeVisitor which
visit each physical and logical volume. In this case a replicated volume
(replica, parameterised volume) is visited only once. A concrete example
visitor class G4VolumeTreeReporter prints the volume tree, one line per
logical and physical volume.
- Added a new class, G4GeometryMemoryAdvisor, to analyses a constructed
geometry and report how many distinct logical volumes are either
"mutable" (daughter of a G4PVParameterised, G4PVDivision, or a
G4ReplicatedSlice), and so carry per-thread attributes, versus "shared"
(everything else, sharing those fields across all threads with no
per-thread storage for them). The class also reports the per-thread
LV-side memory this geometry actually uses, and the amount saved.
- Extended G4LogicalVolumeUsageVisitor to count physical volume types.
Extended G4VTouchableVisitor and G4TouchableWalker to 'Regular'
Structures.
- In G4VolumeTreeWalker, fixed undefined behaviour in dispatch with did not
correctly distinguish between the three independent sibling physical
volume subclasses.
- Added new checker class G4ParameterisationCheckVisitor, exercising every
parameterisation, including ones nested inside one or two replica levels.
- Added helper method CheckAndConfirmTouchable() in G4Navigator, which
undertakes a check of candidate touchable, corrects the location if it is
in another volumes and reports if position is outside the world volume.
Added auxiliary methods ReportOutsidePoint().
- In G4VoxelNavigation, added consistency checks in ComputeStep() and
ComputeSafety(), that internal data (VoxelStack) is up-to-date with
the current volume's voxel header (if not correct, fix it before proceeding);
ensure that daughter indices found in voxel data structures are within
bounds; a warning is issued when either problem occurs, with frequency
reducing; navigation proceeds, with a corrective action.
- In G4PropagatorInField, added UpdateSafety(position, safety),
which lets a caller offer an isotropic safety computed at position
(e.g. at the end point of a step). It replaces the remembered safety only
if it is larger at that point, so that following chords inside it can skip
the navigator.
- In G4MultiLevelLocator, fixed potential out of bounds array access in
EstimateIntersectionPoint(..).
- In G4VoxelNavigation and G4VoxelSafety, use G4AffineTransform's
InverseTransformPoint() instead of calling Inverse()
and then TransformPoint(), avoiding extra work.
- In G4AuxiliaryNavServices, added a method CheckTransformedPoint(),
which checks if the new way of applying transformation using
InverseTransformPoint() provides the same results as the old way.
- Removed unused G4MultiNavigator data member fMinSafety, fixes a
compilation warning on Clang compiler.
- Solids (Boolean)
- Independently copy internally created displaced operand-B wrappers in
Boolean copy construction and assignment, preventing clone destruction
from invalidating the original’s transformations.
- Fixed GetPolyhedron() cache races in G4BooleanSolid, G4MultiUnion,
G4DisplacedSolid and G4ScaledSolid using the shared recursive mutex,
allowing nested-solid access without lock ordering deadlocks.
Delete old displaced and scaled polyhedra when rebuilding their caches.
- Corrected union normals at hidden operand edges and distant Boolean entry
queries. Fixed cached interval offsets and progression in intersection
traversal, avoiding zero entry distances on iteration exhaustion.
- In G4SubtractionSolid, preserve operand A entries rounded outside its
surface when operand B is outside, preventing missed subtraction
intersections.
- Accelerated G4MultiUnion accurate DistanceToIn(p) safety with a
component bounding-box hierarchy: measured 47x/192x/54x gains for
grid/chain/rotated-grid layouts at 16,384 components; worst-case query
complexity remains O(N). Reused cached voxel candidates and reentrant
thread-local entry scratch, eliminating measured warmed-query allocations.
At 16,384 components, local navigation gained 6-20x and longitudinal
chain exits 12x, with approximately linear measured chain-exit scaling
(N^1.08 over 64-16,384 components). Cached bounds during voxelization,
making BoundingLimits()/CalculateExtent() O(1) afterwards;
invalidate on AddNode() and rebuild on re-voxelization.
With updated G4Voxelizer for solids, G4MultiUnion retained memory at 16,384
components fell from 132.8 to 4.66 MB for overlapping chains and from 4.52
to 3.93 MB for separated grids; both measured approximately N^1.01 scaling
over 64-16,384 components. Coarsening can increase candidate counts for
dense or irregular layouts. Preserved accurate-safety mode during outside
SurfaceNormal() queries.
- Solids (CSG)
- G4Tubs, G4CutTubs and G4Cons: replaced atan2-based phi checks with cached
phi-plane predicates in Inside(), SurfaceNormal() and
DistanceToOut() queries. Simplified code overall in those queries.
Account for angular tolerance in phi exits and code refactoring.
Corrected near-axis and corner ray intersections and classification of
nearly full phi spans. Corrected the inner-cone exit side and normal
validity in G4Cons, and oblique phi-face areas in G4CutTubs.
Navigation benchmark averages improved by 1.8x for G4Tubs, 1.7x for
G4CutTubs and 1.6x for G4Cons, using different topology configurations.
- G4Tubs: corrected grazing departures from tolerated phi surfaces and
distant cylinder entries when cancellation erases the discriminant. Accept
tolerated outward entries at the inner cylinder, avoiding potential missed
cut boundaries in subtraction exits.
- G4Cons: clamp tolerated outward departures before checking intersections
and retain shallow exits. Handle rounded outer-surface tangencies.
Fixed case of spurious entry on axial ray through cone apex.
Stabilise distant tube/cone entries before evaluating radial roots.
Corrected tube exits through the axis and phi normals at the axis.
Stabilise the positive quadratic root in DistanceToIn(p,v),
avoiding spurious zero-length entries from cancellation at stave
boundaries.
- G4Box: little optimisation in DistanceToIn(p,v) and
DistanceToOut(p,v).
- Reworked G4Para directional distance queries in its oblique box frame,
replacing repeated side-plane clipping with three slab intersections and
direct exit-face selection. Shared the exit traversal between normal and
no-normal queries to avoid duplicated code.
- In G4Trap, cache a separate outward-entry rejection tolerance, offset from
Inside's inner surface threshold by the local roundoff allowance. Prevents
rounded departures from being accepted again as zero-distance entries;
retain classification, inward entries and ordinary exits. Copy the new
cache. Resolves a zero-step cycle detected in CMS geometry.
- In G4Trd, refactored DistanceToIn(p,v) and
DistanceToOut(p,v,n).
- In G4Sphere and G4Torus, replaced atan2-based phi checks with cached
predicates in Inside() and surface-normal queries; also use the
predicate when filtering exact G4Torus intersections. Removed the remaining
atan2-based angular checks using cached cone/wedge predicates and monotonic
polar-angle comparisons. In G4Sphere, avoid computing the point theta angle
in DistanceToIn() for solids without theta cuts.
Code cleanup, removed obsolete branches, redundant temporary arrays,
repeated phi trigonometry and verbose safety calculations. Expressed theta
safeties directly as cone-plane distances.
Speedup mean over all benchmarked queries improved by 2.26x for G4Sphere
and 5.00x for G4Torus.
- G4Sphere: fixed negative distances in DistanceToOut() for
cone-parallel rays by rejecting backward and wrong-half-cone theta
intersections. Based on
GitHub PR #116.
Fixed DistanceToOut() for a wide-phi (>pi) sphere starting on a
phi cut plane, which could report the outer-sphere distance for a ray
that immediately leaves the valid wedge.
- In G4Torus, use a scale-normalised analytical quartic with Newton polishing
and residual validation for exact-distance queries, retaining Jenkins-Traub
as a fallback. Use fixed-size root buffers and cached phi trigonometry
throughout. Condition distant ray entries at the bounding box to avoid
missed intersections and inaccurate entry distances for thin tori.
Fixed selection of the VecGeom wrapper by removing the obsolete
G4GEOM_USE_SYS_USOLIDS guard. In G4UTorus wrapper, rebuild all VecGeom
derived state when setters are used, preserving phi wedges and bounds for
parameterised solids.
- In G4Tubs, G4CutTubs, G4Cons and G4Torus, fixed defects (DIVIDE_BY_ZERO)
reported by Coverity in ApproxSurfaceNormal().
- Fixed DCLP thread-safety in GetPolyhedron() of G4CSGSolid by
holding the shared recursive mutex across cache checks, rebuilding and
pointer retrieval.
- G4UTrap: fixed the Right Angular Wedge constructor passing an
already-computed slope where VecGeom's UnplacedTrapezoid expects an
angle and applies its own tangent, shearing the wedge incorrectly.
- Solids (Specific)
- G4SolidsWorkspace now registers task-local workspace setup and cleanup
callbacks with G4GeomTaskHelper.
- Use area-weighted point-on-surface sampling for G4VCSGfaceted and
G4TessellatedSolid without adding persistent cumulative area tables;
G4TessellatedSolid now samples facets proportionally to facet area.
- Fixed lazy initialisation races for point-on-surface surface-element
tables in G4GenericPolycone, G4Polycone and G4Polyhedra.
- Strengthened lazy area/volume cache initialisation with checks under the
cache mutex; G4TessellatedSolid accumulates values locally before
publishing them.
- Optimised G4Polycone, G4GenericPolycone and G4Polyhedra queries with
solid-specific RZ/phi fast paths, cached phi-boundary trigonometry and
flattened Z/RZ candidate tables allocated only for large solids.
Added an analytic exact-vector-distance path for G4Polycone using cached
cone sections, Z-directed section traversal and integrated phi-plane tests.
Removed atan2() from G4Polyhedra/G4PolyhedraSide segment selection
and improved G4IntersectingCone line intersections.
- Reduced G4VCSGfaceted exact-distance and safety overhead with Z-section
indexing, early candidate rejection and stack-backed visited tracking.
- Accelerated polycone/polyhedra queries for large, stepped and non-convex RZ
profiles using indexed candidate traversal, with exact faceted fallbacks.
- Added a compact exact-distance kernel for full-phi, two-plane G4Polycone,
including hollow profiles, while retaining the general faceted fallback.
- Use direct or binary Z-segment lookup for monotonic standard polycones.
Improved timings of 62.6% and 59.9% for full-phi, two-plane G4Polycone
DistanceToIn(p,v) and DistanceToOut(p,v), respectively.
For 100 Z planes, Inside(p) is 69.5% lower and all G4Polycone
queries average 18.5% lower.
- Restricted G4Polycone, G4Polyhedra and G4GenericPolycone RZ fast paths
to profiles where their signed RZ safety/normal classification is
semantically equivalent to the faceted implementation.
Added supporting-boundary convexity checks for RZ profiles; allow ordered
z-plane fast paths for G4Polycone and closed-phi G4Polyhedra. Fixes CMS
navigation regressions from unsafe RZ shortcuts while preserving performance
gains for regular monotonic and convex profiles.
- Improved G4Polycone/G4Polyhedra safety scaling with a compact RZ bounds
hierarchy, retaining direct scans for short profiles.
Localised horizontal-edge checks in Inside() to the relevant
Z slabs. Use linear lookup for short Z-slab tables and extend phi-face
rejection to short polyhedra normal queries, preserving near-tie
comparisons. Improved exit safety with local Z-ordered contour searches,
retaining the RZ bounds tree for long profiles.
Bypass azimuth selection in one-sided polyhedra Inside() and
safety queries, with conservative phi-face rejection for short profiles.
Fixed grazing cone intersections and cap rounding, retaining a common
solver for sensitive two-plane exits with and without normals.
Corrected polycone phi-cut exits and rotated full-phi polyhedra bounds.
- In G4Polyhedra, fixed SurfaceNormal() on slanted lateral facets.
Fixed Inside() classification beyond finite RZ profile edges.
Classify supporting side faces from the RZ profile to correctly report
valid exit normals, including for convex prisms.
- In G4PolyhedraSide, reject non-crossing exits at reentrant RZ joins when
the ray enters the adjoining face's half-space. Cache corner flags and
reuse edge-normal bisectors; preserve genuine corner crossings and grazing
contacts. Fixes cases detected in CMS geometry.
- Fixed G4Polycone entry safety on phi cuts and surface exits in two-plane
profiles. Corrected normal validity on concave radial boundaries.
Corrected grazing and distant-ray intersections in G4Polycone and
G4IntersectingCone. Retain tolerated entries at finite cylinder/cone
joins in the shared polycone intersection solver, including
G4GenericPolycone.
- In G4Polycone, use supporting half-planes for convex RZ classification,
fixing false phi-face entries and zero safeties for descending-Z profiles.
Cache slope-adjusted radial tolerances for correct normal-distance
classification on steep inner and outer conical faces; precompute
interpolation slopes to avoid per-query division and retain finite-edge
checks at Z joins. Resolves few cases of zero-step cycle detected in ATLAS
geometry.
- In G4PolyconeSide, reject spurious step-plane crossings at radial endpoints,
preserving inward grazing exits and genuine adjoining-face crossings.
Reject non-crossing exits at reentrant RZ joins using the adjoining face
normal, including axial rays through step/cone corners.
Cache corner flags and endpoint limits, and check the hit direction before
corner tests to keep ordinary face hits fast.
Resolves few cases of zero-step cycle detected in ATLAS geometry.
- In G4GenericPolycone, fixed cap-adjacent convex RZ classification and
consequent safety overestimates; retain indexed classification for long
profiles.
- In G4Hype, fixed DistanceToIn(p,v) accepting a root of the
hyperbolic surface far beyond halfLenZ when an endplate crossing was
certified, returning a distance shorter than the safety for distant rays.
Corrected the inner-surface normal test in DistanceToIn(p,v),
which used the outer stereo angle. Rays entering the material through
the inner hyperbolic surface could be rejected, returning
kInfinity for a crossing that exists.
- In G4Paraboloid, corrected the surface relation used by
DistanceToIn(p) safety. The safety could exceed the true
distance to the solid, so a step of one safety could reach material.
- Corrected G4EllipticalTube zero-distance exit normals to use the original
ellipse coordinates in both outgoing and grazing lateral-surface branches.
Preserve small transverse components in near-axis rays.
- In G4ExtrudedSolid, accelerated polygon queries and exact entry with edge
rejection, cap shortcuts and convex Z-slab clipping, prioritising small
prisms. Measured gains: Inside 1.5-1.8x and exact entry/exit 2.2x/2.1x.
Improved scaling over the number of facets; large-mesh construction gained
9-15x over earlier native versions, with up to 55x less heap in the tested
toroidal mesh. Retain unambiguous vertex exits from non-convex right
prisms, avoiding missed tessellated intersections that returned a zero exit
distance. Corrected grazing exits starting just outside a non-convex
prism.
- Fixed DCLP thread-safety in all GetPolyhedron() implementations
by holding the shared recursive mutex across cache checks, rebuilding and
pointer retrieval, replacing local polyhedron mutexes.
- Accelerated navigation in G4TessellatedSolid and G4QuadrangularFacet
queries using geometry caches and hierarchies, preserving finite-surface
safety and tolerance handling. Code cleanup.
Fixed missed voxel entries, copying/reopening and shared scratch handling.
Recorded speedups over original native navigation (geometric means):
tessellated Inside 2-74x, normals 3.9x, exit safety 9.4x and exact
entry/exit 1.2x/8.2x.
- G4TriangularFacet: corrected Intersect() edge tolerances to use
physical distances, fixing false inside classifications and overlap
reports for thin tessellated facets. Use signed edge-distance tests
near boundaries to avoid barycentric cancellation, with a conservative
barycentric filter for ordinary crossings and no additional per-facet
storage. Fixing issue reported in
GitHub PR #125.
- In G4ExtrudedSolid, cache supporting edges for valid exit normals in concave
right prisms; retain facet-based validity for multisection extrusions.
- G4GenericTrap: reject outward surface re-entry in DistanceToIn(p,v),
while preserving later intersections with concave ray profiles on
twisted faces. Removed a redundant vertex copy in assignment operator.
- G4Tet: simplified candidate-face collection and skip normal bookkeeping for
distance-only exit queries; measured approximately 30% lower exact-exit
time.
- Extended G4Voxelizer to support voxelisation along a subset of axes.
Replaced dense G4Voxelizer masks for solids with bounded cell candidate
lists, coarsening the grid as needed for O(N) retained and temporary
storage. Added direct point lookup and preserved candidate exclusions
and diagnostics. Helps in improving memory scaling in G4MultiUnion
structures.
- G4Ellipsoid: combine entry rejection checks to reduce branching.
Measured approximately 15% lower exact-entry time.
- G4Hype: simplified exit-surface tracking and defer output-normal
construction. Measured approximately 7% lower exact-exit time
without/with normals.
- G4EllipticalTube: reduced entry-rejection branching and reordered slab
calculations; measured approximately 34% lower exact-entry time.
- G4EllipticalCone: combined exit-cap branches and avoid redundant cap
checks; measured approximately 11% lower exact-exit time without
normals and 6% with normals.
- Corrected twisted-faceted exit normals and directional intersections,
including certified high-twist vertical crossings and fixed
assignments to release old constituent surfaces before rebuilding.
- Accelerated G4TwistedTubs for Inside() with immutable cached
bounds and direct radial, phi and endcap classification, retaining the
legacy path for directly persisted objects; measured about 5.0x for
Inside() and a further 1.2x for directional exact distances
and SurfaceNormal across the benchmarked topologies. Code cleanup.
- Accelerated faceted solids (G4TwistedBox, Trap and Trd) Inside(),
safety queries, SurfaceNormal() and exact-distance queries with
immutable untwisted-face data, early candidate rejection, allocation-free
storage and a certified first-root solver with exact fallbacks. Measured
about 7.0x for DistanceToIn(p,v) and 12.0x for both
DistanceToOut(p,v) variants. Code cleanup.
- Removed obsolete G4GEOM_USE_SYS_USOLIDS guards from the VecGeom wrappers
for G4Ellipsoid, G4EllipticalCone, G4EllipticalTube, G4Hype and
G4Paraboloid, enabling their replacement when GEANT4_USE_USOLIDS is set
to ALL. Corrected the include ordering in G4EllipticalCone so its
wrapper-selection macro is defined before guarding the native
implementation.
- Fixed stale polyhedra after dimension or visualisation changes in the
VecGeom wrappers for G4Ellipsoid, G4EllipticalCone, G4EllipticalTube,
G4GenericTrap and G4Paraboloid, and while building or finalising
G4TessellatedSolid. Applied the matching visualisation-subdivision fix to
native G4GenericTrap.
- Added the missing parameterisation dispatch to G4UEllipsoid and corrected
G4UHype bounding limits to use the outer end radius.
- Volumes
- Refactored G4PVPlacement overlap checking to separate computation from
reporting without retaining results in the physical volume, enabling
concurrent checks with ordered diagnostic output.
Added optional task-local random streams for deterministic surface
sampling without changing the random stream used by serial overlap
checks.
- G4PVPlacement overlap checking now seeds only the independent geometry
quick-random stream through G4GeomTaskHelper, avoiding temporary
replacement of the simulation random engine.
- G4GeometryWorkspace now registers task-local workspace setup and cleanup
callbacks with G4GeomTaskHelper.
- G4PVParameterised, G4GeometryWorkspace: adapted for the new per-instance
runtime mutable/shared logical-volume split.
- In G4GeometryWorkspace, added a G4GeomSplitter-based manager for the extra
spliting. In InitialisePhysicalVolumes(), only call
CloneReplicaSolid() if the logical volume is mutable.
- In G4PVReplica, added CheckNoDaughters() function to call before
adding it to mother. Made public CheckOnlyDaughter().
Removed unused code.
Global
- In G4VSIntegration, use random array with 3 random values instead of 2;
removed divisions operations; clearer logic by keeping algorithm basically
unchanged; moved computation of possible second peak height to the
ComputeIntegral() method; made integration less dependent on shape
of the probability function; improved and reorganized comments to the code.
- Optimised G4JTPolynomialSolver work buffers with inline storage for
polynomials through degree eight and a generic heap fallback for higher
degrees, avoiding allocations in geometry navigation queries.
- Use smart pointer and C++11 static semantics to implement G4Cache
backing store.
- In G4CacheDetails, added internal ClearThreadCache() helpers in
G4CacheReference for value and double caches, allowing subsystem cleanup
after a thread's cache users stop. Existing G4Cache ownership and
destruction behaviour is unchanged.
- Fixed G4ReferenceCountedHandle null-pointer assignment to avoid allocating
a zero-count wrapper that leaks on release. Guard reference-count increments
when copying or assigning an empty handle to prevent null-pointer access.
- Keep G4cout and G4cerr file destinations independent in G4MTcoutDestination,
preserving the other stream's files when replacing or restoring a destination.
Preserve file redirection when buffering is requested.
Honour G4cerr transformer filters to prevent errors entering G4cout files.
Addressing problem reports
#2720 and
#2736.
- Added support for FPE handling on macOS with Apple Silicon.
In G4FPEDetection, refactored InvalidOperationDetection() and
TerminationSignalHandler() into a common implementation.
- Removed the legacy __thread fallback for Intel compilers older than
version 15 in tls.hh; Intel builds now use standard C++ thread_local
storage.
- Enriched and grouped Doxygen documentation for core global management
classes. Provided basic Doxygen docstrings. In G4PhysicsVector, document
pre and post conditions on some functions.
- Added headers required for used declarations.
- Updated date of release for 11.5.
Hadronic Processes
- Cross Sections
- In G4GammaNuclearXS, protected initialisation of the shared static
element data table with G4AutoLock.
- Make low-energy limit configurable in G4ElectroNuclearCrossSection while
preserving the original default value as sLowEnergyLimitDefault.
- Fix to address potential division by zero reported by Coverity.
- In G4EMDissociationCrossSection, fix to calculate beta from the dynamic
particle four momentum opposed to use GetBeta() which sets beta
to 1 for LHC heavy ion energies.
- In G4CrossSectionDataStore, use G4endl in DumpPhysicsTable()
in printout of data-set entries. Addressing problem report
#2811.
- Management
- G4HadronicProcessStore: introduced GetInteractionLength()
method.
- Added headers required for used declarations.
- Stopping
- In G4MuonMinusAtomicCapture, added missing implementations of inline
setters SetElementSelector() and SetEmCascade().
Fixed initialisation of local time of muonic-atom secondary in
AtRestDoIt(..), so its track is created at the mu-
stop time. Previously, the later addition of time0 gave
the atom a global creation time of twice the muon's stop time.
Based on GitHub PR #129
and GitHub PR #130.
- Utilities
- G4ReactionProduct, G4ReactionProductVector: fixed reported Coverity
defect; added move operator; use std::size_t; use the same format
for all inline methods; removed unused header G4HadronicException.hh;
use default keyword.
- G4KineticTrack: added a const GetNucleon() accessor so Binary
Cascade can associate an outgoing projectile spectator with its original
nucleon and recover the sampled Fermi momentum. The accessor does not change
the existing tracking-momentum prescription.
- Added as an option, the correlated sampling of inclusive final-state data
(option switched off by default). Based on
GitHub PR #124.
- Fixed leak in G4SampleResonance: replaced the heap-allocated thread-local
minimum-mass cache pointer with a function-local cache object, releasing
the map and its entries at thread exit. Removed unnecessary cache
allocations in SampleMass() and the obsolete const_cast used to
populate the cache.
- G4HadFinalState: fixed condition for exception in GetSecondary().
Use std::size_t; minor code formatting.
- G4DecayStrongResonances: simplified code and some clean-up.
- Abrasion
- G4WilsonAbrasionModel: in GetAbradedNucleons(), fixed momentum
rejection sampling to resample the momentum on each attempt and include
the hyperbolic term in the rejection envelope. Use std::sinh()
for stable evaluation near zero and the limiting ratio at zero.
Addressing problem report
#2616.
- Bertini Cascade
- G4CascadeFinalStateAlgorithm: in GenerateCosTheta(), revert to the
original algorithm for 4-or-higher body generation of cos(theta),
to fix an observed symmetric double bump in the Feynman-x distribution;
the update also repairs unphysical bumps in certain spectra of
secondary pions coming from h+A interactions and does not induce
any additional unphysical effects in the simulated spectra of secondary
pions, protons, and neutrons resulting from h+A interactions.
- Corrected the acceptance-rejection algorithm for generating the polar
angle by uniformly sampling cos(theta) in (-1,1) for the
4-or-more body final states.
- Fixed Bertini secondary creator model IDs in G4CascadeInterface,
tagging particles from precompound and evaporation stages with their
corresponding submodel instead of always using 'model_BertiniCascade'.
- G4InuclCollider now retries elastic-like hadron-nucleus cascade trials
before de-excitation. This avoids sending an unchanged ground-state target
recoil fragment to de-excitation and then removing it during
recoil-fragment cleanup, which leaves only the original projectile and
causes a later retry.
- G4ElementaryParticleCollider: added missing setVerboseLevel()
override, propagating verbosity to the final-state generator at set-time,
as the other colliders already do; removed the equivalent call from
generateSCMfinalState(). No change in results or in verbose
output.
- Fix in G4CascadeT33piNChannel: the pi+ p 6-body channel number
31 reported n pi+ pi+ pi- K+ K0bar instead of
n pi+ pi+ pi0 K0 K0bar, the only missing charge assignment
of that particle pattern; the isospin-mirror pi- n table
had the mirrored duplicate instead of p pi- pi- pi0 K+ K-.
- Fix in G4CascadeOmegaMinusNChannel: the 4-body channel number 30 repeated
Xi0 Sigma- K0 K0bar instead of Xi- Sigma- K+ K0bar,
the mirror of the Omega- p channel Xi0 Sigma+ K- K0.
The duplicated final states were produced with the summed cross-section
of both entries and the missing ones never.
- In G4CascadeSampler, fix in findFinalStateIndex(): when a
multiplicity has only one channel, it returned that channel's position
in the full list of channels instead of 0, its position within the
multiplicity. The caller then read the wrong entry, past the end
of the array. No result changes: the only such channels (mu- p,
3 to 9 bodies) have zero cross section, so they are never chosen.
- Binary Cascade
- G4GeneratorPrecompoundInterface: in the method Propagate(),
removed older check on whether the string model is FTF or QGS.
The exciton's 4-momentum is now determined by imposing the overall
4-momentum conservation of the hadronic interaction, rather than by
summing the residual and captured 4-momenta, as done before.
- In G4BinaryCascade, retain the original projectile-rest-frame momentum of
each incoming nucleon and transfer it to its outgoing spectator product.
Reset the metadata on each Propagate() call and preserve spectator
identification also when the target nucleus is destroyed.
Added GetProjectileSpectatorMomentum() function.
- In G4BinaryLightIonReaction, restore the sampled Fermi momentum when a
neutron-only or single-nucleon projectile remnant is emitted as free
spectators, addressing an unphysical forward neutron energy peak seen
for light-ion beams around 135 MeV/nucleon. Use on-shell
free-nucleon energies and Lorentz boosts, retain transport field kicks,
and preserve the original momentum correlations without recentering the
spectator subset. Balance the other products against the restored spectators
before appending them, avoiding a subsequent global spectator rescaling.
In EnergyAndMomentumCorrector(), on iterative nonconvergence,
fall back to a bracketed scalar solve using the original centre-of-mass
momenta. Regenerate impossible final states up to 20 times, returning the
unchanged primary if the attempts are exhausted.
Addressing long-standing problem report
#1446.
- Delete the remaining final-state tracks in the G4BinaryCascade destructor
to fix a memory leak at shutdown.
- De-excitation
- G4UnstableFragmentBreakUp: reorganised class for sampling of decay of
unstable fragments, which do not have decay channels due to Coulomb
barrier. Updated model may be used for decay of fragments with high
excitation. Limit energy non-conservation to 0.5 MeV.
Removed parasitic printout, which is seen in the case of deuteron
target; removed also debug printout.
- G4Evaporation: updated usage of G4UnstableFragmentBreakUp.
- G4DeexPrecoParameters: changed the default FermiBreakUp model, from
G4FermiBreakUpVI to G4FermiBreakUpAN.
- Fixed Clang compilation warnings in G4FermiFragmentPoolAN by replacing
the non-standard __COUNTER__ macro with separately scoped static
fragments.
- High Energy Theoretical
- Fixed header guard in G4VCrossSectionComposite.
- INCLXX
- In G4INCLKinematicsUtils, added protections in function momentumInCM()
to avoid potential square root of negative number leading to observed
FPE in system testing.
- Extension of INCLXX for in-flight antideuteron interactions.
- Avoid unnecessary use of generic std::pow() in
momentumInCM() functions.
- G4INCLHFB: the four HFB tables are now allocated per thread on first use
in HFB::initialize(), instead of being G4ThreadLocal arrays.
This removes 1.1 MB of thread-local storage from every thread, also
in applications that do not use INCL++. Results are unchanged.
Use an owning smart pointer for the lazily allocated HFB tables,
releasing their storage at thread exit (or program exit in sequential
and standalone builds).
- G4INCLInteractionAvatar: removed the unused per-avatar EventInfo member
and accessed the static thread-local EventInfo::eventNumber
directly in debug messages. Reduces each interaction avatar by about
65 KB, avoiding unnecessary event-data initialization and reducing
allocation-pool memory retention.
- G4INCLXXInterfaceStore: use a function-local thread-local singleton to
release the cached model and UI messenger automatically at thread exit.
Removed the unused DeleteInstance() method.
- G4INCLAllocationPool: own pools in a thread-local registry initialized
before the interface store, releasing recycled storage after model
teardown.
- G4INCLCrossSectionsStrangeness: use local temporary pion objects in
omegaNToLK() and omegaNToSK() to avoid leaking a
particle on each call.
- G4INCLXXInterfaceStore: added const GetINCLConfig(), which
does not delete the model.
- Lend
- Refactored G4LEND to make GIDI+ an implementation detail.
Made all GIDI+ headers private to G4LEND so they are not exposed to
toolkit code or when installed. Hide use of GIDI+ types in G4GIDI
classes behind a Pimpl pattern so that clients are not exposed directly
to GIDI+. As G4GIDI provides the core interface(s) needed to GIDI+, no
further changes are needed. No changes to GIDI+ code, while G4LEND code
changes are pure interface changes.
- Updated model to GIDI+ 3.35.0-3 and pugixml v1.15. Addressed many Coverity
reported defects. Added a thick-target Bremsstrahlung model (usage requires
additional data in the G4LENDDATA directory).
- Added LUPI_HOST_DEVICE_INLINE macro and shared memory placement options
for performance improvements.
- Fixed a bug in thermal upscatter models B and DBRC: angular distribution
was sampled at the wrong projectile energy.
- Removed unused data member m_userNeutronIndex and its constructor
initializers, fixing a compilation warning on Clang compiler.
- Fixed compilation warnings on gcc-16.1 and addressed reported Coverity
defects.
- Lepto-Nuclear
- Addressing reported charge imbalances in Neutrino charged current nuclear
scattering. Addressing problem report
#2764.
- Corrected quasi-elastic charged-current nucleon conversion and recoil
charge in neutrino and antineutrino nucleus models.
- In G4NeutrinoNucleusModel, corrected nucleon and negative-charge resonance
assignments in cluster decay. Reject sampled single-nucleon channels with
impossible charge, discard partial secondaries and return the incident
neutrino unchanged. Updated all charged-current and neutral-current callers.
Restrict the neutral phi shortcut to neutral meson clusters. For charges
+2 and -1 below the first baryon resonance, generate an allowed nucleon and
charged pion above their physical threshold instead of discarding the
interaction. Sample meson-cluster masses only within the domain leaving
a valid baryon-mass interval, avoiding proposal-induced null interactions
without regenerating the event. Sample the low-mass two-body nucleon-pion
decay direction isotropically in the cluster rest frame before boosting
the daughters to the lab, removing the fixed transverse-axis and at-rest
bias.
- Corrected pion and hadronic-cluster charge assignments in the electron and
tau antineutrino charged-current models.
- In G4ANuMuNucleusCcModel, corrected the hadronic-system charge from +2 to 0
for charged-current muon antineutrino interactions on hydrogen, balancing
the outgoing positive muon charge.
- Derive neutral-current cluster charge directly from the struck nucleon in
all six models, correcting the tau-antineutrino proton branch. Discard the
outgoing neutrino when the subsequent QE kinematic check fails.
- Nudex
- G4NuDEXStatisticalNucleus: commented out one line printout.
- Particle High Precision
- Fix in G4ParticleHPProbabilityTablesStore to use canonical function-local
static singleton definition. Fixes thread-safety issue during physics
initialisation and final memory leak.
- Guard probability-table destructors against missing data and incomplete
initialisation, preventing null dereferences and out-of-bounds access
during cleanup at job closure.
- In G4NeutronHPCaptureData, fixed wrong sampling of target isotope in neutron
capture reactions. Before, the target isotope was selected based on the
natural composition of the element, without taking into account the
neutron capture isotope cross-section. The element cross-section
is used for the step and the isotope cross-sections are computed only in
SelectIsotope(), when a capture takes place.
This fix affects all HP-based physics lists (except QGSP_BERT_HP as this
uses G4NeutronHPCaptureXS to select correctly the target isotope).
Addressing problem report
#2782.
Based on
GitHub PR #119.
- Added as an option the correlated sampling of inclusive final-state data.
Based on GitHub PR #124.
- Delete the limit of number of light particles, previously set to 8 in
G4ParticleEnAngCorrelation.
- Fixed improper indexing of H in G4ParticleHPNames::GetName().
Based on GitHub PR #132.
- Added Bernoulli sampling as an alternative to Poisson and BetweenInts to
obtain the multiplicity of products.
Make Bernoulli the default multiplicity option of G4ParticleHPProduct,
overriding the Geant4 11.3 change where BetweenInts replaced Poisson.
- Introduced a new enviromental variable G4PHP_MULTIPLICITY_BERNOULLI_A_MIN,
so that Bernoulli is only applied if atomic number >= A_MIN.
- Fixed G4ParticleHPHash assignment with copy-and-swap: release the previous
upper hash chain, copy the prepared state and preserve the destination
if copying fails.
- In G4ParticleHPVector, read the numbers of the data files with
std::from_chars where it supports double, to avoid one heap
allocation for each number with libstdc++. Other compilers keep
operator()>>. The values read do not change.
- In G4ParticleHPChannelList, fixed leaks of final-state prototypes
in Register() by taking ownership and deleting the prototype
after isotope cloning, including on exceptions. Covers HP and VI
inelastic initialisation.
- Kept G4ParticleHPChannel::Register() non-owning for reusable
prototypes; use a stack prototype in
G4ParticleHPFission::BuildPhysicsTable().
- Added G4ParticleHPCache to release worker cache storage at thread exit.
Pointer caches now own final-state results, interpolated angular tables and
photon multiplicities. Delete these objects before their nested cache
storage. Preserve normal master cache lifetime and non-owning G4Cache
pointer semantics.
- Give G4ParticleHPThreadLocalManager native thread-local lifetime and
delete any remaining reaction whiteboard on the owning thread.
- In G4ParticleHPIsoData, create the vector with the number of points given
in the file, to avoid repeated reallocation while reading the data.
- Initialise the natural-abundance flag in G4ParticleHPDataUsed to false so
skip_missing_isotopes sets missing-isotope cross-sections to zero
instead of accepting data for a neighbouring isotope. Natural-abundance
data remain available as a fallback when present in the library.
Addressing problem report
#2765.
- Parton-String
- G4FTFAnnihilation: protected the two- and three-string annihilation
kinematics against a floating-point exception caused by a small
negative roundoff in the squared decay momentum near threshold.
Fixes occasional FPE crashes detected on test64 with ftfp.in input
macro.
- Fixed leak by releasing the generated strings and their vector on every
scattering attempt in G4VPartonStringModel, including when the attempt is
retried.
- Added headers required for used declarations.
- QMD
- Re-optimised several QMD model parameters including the Gaussian wave
packet width, the envelope factor of the impact parameter and the maximum
evolution time, with multi-ion datasets (energy range:
30-400 MeV/n). This model uses G4FermiBreakUpVI as Fermi
Break-Up model.
- Radioactive Decay
- G4VRadioactiveDecay: exclude negative-Q transitions when loading decay
tables, before constructing channels or normalising branching ratios.
Negative-Q alpha transitions cause a square root of a negative value in
G4AlphaDecay::DecayIt(). Apply the check to all implemented
spontaneous modes: beta decay, electron capture, alpha/proton/neutron/triton
emission and spontaneous fission.
Issue a JustWarning for each discarded transition, identifying the mode,
parent, daughter excitation and negative Q value. Preserve the total
branching ratio of each mode over its remaining valid branches. If a
positive-probability mode loses all usable branches, report a fatal data
error and require corrected data before caching or using the scheme,
including sole-mode schemes. This avoids silently killing the parent or
assigning the missing probability to other modes, and keeps analog yields,
biased weights and chain rates consistent.
Requires the new data-set RadioactiveDecay-6.1.4.
- Delete process-owned G4RadioactivityTable objects in G4RadioactiveDecay
destruction and before SetDecayBias() replaces the observation
windows, fixing observed leak.
- Made internal method GetDecayTable() private.
Intercoms
- Enabled /control/cout/setCoutFile and setCerrFile in
sequential mode, using the specified filenames and independent stream
destinations. Restore screen output to the current UI session with
**Screen**. Updated command guidance; retained worker-only file
redirection in MT mode. Addressing problem reports
#2720 and
#2736.
- Preserve double precision in internal unit conversions in G4GenericMessenger,
G4UIcmdWithADoubleAndUnit and G4UIcmdWith3VectorAndUnit, independently of
/control/useDoublePrecision. Use 17 significant digits for numeric
round trips; leave display formatting unchanged.
- In G4UIcontrolMessenger, fixed typo which could allow zero-division in
/control/reminder UI command. Addressing problem report
#2808.
Based on GitHub PR #139.
Interfaces
- In G4UIQt, improved HelpTree rebuild conditions in FillHelpTree()
to prevent items for closing when submitting a command.
Materials
- G4NistMaterialBuilder: added a new material G4_BlackBody, needed for
simulation of Compton process on black body photons.
- In G4Material, raise a fatal exception if adding material recursively to
itself in AddMaterial().
- In G4MaterialPropertiesTable, replaced linear property-name searches with
binary searches over sorted index vectors, avoiding duplicate strings and
per-entry allocations while preserving property indices and custom keys.
Avoid temporary G4String construction in const char* lookups.
- Removed G4LatticeLogical and G4LatticePhysical obsolete classes, now
integral part of the G4CMP package.
- Added Doxygen documentation, mostly autogenerated.
Parameterisations
- GFlash:
- In GVFlashShowerParameterisation, added GetEffZoA() method.
- GFlashHomoShowerParameterisation, GFlashSamplingShowerParameterisation:
made SetMaterial() private; corrected Ec calculation.
- In GFlashShowerModel, added methods SetParameterisation(),
SetHitMaker(), SetParticleBounds() and GetPBound().
Use GetPBound() in GFlashShowerModelMessenger.
Particles
- Pass the parent mass directly to the G4PhaseSpaceDecayChannel decay
helpers to eliminate a thread-local cache leak at worker shutdown.
Fixing a leak induced by the use of G4Cache.
- G4DecayTable: make DumpInfo() safe for an empty table, whose
parent is null.
- In G4IonTable, fix in GetMuonicAtom(..) for locking atom
construction by worker threads avoiding contention and duplicate
registration of particles in the table, leading to potential aborts.
Based on GitHub PR #131.
- In G4NuclideTableMessenger, fixed parameter names of
/particle/nuclideTable/ min_halflife and
min_meanlife UI commands, which did not match the names
used in their range expressions, causing the commands to be always rejected.
Restricted both commands to G4State_PreInit: ions already created in
G4IonTable keep the properties assigned at creation time, so a change of
the threshold in Idle state would only apply to states not yet created.
- Removed three obsolete G4Phonon* particle types classes, now integral part
of the G4CMP package.
Persistency
- Ascii:
- GDML:
- Added support for importing/exporting G4DisplacedSolid entities.
Preserve G4DisplacedSolid in volume traversal and export it through the
dedicated writer.
- Extended GDML schema with new element displacedSolid.
Updated GDML schema to version 3.2.0.
- Added optional high-precision GDML export through
SetHighPrecisionExport() and
/persistency/gdml/export_high_precision UI command.
Uses 18 significant digits for geometry attributes and material
property matrices, preserving the historical output precision when
disabled (the default).
- In G4GDMLReadStructure, fixed unit validation in DivisionvolRead()
to require length units for kRho and angular units only for kPhi,
consistent with the GDML writer. Allows radial divisions using length
units to be read correctly. Addressing problem report
#2804.
Physics lists
- Builders:
- G4NeutronPHPBuilder: added an option to enable the NuDEX model.
- Extension of INCLXX for in-flight antideuteron interaction:
in BuildINCLXX(), INCLXX handles the antideuteron.
- Constructors:
- electromagnetic:
- Set ApplyCuts to true for G4EmStandard_opt2.
- G4ChemMIDissociationChannels: new class to set dissociative decay
channels for multiple ionised water ions.
- G4ChemDissociationChannels_option1: updated function
ConstructDissociationChannels() to configure dissociation
channels for multiple ionisation processes.
- G4EmDNABuilder: added functions FindOrBuild*Ionisation()
for setting multiple ionisation for proton, alpha++ and carbon.
Fix for the activation of nultiple scattering and elastic scattering
above 1 MeV for option4. Corrected the product names in
the O3- -> O- + O2 reaction data.
- Added verbose for PhyChem processes.
- G4EmDNAPhysics, G4EmDNAPhysics_option2, G4EmDNAPhysics_option4,
G4EmDNAPhysics_option6, G4EmDNAPhysics_option8, G4EmDNABuilder,
G4EmDNAPhysicsActivator: added deuteron to the list of DNA particles
using track structure Rudd model of ionisation at low-energy.
- In G4GeneralGammaProcess, fix to address reported Coverity defect
and minor code clean-up.
- Removed DNA option 1, 3, 5, 7 and all G4EmDNAPhysics_stationary*
constructors.
- G4EmDNAPhysics, G4EmDNAPhysics_option2, G4EmDNAPhysics_option4,
G4EmDNAPhysics_option6, G4EmDNAPhysics_option8, G4EmDNABuilder,
G4EmDNAPhysicsActivator: use new parameters for transition between
DNA and standard physics, which are defined inside G4EmParameters.
- Added JustWarning G4Exception to
G4EmDNAPhysics::ConstructProcesses()
to discourage use of to-be-deprecated option0 class.
- G4EmDNABuilder: all energy limits with values are now taken from
EM parameters or from namespace for the class.
- Modified G4EmDNAPhysics_option4 and G4EmDNABuilder; DNA physics is
unchanged; standard models for electrons are deactivated below
10 MeV; added comments and better indentation of the code.
- In G4EmDNAPhysics_option4, extended to 10 MeV.
Modified G4EmDNABuilder accordingly.
- Requiring new data set G4EMLOW-9.0.
- factory:
- Removed DNA option 1, 3, 5, 7 and all G4EmDNAPhysics_stationary*
constructors.
- hadron_inelastic:
- Restored G4HadronPhysicsQGSP_BERT_HP constructor to its Geant4 11.1
configuration.
- Added an option to use of the NuDEX model in G4HadronPhysicsFTFP_BERT_HP
G4HadronPhysicsQGSP_BERT_HP, G4HadronPhysicsINCLXX and
G4HadronPhysicsShielding via G4NeutronPHPBuilder.
- Renamed the current G4HadronPhysicsQGSP_BERT_HP physics constructor
to G4HadronPhysicsQGSP_BERT_HP_VI.
- Fix in G4HadronPhysicsQGSP_BIC_AllHP; proton G4ParticleHPInelasticData
was restricted to 20 MeV, while the ProtonHPInelastic model
is used up to 200 MeV (the limit of the TENDL database).
- limiters:
- Removed G4UserSpecialCuts process from G4StepLimiterPhysics.
- Moved processes classes G4UserSpecialCuts, G4SpecialCuts,
G4MaxTimeCuts and G4MinEkineCuts to biasing/management module.
- Lists:
- Restored the QGSP_BERT_HP physics list to its Geant4 11.1 configuration.
- Renamed the current experimental physics QGSP_BERT_HP physics list to
QGSP_BERT_HP_VI with G4HadronPhysicsQGSP_BERT_HP_VI.
- Added QGSP_BERT_HP_VI to G4PhysListFactory.
- Register the built-in LBE physics as a constructor and use modular list
construction so additional physics constructors are invoked in order.
- Retain proton-scaled deuteron/triton ionisation. Omit their Bremsstrahlung
processes as a workaround for the EM-core crash when mixing base-particle
ionisation and independent loss tables.
- Added dependency on processes/biasing/management module.
Run
- Added public interface for event seed initialization: in G4MTRunManager,
added interface for initializing event seeds, enabling flexible
integration with external schedulers without requiring additional code
changes.
- Fix in G4MSSteppingAction, to remove average A and Z
and add integrated mass length (a.k.a. column density) instead.
- In G4RunManagerKernel, in CheckRegions(), use the Boolean return
value from G4Region::SetWorld() to avoid a redundant tree search.
CheckRegions() is now called only for the master thread
within InitializePhysics() in a multi-threaded application.
- G4RunManagerKernel: in CheckRegions(), collect the regions of each
world in one pass over the volume tree, instead of one tree search per
region.
- In G4MaterialScanner and G4MatScanMessenger, unify the length unit
to cm; added an option to ignore low-density materials.
- In G4MaterialScanner, G4MatScanMessenger and G4MSSteppingAction,
calculate hadronic interaction length from hadron inelastic
cross-sections instead of relying on the empirical formula of G4Material.
- Added options for writing messages to a file. In G4ExceptionHandler and
G4ExceptionHandlerMessenger, write specified or all warning messages to a
file rather than on display. In G4MaterialScanner and G4MatScanMessenger,
write scan results to a file rather than on display.
Added a UI command to alter the particle type and its momentum for
estimating the hadronic interaction length.
Use const G4String& as arguments in G4ExceptionHandler.
- In G4WorkerThread, guard logical-volume and region split-data reads against
worker array capacity in UpdateGeometryAndPhysicsVectorFromMaster(),
preventing out-of-bounds reads during geometry rebuilds in MT and Tasking
modes while preserving existing worker associations.
Corrected the region manager null check. Addressing problem report
#2791.
Fix to restore the field managers of the worker with AssignFieldManager()
instead of using SetFieldManager(fm, false), which also gave them to
daughters without a field manager. A daughter of a volume with a zero-field
manager thus lost the global field on the worker threads from the second
run on.
- Allocate physics-constructor builder vectors lazily, avoiding allocations
in unused workspace slots. Delete builders and their vector in an idempotent
G4VPCData::clear(), used by TerminateWorker() and workspace
destruction.
- Added optional per-slot cleanup to G4VUPLSplitter::FreeWorker() and
reset its capacity after freeing the array, allowing workspace recreation.
Apply cleanup to constructor data only; copied modular-list pointers remain
master-owned. Destroy builders before releasing the remaining physics-list
split data.
- In G4MTRunManager and G4TaskRunManager, replaced G4Exception with simple
notification to G4cout, for notifying changes of event modulo.
Track & Tracking
- In G4Track, G4VAuxiliaryTrackInformation is cloned when cloning G4Track
for sub-event. In G4VAuxiliaryTrackInformation, added virtual Clone()
method; this method must be implemented in the concrete class if
AuxiliaryTrackInformation is used in sub-event parallel mode.
- In G4SteppingManager, refine how SetInitialStep() obtains the
physical volume and touchable from G4Navigator. Also protected the use
of physical volume in case it is null (for vertex) before the track is killed.
Improvements in G4Navigator ensure that, if the position was outside the
world, the fCurrentVolume pointer is null.
- Update the particle time when multiple-scattering changes the step length
in G4ParticleChangeForMSC and in G4ParticleChangeForTransport.
Visualization
- General
- Updated use of G4tools headers to use .hh extension.
- Management
- In G4VisManager, fixed End-of-run bug; test of isValidViewForRun
was preventing printing of number of kept events when vis was disabled.
Moved to after test for ableness. Improved end of run printing.
- Introduced additional /vis/set/...Colour commands. These give
the user more control over the colour of items added to the scene with
/vis/scene/add/ commands.
- Corresponding adaptations of: arrow, date, eventID, frame and line.
- Implemented a generic class G4VisCommandSetAColour, to facilitate for all
the above, and make it easier for future extensions.
- In G4VSceneHandler::GetMarkerSize(), fixed missing
"markerSizeType = screen" in the case of dots.
- gMocren
- Delete the list command in G4GMocrenMessenger destruction to release its
storage and remove the UI command pointing to the destroyed messenger.
Delete the gMocren directory after all its commands.
- OpenGL
- Fixed shadowing compilation warning on Windows for pascal
symbol in G4OpenGL header.
- Fixed bounds check compilation warnings on Alma9/gcc-15.
- ToolsSG
- In G4ToolsSGSceneHandler, added a "trash group" logic to handle
properly deletion of the graphics storage in MT mode; it fixes a
"crash at exit" when using textures.
- G4ToolsSGViewer in DrawView(), use
fpSceneHandler.EmptyTrash() to remove no more used nodes
deposited in the "trash" in G4ToolsSceneHandler.
- In G4ToolsSGViewer destructor, proprely clear the SceneHandler nodes.
- In G4ToolsSGQtGLESViewer and G4ToolsSGQtZBViewer: restrict
FinishView() to the widget's Qt thread, deferring painting from
the visualization sub-thread to the end-of-run refresh. Fixes potential
/run/beamOn deadlock observed on macOS when the GUI thread
waits for the visualization sub-thread to finish.
- VRML
- Removed unused data member fSystem in G4VRML2FileSceneHandler
and its constructor initializer, fixing a compilation warning on Clang
compiler.
Data sets
- Updated photon evaporation data set version, G4RadioactiveDecay-6.1.4:
- Checked and corrected where needed Q Values of all files.
- Recomputed files with negative Q-values.
- Recomputed and corrected several files for daughter levels.
- Checked and corrected if needed the time in the header of all files.
- Corrected parent half life of some decays by comparison with ENDSFSTATE.
- Corrected by hand the following files:
- *z65.a162 - Removed last BetaMinus channels with negative QValue.
- *z95.a234 - Removed unknown alpha decay and correct Beta minus with
decay directly to the ground.
- *z4.a9 - Changed negative beta minus Qvalue of very excited
level to 10 keV.
- *z52.a133 - Removed one beta minus decay with negative Qvalue.
- *z66.a163 - Removed beta minus decay of ground state.
- *z84.a212 - Merged together decays.
- *z77.a194 - Corrected Q values (+50 keV)
for Ir194[190X] decay.
- Addressing problem reports
#2748,
#2780 and
#2794.
- Updated low energy electromagnetic data set version, G4EMLOW-9.0:
- Corrected sigmadiff_cumulated_ionisation_e_cpa100_rel.dat:
section for 32 eV should be 32.2 eV.
- Added files for extended option4 up to 10 MeV:
sigma_excitation_e_emfietzoglou-x.dat,
sigma_ionisation_e_emfietzoglou-x.dat,
sigmadiff_ionisation_e_emfietzoglou-x.dat,
sigmadiff_cumulated_ionisation_e_emfietzoglou-x.dat.
- Removed old files: sigma_excitation_e_emfietzoglou.dat,
sigma_ionisation_e_emfietzoglou.dat, sigmadiff_ionisation_e_emfietzoglou.dat
and sigmadiff_cumulated_ionisation_e_emfietzoglou.dat.
Examples
- Applied clang-format to all examples code.
- Updated reference outputs, macros, READMEs and scripts.
- Fixes for Doxygen documentation and coding guidelines.
- Migration to markdown of the README files of all advanced examples.
- Updated header guards of all files to all upper case without a value.
- advanced
- CaTS
- Integration of Celeritas as an option to offload the transport
of optical photons. Added new class MakeCelerOptions for user
configuration of Celeritas. Hits produced by Celeritas are
converted into G4Hits for further Geant4 processing, e.g.
analysis and/or I/O.
- Added a simple, Root-based validation analysis binary.
- In RootIO source, use smart pointers for root file cleanup.
- Updated CMake script to support proper compilation and linkage
with the latest Opticks version.
- Added MySensorIdentifier.hh and OpticksHitHandler.hh to provide
sensor'ID assignment and Opticks hit collection.
- Added QuasiOpticalPhysics constructor with quasi-optical processes.
QuasiOpticalPhysics is equivalent to G4OpticalPhysics, with extensions
for quasi-optical processes to support offloading of optical photon
generation and transport.
- Implemented a new SteppingAction to transfer optical photon information
(Cerenkov and scintillation) to Opticks and to register boundary
interactions as hits.
- Modified IArTPCSD, PhotonSD, and RadiatorSD to incorporate Opticks
generated hits into their sensitive detector workflows.
- Added simpleLArTPC_Opticks.gdml for testing geometry and validating
Opticks integration.
- Added a new example macro, electron.mac, which generates a single
electron for testing and validation.
- Performed code cleanup: removed unused and commented code;
replaced int with G4int and std::cout with G4cout in multiple
files.
- Corrected indentation issues across the codebase.
- OpticksHitHandler: use swap in GetHits() to prevent data
races.
- Use unique_ptr to simplify management of per-thread Root
files.
- Replace two boolean options WITH_G4OPTICKS=ON/OFF, WITH_CELERITAS=ON/OFF
with a single string option WITH_ENGINE=Opticks|Celeritas|Geant4
(default=Geant4)
- Use Log scale for some validation plots.
- Removed unnecessary code in main().
- dna/dsbandrepair
- Adjusted to revision of split-class design in G4LogicalVolume.
As VoxelParameterisation reassigns the physical volume's logical volume,
DetectorConstruction needs to request, on the master thread, the
(optional) consistency pass to runs at geometry closure. This discovers
every logical volume bound by each parameterisation and provides them
per-thread storage before voxelisation or navigation, which avoid a
crash.
- dna/moleculardna:
- Updated analysis macros for statistical analysis of errors and fixed
a bug regarding error calculation in ecoli.C.
- Fixed a bug in computing the mean pairwise distance in
AnalysisManager.
- Fixed wrong gap: too long gaps can be identified sometime; base-pair
ids were assigned to the molecules in the voxel located outside of
defined chromosome geometry.
- Corrected World volume size in phage.mac.
- Corrected error estimation in analysis macros and refactored.
- Added neutrons to physics list.
- Added UI commands for PSF handling.
- New handling of PSF in CSV format, working in MT mode
Added PSF function, fixing the PSF in MT mode.
Added analysis macros to illustrate PSF usage.
Added ecoli_PSF.mac input macro.
- doiPET
- In doiPETRun::FindInteractingCrystal(),
use multimap::lower_bound() instead of find()
to start at the first interaction of a block; fixes crash with
recent libc++ on macOS.
- Clear per-block vectors when a block's deposit is zero.
- eFLASH_radiotherapy
- Added new geometry in Detector Construction.
- Added primitive scorer (multifunctional detector).
- Added messanger to activate/deactivate the calorimeter.
- Added new macro for sensitive detectors activation.
- exp_microdosimetry
- Detector construction: added new geometry with array/matrix of
silicon microdosimeters.
- Sensitive detector: when the Silicon array is selected, each
detector is an independent sensitive detector with energy
deposited scored (copyNo used for identification).
- Detector messenger: added macro commands to set size, distance
and number of detector for Silicon array configuration.
- Water phantom set as default configuration in the macro file.
- gammaknife
- Fixed issue related to wrong inizialisation of radioactive decay.
- Changed the cuts in the default macro to obtain no null values
within the scorer.
- gorad
- In addition to spherical biasing volume, cuboid biasing volume
is also now available.
- Added option of biasing outward for spherical biasing volume.
- Added a primitive scorer with corresponding UI commands, to record a
phase-space file.
- Added two primary particle generation options: Beam line and radioactive
volume).
- Added a new macro file of Iodine125 brachytherapy seed to demonstrate
recording phase-space file and radioactive volume source.
- Fixed the size and location of the probe in Iodine125.mac.
- Make /process/had/rdm/thresholdForVeryLongDecayTime UI
command applied only if Radioactive Decay Module is used.
- Some code clean-up.
- ML_LWFA
- New application implementing a simulation framework based on Geant4 for
modeling plasma-accelerated particle beams. It integrates traditional
Monte Carlo methods with machine learning-based ONNX beam generation,
allowing flexible, high-fidelity simulations of beam transport through
dipole and quadrupole fields according to the PALLAS experiment.
- basic
- B1
- Refresh primary-generator and scoring-volume pointers after geometry
reconstruction.
- Use new frameColour command in vis macro.
- Renamed local variables containing underscores to camelCase.
- Fixed typo and extra word. Based on
GitHub PR #106.
- B2
- Preserve material selections made before initialization by assigning
defaults only to unset material pointers in DefineMaterials().
- Initialize chamber pointers in B2a.
- Handle inactive tracker sensitive detectors without dereferencing
missing hit collections (the tracker can be deactivated at runtime
via /hits/inactivate).
- Renamed the local trajectory-count variable to camelCase in B2a
and B2b.
- B3
- Use ring and crystal copy numbers for unique crystal energy-deposit
scoring.
- Clarify in README.md that each modelled Crystal block is scored
independently in both variants, and describe the simplified good-event
criterion.
- Handle inactive crystal and patient scorers; count B3b events even
without hit collections.
- Renamed local variables and hit-collection ID data members containing
underscores to camelCase in B3a and B3b.
- B4
- Validate option values before accessing command-line arguments in all
variants.
- Accept the complete documented combination of command-line options.
- B5
- Provide master n-tuple vector storage without allocating an unowned
EventAction.
- Manage the magnetic field, placement rotation and user limits with
explicit lifetimes.
- Store both arm and field rotations as G4RotationMatrix value members.
- Preserve arm-angle selections made before geometry construction and
restrict the command to PreInit and Idle.
- Fixed compilation warnings for implicit type conversion on
macOS/XCode.
- extended
- analysis
- AnaEx01
- Refresh the default source position after geometry construction
and size changes, preserving user-selected positions and keeping
the default inside the world.
- Reject configurations with zero absorber and gap thickness
before creating solids.
- Pass visualization attributes by value so the logical volume
owns its copy.
- Enable n-tuple merging only for an actual multithreaded
application.
- Release the application-owned HistoManager in RunAction
destruction.
- AnaEx02
- Refresh the default source position after geometry construction
and size changes, preserving user-selected positions and keeping
the default inside the world.
- Reject configurations with zero absorber and gap thickness before
creating solids.
- Pass visualization attributes by value so the logical volume owns
its copy.
- Detect unusable Root output files and report a fatal
file-creation error.
- Release Root files between runs, clear deleted-object pointers,
and release the application-owned HistoManager in RunAction
destruction.
- AnaEx03
- Refresh the default source position after geometry construction
and size changes, preserving user-selected positions and keeping
the default inside the world.
- Reject configurations with zero absorber and gap thickness
before creating solids.
- Pass visualization attributes by value so the logical volume
owns its copy.
- Enable n-tuple merging only for an actual multithreaded
application.
- Release the application-owned run-action messenger.
- B1Con
- Retain event identifiers when accumulating energy deposits and
restore event order after worker merging before calculating
convergence histories.
- Refresh envelope and scoring-volume pointers after geometry
reconstruction.
- Release the convergence tester on empty-run exit.
- biasing
- B03
- Fixed importance sampling in MT mode by configuring the
geometry sampler and adding the importance process on both
master and worker threads.
- Move importance-store initialization from main()
to the parallel world's ConstructSD() so each
thread has a populated thread-local store.
- Addressing problem report
#2522.
- electromagnetic
- TestEm0
- In RunAction, use the photon production cut for hadron
Bremsstrahlung when computing cross-sections and restricted
stopping powers.
- In DetectorConstruction, calculate xenon gas density from
its molar mass, pressure and temperature using the ideal-gas
law; document that the high-pressure xenon material also uses
the ideal-gas approximation.
- TestEm1
- In radioactive.mac, corrected sodium iodide material name.
- In TrackingAction, removed unused fPrimary data member
and associated initialization after switching displacement
calculations to the track's actual vertex position.
- In PrimaryGeneratorAction, update the default front-face source
position after geometry size changes, preserving user-selected
positions.
- In Run, report the projected-to-true range ratio as not
applicable when the true range is zero.
- TestEm2
- In Run, corrected interpolation of the 90% confinement radius,
including crossings in the first and last radial bins; avoid
an out-of-bounds read.
- In DetectorConstruction, update dimensions and notify the run
manager when changing material, preserving bin sizes expressed
in radiation lengths.
- In test.mac, replaced the obsolete UseSuperProcess command
with UseGeneralProcess.
- In TestEm2.in, removed line with WorkerVerbose command.
- TestEm3
- In main(), use 4 threads by default.
- In PhysicsList, define particle via constructor of EM, decay,
hadronic physics to avoid situation when an update in some
constructors (like extra DNA particle) needs to be propagated
in the example by hand.
- Run: improved summary printout on energy conservation avoiding
precision loss. Retain beam kinetic energy as the reference for
the global energy-balance residual; document expected nonzero
residuals from rest-mass conversion.
- In RunAction, added extra timer to print initialisation time
in the master thread.
- In PrimaryGeneratorAction, refresh the default source position
from the constructed geometry, avoiding an out-of-world primary
after pre-initialization geometry changes in serial mode;
preserve user-specified gun positions.
- In SteppingAction and TrackingAction, apply statistical weights
consistently to energy flow and leakage, and use the pre-step
weight for energy deposition. Clarify that internal calorimeter
energy flow retains the positron annihilation contribution to
reconstruct deposited energy.
- In TrackingAction, score world-boundary leakage using weighted
kinetic energy only, including for escaping positrons.
- Validated the build and escaping/contained positron cases in
serial and MT modes.
- TestEm5
- In EventAction, TrackingAction and Run: added transmitted and
reflected energy analysis. Include lateral world-boundary
leakage; score leakage using kinetic energy only, including
for escaping positrons. Retain beam kinetic energy as the
energy-balance reference and document expected nonzero residuals
from rest-mass conversion. Accumulate leakage per event before
computing its uncertainty. Normalize transmitted/reflected
energy percentages to the primary energy, with protection
for zero energy.
- Fix in TrackingAction in order to have correct reflection
counts.
- Run: improved summary printout on energy conservation avoiding
precision loss.
- In DetectorConstruction, retain explicit world dimensions and
notify the run manager when changing solid dimensions.
- In PrimaryGeneratorAction, update the default source position
after geometry changes, preserving user-specified positions.
- TestEm6
- In StepMax, honor the volume's G4UserLimits as well as the
process step limit, making /testem/tracking/stepMax
effective for charged particles.
- TestEm7
- In SteppingAction, exclude energy deposited in the world from
absorber scoring.
- In DetectorConstruction, reject requests for unconstructed
tallies after initialization; update the material and mass of
all existing tally volumes, including tallies disabled for
reporting.
- In G4ScreenedNuclearRecoil, use the element's isotope abundances
when available; invalidate cached cross-section and mean-free-path
tables when physics tables are rebuilt, avoiding a crash after
selecting a newly created material.
- In PhysListEmStandardNR, match the multiple-scattering activation
thresholds to the screened-recoil energy limit, accounting for
light-ion total kinetic energy and GenericIon proton-mass-scaled
energy.
- TestEm8
- Keep beam metadata in worker-local Run objects and merge it
into the master run, avoiding concurrent writes to shared
TestParameters.
- Open and notify geometry changes made between runs; use the
current charged step limit so that Idle-state updates take
effect.
- Corrected the stepMax command spelling in the ALICE TPC
and TRD macros.
- TestEm9
- Centre the vertex pads and size their mother from the
actual pad count, removing protrusions outside the mother
volume.
- Assign distinct pad copy numbers and include the layer
in vertex hit IDs.
- Preserve macro-defined acceptance parameters at run start;
disable acceptance by default and restore electron references
after the muon run in TestEm9.in.
- Weight deposited energy with the pre-step weight, as in
G4PSEnergyDeposit.
- TestEm10
- Convert the 85/15 Xe/CO2 gas composition from mole to mass
fractions.
- Account for histogram units when reporting the absorber mean
energy and RMS.
- Restrict XTR model selection to PreInit and validate supported
model names.
- Use the actual XTR region names when setting production cuts
in the six experimental-setup macros.
- Fix the dimensionless attenuation in the local XTR
stack-interference factor; plate and gas optical depths
already include their thicknesses.
- TestEm11
- Initialize material and thickness defaults for every selectable
absorber, preventing invalid geometry when the absorber count
is increased.
- Include zero-energy-deposit steps in primary and
charged-secondary step-size histograms.
- TestEm12
- Clear geometry stores and cached volume/solid pointers when
reconstructing the detector, preventing stale-pointer access
after geometry reinitialization.
- Open geometry and notify the run manager when scaling the
sphere radii; update the layer thickness as well.
- Include zero-energy-deposit steps in primary and
charged-secondary step-size histograms.
- TestEm13
- Apply material changes to the constructed logical volume
as well as the detector configuration before rebuilding
physics tables.
- Compute the reference cross-section sum over all active
EM processes, including processes not sampled in the run.
- Disable Rayleigh scattering in the macros intended to
isolate Compton scattering, photoelectric absorption and
pair conversion.
- TestEm14
- Apply material changes to the constructed logical volume
before rebuilding physics.
- Include every active EM process in the reference cross-section
sum, even when it was not sampled; do not estimate mean free
path from an empty sample.
- Disable Rayleigh scattering in the Compton and pair-conversion
macros.
- TestEm15
- Normalise the azimuthal displacement/direction correlation to
compute cos(phiPos-phiDir), as documented.
- Read conversion secondaries from the current step rather than the
cumulative tracking secondary vector.
- TestEm16
- Score reflection angles at photon creation, using the incoming
step direction and current-step secondaries; avoid dependence
on later transport steps.
- Accumulate the full track length between synchrotron emissions,
including intervening steps, and use current-step secondaries
for photon scoring.
- Set reflection output filenames before opening each run's
analysis file.
- Retain PreInit surface roughness settings and update the
toolkit's shared roughness only on the master; restrict
synchrotron model selection to PreInit.
- Refresh geometry when changing the GDML input, and bind
material changes to the current world logical volume after
GDML reconstruction.
- Enlarge the reflection GDML world to contain the displaced
copper block.
- Remove the obsolete detector-update command from run02.mac.
- Release application-owned generator, analysis helper, detector
control, user-limit and physics helper objects at destruction.
- TestEm17
- Reconstruct the box after size updates and explicit geometry
reinitialisation.
- Count only discrete interactions of the studied energy-transfer
processes in cross-section estimates and spectra; exclude
continuous step limits, normalise to actual primary track length,
and evaluate active reference processes even when no interaction
was sampled; guard empty samples, zero-energy reference
calculations and null step-defining processes.
- Match pair-production reference thresholds to the toolkit's
secondary cuts and model thresholds; query muon-nuclear cross
sections via the hadronic store.
- Correct energy-unit conversion in cross-section histograms
and write ASCII output before resetting histograms; reject
out-of-range histogram indices.
- Preserve the requested EM table energy range when selecting
a constructor.
- Release application-owned histogram and physics-constructor
helpers and avoid repeated allocation of the optional
muon-nuclear builder.
- TestEm18
- Reconstruct geometry after material and size changes so
tracking and physics calculations use the requested box
and material.
- Finalise analysis files and clear run data on neutral-primary
and empty-run exit paths; skip stopping-power comparisons
for charged geantinos and guard zero-step samples and null
step-defining processes; record zero-transfer events in
transfer minima and maxima.
- Account separately for positron/target-electron rest energy
released in primary annihilation, excluding it from primary
kinetic-energy loss while retaining physical secondary-energy
records; updated histogram labels.
- exoticphysics
- Removed obsolete phonon example.
- geometry
- vecGeomNavigation
- Use latest available version of VecGeom in CMake
configuration.
- Stick to use Master branch for the G4VecGeomNav package.
- In CMake script, replaced obsolete use of
FetchContent_Populate with
FetchContent_MakeAvailable, as per policy CMP0169.
- volumeTreeVisitors
- New example demonstrating use of G4TouchableWalker, its associated
G4VTouchableVisitor interface and the concrete class
G4TouchableCollector. It uses the G4TouchableCollector concrete class
which collects a list of touchables which correspond to a logical or
physical volume. Use and demonstrate G4LogicalVolumeUsageVisitor to
answer how many logical volumes are used in placements, in replicas
and in parameterised volumes, and what overlap is there. If a volume
is used in a replica or parameterised volume, show how it can be
marked as "mutable", i.e. additional properties can vary depending
on the current thread.
- hadronic
- FissionFragment
- FFDetectorConstruction: fixed overlaps between plates by avoiding
duplicate fuel plate placements at y = 0; it removes four coincident
overlaps and reduces the plate count to 308.
- Removed unnecessary threads setting control in main() and
enabled MT.
- medical/dna
- Replaced G4EmDNAPhysics option2 with option4 as default
(opt6 in spower).
- Removed usage of G4EmDNAPhysics (option0), replaced with option4.
- AuNP:
- Added macros for physics test and chemistry test.
- Changed the name of the analysis code.
- chem4:
- Fix to use std namespace for mathematical functions in Plot.cc.
- chem6:
- Modified PrimaryKiller in order to terminate transportation for
ions as well as electrons following energy range set through macro files.
- Fixed physics constructor name.
- Added verbose for PhyChem processes.
- Fixed FTE failure in messenger.
- dnaphysics:
- SteppingAction, TrackingAction: look up the
G4DNAGenericIonsManager ions once (static pointers) instead
of calling GetIon(), a search of a map by name, at
every step and track. No change of results.
- Fixed default physics constructor (option4).
- microdosimetry:
- SteppingAction: look up the G4DNAGenericIonsManager ions once
(static pointers) instead of calling GetIon(), a search
of a map by name, at every step. No change of results.
- microtrack:
- Fixed processMicrotrack.C analysis script to normalize properly
microdosimetric distributions and added suitable axis scales
and titles.
- microyz:
- Minor fix in TrackerSD commented lines.
- Reduced number of DNA physics constructors.
- molcounters:
- Added UI for counter examples.
- Added abstract base for molecule scorers.
- Added basic mesoscopic counter example.
- Code formatting.
- radial:
- SteppingAction: look up the G4DNAGenericIonsManager ions once
(static pointers) instead of calling GetIon(), a search
of a map by name, at every step. No change of results.
- spower:
- SteppingAction, TrackingAction: look up the
G4DNAGenericIonsManager ions once (static pointers) instead
of calling GetIon(), a search of a map by name, at
every step and track. No change of results.
- UHDR:
- Added /UHDR/source/ion UI command to support ion sources
(Z, A, optional Q, E*).
- Added /UHDR/source/energyPerNucleon UI command to set
kinetic energy per nucleon.
- medical/radiobiology
- Added an outer air world so that beams can originate outside the
voxelized scoring container.
- Added voxel-resolved primary and secondary dose distributions.
- Added voxel-resolved particle-entry counts for primary and secondary
tracks, including per-species output.
- Made geometry reinitialization and scorer array sizing safe between
runs.
- Added short regression-test and analysis scripts.
- parallel
- MPI
- In G4MPImanager, beamOn thread function now has the
pthread signature, removing a function-type-mismatch cast
warning.
- In exMPI02, exMPI03 and exMPI04, enlarged the world so that
the beam source at z= -125 cm is inside it.
- Keep the MPI run merger's data records as aggregates in C++20
and later.
- parameterisations
- gflash/gflasha
- In ExGflashMessenger, limited max number of crystals per raw/col.
- In ExGflashDetectorConstruction, do not use SetMaterial()
call from GFlashHomoShowerParameterisation.
- Some code cleanup.
- gflash/gflash1/2/3
- Corrected crystal copy numbering.
- Simplified processing; draw hits as circles.
- Pass Gflash classes by pointer.
- Removed delete GFlash classes in DetectorConstruction.
- Removed static G4ThreadLocal pointers to GFlash classes.
- In test.mac, test both gflash on and off cases.
- Par02
- In Par02FastSimModelTracker, prepare G4PathFinder before using it,
as G4FastSimulationManagerProcess no longer does it for the mass
geometry.
- Par04
- Fixed ONNX Runtime build warnings in CPU-only builds.
- radioactivedecay
- rdecay02
- BiasedRDPhysics: added rdecay physics to triton.
- HistoManager and TrackingAction: adde n-tuple merging in MT mode;
added registering of modelID in n-tuple T1 and RDecayProducts.
- Added a macro triton.mac.
- runAndEvent
- RE03
- In RE03ActionInitialization, make sure analysis UI commands be
available in both master and worker threads.
- Added new macro file run6.mac, to demonstrate plotting of
histograms directly from primitive scorers.
- run4.mac, run5.mac: shoot muons instead of electrons for better
demonstration.
- Updated macro files to draw various scoring meshes and probes.