Skip to content

Commit dda54bb

Browse files
committed
Import Geant4 11.2.1 source tree
1 parent 860a2b9 commit dda54bb

File tree

331 files changed

+41997
-44239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

331 files changed

+41997
-44239
lines changed

.clang-format

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# requires clang-format version 13.0+
2+
---
3+
AlignAfterOpenBracket: Align
4+
# Instead ContinuationIndentWidth is used
5+
AlignConsecutiveAssignments: false
6+
AlignConsecutiveDeclarations: false
7+
# Aligns \ symbols on the left; other options DontAlign, Left
8+
AlignEscapedNewlines: Left
9+
AlignOperands: Align
10+
AlignTrailingComments: false
11+
AllowAllParametersOfDeclarationOnNextLine: true
12+
# When declaring a function, parameters continue on the same line
13+
AllowShortBlocksOnASingleLine: Empty
14+
AllowShortCaseLabelsOnASingleLine: false
15+
AllowShortFunctionsOnASingleLine: Inline
16+
# while (true) {} allowed
17+
# if (a) return; is allowed
18+
AllowShortIfStatementsOnASingleLine: WithoutElse
19+
AllowShortLambdasOnASingleLine: Inline
20+
AllowShortLoopsOnASingleLine: false
21+
AlwaysBreakAfterDefinitionReturnType: None
22+
AlwaysBreakAfterReturnType: None
23+
AlwaysBreakBeforeMultilineStrings: true
24+
AlwaysBreakTemplateDeclarations: Yes
25+
BinPackArguments: true
26+
BinPackParameters: true
27+
BraceWrapping:
28+
AfterClass: true
29+
AfterControlStatement: MultiLine
30+
AfterEnum: true
31+
AfterFunction: true
32+
AfterNamespace: true
33+
AfterStruct: true
34+
AfterUnion: true
35+
AfterExternBlock: true
36+
BeforeCatch: true
37+
BeforeElse: true
38+
IndentBraces: false
39+
SplitEmptyFunction: false
40+
SplitEmptyRecord: false
41+
SplitEmptyNamespace: false
42+
BreakBeforeBraces: Custom
43+
BreakBeforeBinaryOperators: NonAssignment
44+
BreakBeforeTernaryOperators: true
45+
BreakInheritanceList: BeforeColon
46+
BreakConstructorInitializers: BeforeColon
47+
BreakStringLiterals: true
48+
ColumnLimit: 100
49+
CompactNamespaces: false
50+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
51+
ConstructorInitializerIndentWidth: 2
52+
ContinuationIndentWidth: 2
53+
Cpp11BracedListStyle: true
54+
DerivePointerAlignment: false
55+
FixNamespaceComments: true
56+
IncludeBlocks: Regroup
57+
# Priority is:
58+
# 1. Geant4 headers in ""
59+
# 1. Geant4 headers in "" that don't start with 'G4'
60+
# 2. External package headers with extension in "" or <> (but _should_ be <>)
61+
# 3. System headers (not exhaustive)
62+
# Note order of regexes is important as they are matched in order
63+
IncludeCategories:
64+
- Regex: '^"G4.*\.hh"'
65+
Priority: 1
66+
- Regex: '^"(Randomize|globals)\.hh"'
67+
Priority: 1
68+
- Regex: '^"[[:alnum:]\/\-_.]+"'
69+
Priority: 2
70+
- Regex: '^<[a-z_]+>'
71+
Priority: 3
72+
- Regex: '^<[[:alnum:]\/.]+>'
73+
Priority: 2
74+
# Provides an extra indent level for public/protected/private sections
75+
# without requiring excess indention and use of AccessModifierOffset
76+
IndentAccessModifiers: true
77+
IndentCaseLabels: true
78+
IndentPPDirectives: AfterHash
79+
IndentWidth: 2
80+
KeepEmptyLinesAtTheStartOfBlocks: false
81+
Language: Cpp
82+
MaxEmptyLinesToKeep: 1
83+
NamespaceIndentation: None
84+
PointerAlignment: Left
85+
ReflowComments: true
86+
SortIncludes: true
87+
SortUsingDeclarations: true
88+
SpaceAfterCStyleCast: false
89+
SpaceAfterLogicalNot: false
90+
SpaceAfterTemplateKeyword: false
91+
SpaceBeforeAssignmentOperators: true
92+
SpaceBeforeCpp11BracedList: false
93+
SpaceBeforeCtorInitializerColon: true
94+
SpaceBeforeInheritanceColon: true
95+
SpaceBeforeParens: ControlStatements
96+
SpaceBeforeRangeBasedForLoopColon: true
97+
SpaceInEmptyBlock: false
98+
SpaceInEmptyParentheses: false
99+
SpacesBeforeTrailingComments: 2
100+
SpacesInAngles: false
101+
SpacesInConditionalStatement: false
102+
SpacesInContainerLiterals: true
103+
SpacesInParentheses: false
104+
SpacesInSquareBrackets: false
105+
Standard: Cpp11
106+
TabWidth: 2
107+
UseTab: Never
108+
...

.clang-tidy

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# Minimal set of checks for Geant4
3+
# - See CODING_GUIDELINES.rst for guidelines and instructions for use
4+
# - Full list at https://clang.llvm.org/extra/clang-tidy/checks/list.html
5+
Checks: "-*, \
6+
modernize-deprecated-headers, \
7+
modernize-make-shared, \
8+
modernize-make-unique, \
9+
modernize-redundant-void-arg, \
10+
modernize-use-auto, \
11+
modernize-use-equals-default, \
12+
modernize-use-nullptr, \
13+
modernize-use-override, \
14+
modernize-use-using, \
15+
performance-faster-string-find, \
16+
performance-for-range-copy, \
17+
performance-inefficient-string-concatenation, \
18+
performance-trivially-destructible, \
19+
readability-delete-null-pointer, \
20+
readability-duplicate-include, \
21+
readability-string-compare"
22+
WarningsAsErrors: ''
23+
HeaderFilterRegex: ''
24+
AnalyzeTemporaryDtors: false
25+
FormatStyle: file
26+
CheckOptions:
27+
- key: modernize-use-auto.RemoveStars
28+
value: 'true'
29+
- key: performance-faster-string-find.StringLikeClasses
30+
value: 'G4String;::std::basic_string;::std::basic_string_view'
31+
...

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ project(Geant4
3131
HOMEPAGE_URL "https://geant4.cern.ch")
3232
set(${PROJECT_NAME}_VERSION_MAJOR 11)
3333
set(${PROJECT_NAME}_VERSION_MINOR 2)
34-
set(${PROJECT_NAME}_VERSION_PATCH 0)
34+
set(${PROJECT_NAME}_VERSION_PATCH 1)
3535
set(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}")
3636

3737
# - Prepend our own CMake Modules to the search path

ReleaseNotes/Patch.11.2-1.txt

+154
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
2+
Geant4 11.2 - patch-01 Release Notes
3+
------------------------------------
4+
5+
16 February 2024
6+
7+
List of fixes included in this public patch since the public release 11.2.0:
8+
9+
o Configuration
10+
-------------
11+
+ CMake:
12+
o Added -F flag on macOS with a framework build of Qt.
13+
Addressing problem report #2589.
14+
o Fixed detection of SoQt/Xt packages, by manually checking versions of
15+
found packages. Geant4 only requires a minimum version.
16+
17+
o Geometry:
18+
--------
19+
+ solids/CSG:
20+
o In wrapper G4UTrap, use GetThetaCosPhi() and GetThetaSinPhi() in
21+
method GetVertices(); this overcomes a problem with trapezoid reported
22+
in CMSSW after migration to VecGeom 1.2.6.
23+
Also fixed typo in method SetAllParameters(), setter used in
24+
parameterisation of shape dimensions.
25+
26+
o Global:
27+
------
28+
+ G4PhysicsModelCatalog: added ID for the Light-Ion QMD model.
29+
+ Updated date and version for 11.2.1.
30+
31+
o Physics Lists:
32+
-------------
33+
+ constructors/electromagnetic
34+
o G4GammaGeneralProcess: fixed sampling of muon pair production.
35+
Addressing problem report #2543.
36+
o G4EmStandardPhysics_option3: restore step limit type to use
37+
'fUseDistanceToBoundary' and set default RangeFactor from 0.03 to 0.04,
38+
fixing inaccuracy in medical benchmarks.
39+
+ constructors/gamma_lepto_nuclear
40+
o G4NeutrinoPhysics: fixed neutrino physics instantiation.
41+
Addressing problem report #2594.
42+
43+
o Processes - Electromagnetic:
44+
---------------------------
45+
+ dna
46+
o G4DNABornAngle: fixed numerical problem; added protection for cosTheta;
47+
use relativistic formula for maximum energy transfer to delta-electrons.
48+
+ loweneegy
49+
o G4MicroElecInelasticModel_new: fixed Coverity report for memory leak at
50+
exit. Minor code cleanup.
51+
o G4MicroElecLOPhononModel: minor code cleanup.
52+
+ standard
53+
o G4IonICRU73Data: fix for the case when target material has an element
54+
with Z>92; improved debug printouts. In the Lindhard-Sorensen model to
55+
compute dEdx the first try is to take it from ICRU73 or ICRU90 data,
56+
if this class returns zero, then dEdx is computed from G4GenericIon
57+
and effective charge. Addressing problem report #2586.
58+
+ utils
59+
o G4VEmProcess, G4VEnergyLossProcess: minor CPU optimisation with
60+
reduction of number of calls for log() of kinetic energy.
61+
+ xrays
62+
o G4GaussXTRadiator, G4VXTRenergyLoss: flexible summation in SpectralXTRdEdx;
63+
clean-up in GetStackFactor() based on std::complex methods.
64+
o In G4Scintillation::sample_time(), refactored the scintillation time
65+
sampling.
66+
67+
o Processes - Hadronic:
68+
--------------------
69+
+ cross_sections
70+
o G4KokoulinMuonNuclearXS: use faster interface to G4PhysicsVector.
71+
o G4ElectroNuclearCrossSection: added low-energy limit of 100 MeV for
72+
cross-section.
73+
+ management
74+
o G4HadronicProcess: explicitly define cross-section type per particle
75+
type, this might provide some CPU speedup.
76+
+ models/de_excitation
77+
o G4FermiBreakUpVI, G4FermiFragmentsPoolVI: fix in production of fake
78+
excited isomeres, by moving the check on lifetime limit to the Initialise()
79+
method of the model, allowing to change this limit in an application;
80+
do not consider decay chains with no final state.
81+
Addressing problem report #2584.
82+
o G4StatMFChannel: replaced use of C-arrays with std::vector, clearing
83+
compilation warnings on gcc compiler when LTO settings are enabled.
84+
+ models/lend
85+
o Fixed compilation error on recent Windows VC++ compiler 17.8.3 for use
86+
of std::isfinite(). Addressing problem report #2582.
87+
o Fixed compilation warnings on gcc compiler when LTO settings are
88+
enabled.
89+
+ models/particle_hp
90+
o G4ParticleHPFissionFS, G4ParticleHPFFFissionFS: added extra protections
91+
against cases when fission data are not available for some isotopes.
92+
Addressing problem #2590.
93+
o G4ParticleHPFSFissionFS, G4ParticleHPFissionBaseFS: replaced use of
94+
C-arrays with std::vector, clearing compilation warnings on gcc
95+
compiler when LTO settings are enabled.
96+
+ qmd
97+
o Fixed model ID (model_LightIonQMDModel) in G4LightIonQMDReaction.
98+
+ radioactive_decay
99+
o G4Radioactivation: added DBL_EPSILON check on transition energy for
100+
metastables to prevent creation of zero energy levels which have no
101+
decay products.
102+
o G4BetaPlusDecay, G4BetaMinusDecay: fixed sampling algorithm.
103+
Addressing problem report #2588.
104+
105+
o Run:
106+
---
107+
+ Correctly report number of threads from G4TaskRunManager.
108+
109+
o Tracking:
110+
--------
111+
+ G4TrackingMessenger: fixed Coverity report for memory leak at exit,
112+
by moving static thread-local variable to become class member, as
113+
G4TrackingManager and its messenger are thread-local by nature.
114+
115+
o Examples:
116+
--------
117+
+ basic/B2
118+
o Updated PrimaryGeneratorAction::GeneratePrimaries() in B2a and B2b
119+
examples to avoid placing of the initial position on the world
120+
boundary. Updated READMEs.
121+
+ extended/electromagnetic/TestEm1
122+
o Updated initial gun position in PrimaryGeneratorAction to not lay on
123+
the world volume surface.
124+
+ extended/electromagnetic/TestEm5
125+
o Updated initial gun position in PrimaryGeneratorAction to not lay on
126+
the world volume surface.
127+
o In TrackingAction, added a protection against potential wrong argument
128+
to std::acos(), rarely happening for very high energy projectile
129+
particles.
130+
+ extended/electromagnetic/TestEm11
131+
o Updated initial gun position in PrimaryGeneratorAction to not lay on
132+
the world volume surface.
133+
+ extended/electromagnetic/TestEm16
134+
o Updated READMEs to document all macros.
135+
+ extended/medical/dna/neuron
136+
o Cleanup to reduce number of Valgrind warnings; applied coding style
137+
recommendations; removed commented lines, removed unused methods;
138+
substituted C-arrays with vectors; improved algorithm of reading of
139+
data file.
140+
141+
----------------------------------------------------------------------------
142+
143+
Technical Notes
144+
---------------
145+
146+
o This patch should be applied on top of release 11.2 series.
147+
o Technical notes distributed for release 11.2 are also applicable and
148+
valid for this patch.
149+
150+
The code and rebuilt binary libraries for release 11.2.1 are available
151+
through the Geant4 "Download" Web page.
152+
153+
Please refer to the Geant4 User Documentation for further information about
154+
using Geant4.

cmake/History

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ It must **not** be used as a substitute for writing good git commit messages!
66

77
-------------------------------------------------------------------------------
88

9+
## 2024-01-29 Ben Morgan (cmake-V11-01-32)
10+
- Manually check versions of found SoXX packages to workaround their use of
11+
the `ExactVersionOnly` version checking strategy in find_package. Geant4
12+
only requires a minimum version.
13+
14+
## 2024-01-26 Ben Morgan (cmake-V11-01-31)
15+
- Add -F flag for Qt when on macOS and with a framework build of Qt
16+
- Addresses [Bugzilla 2589](https://bugzilla-geant4.kek.jp/show_bug.cgi?id=2589)
17+
918
## 2023-11-28 Ben Morgan (cmake-V11-01-30)
1019
- Bump minimum VecGeom version to 1.2.6
1120

cmake/Modules/G4ConfigurePkgConfigHelpers.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS)
262262
set(G4_QT_CFLAGS "${G4_QT_CFLAGS} -I${_dir}")
263263
endforeach()
264264

265+
if(APPLE AND G4_QT_CFLAGS MATCHES "QtCore\.framework")
266+
set(G4_QT_CFLAGS "${G4_QT_CFLAGS} -F${G4QTLIBPATH}")
267+
endif()
265268
else()
266269
set(G4_BUILTWITH_QT "no")
267270
endif()

cmake/Modules/G4InterfaceOptions.cmake

+13-1
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,28 @@ if(GEANT4_USE_INVENTOR)
138138
find_package(Coin 4.0.0 REQUIRED)
139139
geant4_save_package_variables(Inventor Coin_DIR)
140140

141+
# Helper to hand-check version because SoXXX use an exact version strategy
142+
# in their CMake config files
143+
function(check_sobind_version _binding _minversion)
144+
if(${_binding}_VERSION VERSION_LESS "${_minversion}")
145+
message(FATAL_ERROR "Found ${_binding}, version: ${${_binding}_VERSION}, but Geant4 requires versions >= ${_minversion}\n"
146+
"${_binding} found at:\n ${${_binding}_DIR}\n")
147+
endif()
148+
endfunction()
149+
141150
if(GEANT4_USE_INVENTOR_QT)
142-
find_package(SoQt 1.6.0 REQUIRED)
151+
find_package(SoQt REQUIRED)
152+
check_sobind_version(SoQt 1.6.0)
143153
geant4_save_package_variables(Inventor SoQt_DIR)
144154
else()
145155
if(UNIX)
146156
find_package(SoXt 1.4.0 REQUIRED)
157+
check_sobind_version(SoXt 1.4.0)
147158
geant4_save_package_variables(Inventor SoXt_DIR)
148159
set(GEANT4_USE_INVENTOR_XT ON)
149160
elseif(WIN32)
150161
find_package(SoWin 1.4.0 REQUIRED)
162+
check_sobind_version(SoWin 1.4.0)
151163
geant4_save_package_variables(Inventor SoWin_DIR)
152164
set(GEANT4_USE_INVENTOR_WIN ON)
153165
endif()

examples/advanced/CaTS/CaTS.out

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Environment variable "G4FORCE_RUN_MANAGER_TYPE" enabled with value == Serial. Fo
3838

3939

4040
**************************************************************
41-
Geant4 version Name: geant4-11-02-ref-00 (8-December-2023)
41+
Geant4 version Name: geant4-11-02-patch-01 (16-February-2024)
4242
Copyright : Geant4 Collaboration
4343
References : NIM A 506 (2003), 250-303
4444
: IEEE-TNS 53 (2006), 270-278
@@ -778,4 +778,4 @@ Correlated gamma emission flag 0
778778
Max 2J for sampling of angular correlations 10
779779
=======================================================================
780780
writing Event: 0
781-
TimeTotal> 25.213 2.830
781+
TimeTotal> 16.268 2.600

0 commit comments

Comments
 (0)