Skip to content

Commit d2db8fb

Browse files
committed
Import Geant4 10.1.3 source tree
1 parent 2c587f9 commit d2db8fb

File tree

240 files changed

+21121
-4726
lines changed

Some content is hidden

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

240 files changed

+21121
-4726
lines changed

CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# 21st September 2010 Ben Morgan
55
#
6-
# $Id: CMakeLists.txt 90844 2015-06-10 10:03:56Z gcosmo $
6+
# $Id: CMakeLists.txt 95323 2016-02-04 15:12:37Z gcosmo $
77
#
88

99
#------------------------------------------------------------------------------
@@ -72,10 +72,10 @@ set(CMAKE_MODULE_PATH
7272
# See the documentation in each of these modules for further details.
7373
#
7474
# - Versioning. We do this here for now
75-
set(${PROJECT_NAME}_VERSION "10.1.2")
75+
set(${PROJECT_NAME}_VERSION "10.1.3")
7676
set(${PROJECT_NAME}_VERSION_MAJOR "10")
7777
set(${PROJECT_NAME}_VERSION_MINOR "1")
78-
set(${PROJECT_NAME}_VERSION_PATCH "2")
78+
set(${PROJECT_NAME}_VERSION_PATCH "3")
7979

8080
# - Provide dependent options as these are needed for some Geant4 features
8181
include(CMakeDependentOption)

ReleaseNotes/Patch4.10.1-3.txt

+201
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
2+
Geant4 10.1 - patch-03 Release Notes
3+
------------------------------------
4+
5+
5 February 2016
6+
7+
List of fixes included in this public patch since the public release 10.1.p02:
8+
9+
o Configuration:
10+
-------------
11+
+ CMake:
12+
o Updated Apple Clang detection to work on Xcode-7.
13+
o Always use libc++ with Apple Clang so that std-supporting library is
14+
used for C++11 mode on older Mac systems where libstdc++ is the default.
15+
o Updated std-flag setting rules.
16+
+ GNUMake:
17+
o Updated X11 settings in MacOS platform.
18+
o Added settings for C++ standards in platform specific scripts.
19+
20+
o Analysis:
21+
--------
22+
+ Fixed G4Analysis::Tokenize() which was failing when processsing a string
23+
containing opening double quota without a closing one.
24+
+ Fixed handling ntuples created in MT mode on master thread
25+
This fixes the problem reported in hypernews (#459) and the problem
26+
of deleting non-empty Root file containing only ntuples.
27+
28+
o Geometry:
29+
--------
30+
+ divisions:
31+
o Fix for use of rotation matrix in G4VDivisionParameterisation in
32+
MT-mode; use thread-local pointer for rotation matrix as member of the
33+
class G4VDivisionParameterisation and set it to suto-delete.
34+
Removed unnecessary thread-local verbose flag.
35+
Addressing problem reports #1743 and #1758.
36+
o Set as unsupported divisions of polycone and polyhedra in MT-mode.
37+
+ magneticfield:
38+
o Added check in G4ChordFinder against number of iterations in
39+
FindNextChord(), to identify potential cases of lack of convergence.
40+
o Better diagnostics text in case of errors in G4FieldTrack and
41+
G4UniformMagField.
42+
o Added explanation comment in G4MagHelicalSteper.
43+
+ navigation:
44+
o G4MultiLevelLocator::EstimateIntersectionPoint(): fix for logic error
45+
in keeping consistent candidate intersection. Copes with case that a
46+
candidate intersection is not found in the next segment (typically in
47+
the 'second half' part).
48+
Ensure that splitting of step (new level/depth) advances the required
49+
length, used when adding a new level/depth.
50+
Revised condition of 'while' loop which ensures that a new candidate
51+
intersection exists. Corrected the resetting of 'first_section' flag.
52+
Replaced fatal error for exceeding max steps with warning and signal
53+
'looping' for too many steps; G4PropagatorInField detects this
54+
condition, and identifies it as a 'Looping Particle' which is then
55+
flagged; the calling class (Transportation, PathFinder) is expected
56+
to stop the tracking of this particle after a few of these steps.
57+
Addressing issue seen by ALICE (non-finishing of step due to poor
58+
advances).
59+
o G4VIntersectionLocator: added new logging methods & revised interfaces.
60+
o G4NavigationLogger: added method to report issue with normal that
61+
is the result of applying a rotation.
62+
o G4NormalNavigation, G4VoxelNavigation: added check of rotated exit
63+
normal.
64+
o Relaxed condition for zero or almost-zero steps in G4ReplicaNavigation
65+
and G4Navigator, to allow for faster progression in case of stuck tracks
66+
in 3D scoring meshes. Addressing old problem report #1432.
67+
o Fix in G4ReplicaNavigation::ComputeStep() for correct setting of copyNo
68+
for particle entering. Fixes issue of negative copyNo observed in nested
69+
replica setups. Addressing problem report #1634.
70+
o Moved check for overlaps in G4Navigator::ComputeStep() within G4VERBOSE.
71+
Addressing problem report #1811.
72+
+ solids/Boolean:
73+
o Checked for potential never-ending loops. Replaced while-do loop with
74+
bounded for-loop in G4IntersectionSolid::DistanceToIn(p,v).
75+
Also addressing problem report #1821.
76+
+ solids/CSG:
77+
o Introduced check in G4Sphere::DistanceToIn(p,v) for concave Theta and
78+
point located on the origin. Also make proper use of radial tolerance in
79+
DistanceToOut(p,v).
80+
o Fixed Coverity defect in G4CutTubs::GetMaxMinZ().
81+
+ solids/specific:
82+
o Added specialised implementation for GetCubicVolume() in
83+
G4TessellatedSolid. Added debug printouts withing G4SPECSDEBUG for
84+
DistanceToIn/Out(p,v) to identify potential wrong responses.
85+
o Removed redundant condition in G4Polyhedra and G4polycone
86+
SetOriginalParameters() method.
87+
o Minor code cleanup in G4SurfaceVoxelizer.
88+
o Checked for potential never-ending loops.
89+
+ volumes:
90+
o Enabled paramerisation by solid type in G4GeometryWorkspace in MT-mode.
91+
Assumes solids being parameterised are declared thread-local in the
92+
user's parameterisation class and allocated just once.
93+
94+
o Global:
95+
------
96+
+ Tune radial tolerance to same value as for Cartesian tolerance in
97+
G4GeometryTolerance.
98+
+ Corrected conditions for proper treatment of gcc-5 in tls.hh and
99+
G4Threading.hh.
100+
+ Removed unused and buggy operator=(const G4String&) in G4SubString.
101+
Added string length check in G4String::operator==().
102+
Added missing 'inline' specification to functions in G4String.
103+
+ Force use of G4MT wrappers for Intel-icc compiler for random numbers.
104+
+ Updated date and version for 10.1.p03.
105+
106+
o Materials:
107+
---------
108+
+ G4NistElementBuilder: fixed typo in printout.
109+
Addressing problem report #1786.
110+
111+
o Parameterisations:
112+
-----------------
113+
+ gflash: fix for Zeff wrongly computed as ( W1*Z2 ) + ( W2*Z1 ), with Z1
114+
and Z2 swapped. Addressing problem report #1719.
115+
116+
o Particles:
117+
---------
118+
+ Fixed wrong argument order CreateIon(A,Z,LL,0.0) in G4IonTable to
119+
CreateIon(Z,A,LL,0.0).
120+
+ Fixed setting of mass in decay parent particle.
121+
Addressing problem report #1820.
122+
123+
o Persistency:
124+
-----------
125+
+ GDML:
126+
o Use relaxed precision constant for matrix to angle formula evaluation
127+
in G4GDMLWriteDefine, to allow for proper treatment of singularities.
128+
Fixes issues of misplaced volumes in exported geometries of complex
129+
detectors.
130+
o Rectify rotation matrices in reading and writing GDML files to reduce
131+
spurious roundoff errors in stored values.
132+
133+
o Physics Lists
134+
-------------
135+
+ constructors/limiters:
136+
o G4ParallelWorldPhysics: fixed process order index for
137+
G4ParallelWorldProcess to 9900 to make sure it is registered
138+
prior to G4OpBoundaryProcess.
139+
140+
o Processes - Electromagnetic:
141+
---------------------------
142+
+ xrays:
143+
o G4VTransitionRadiation, G4VXTRenergyLoss: fixed process sub-type.
144+
145+
o Processes - Generic:
146+
-------------------
147+
+ scoring:
148+
o G4ParallelWorldProcess: fixed processType from 'fParameterized'
149+
to 'fParallel' and set processSubType to 491.
150+
o Fixed Coverity defects.
151+
152+
o Processes - Hadronic:
153+
--------------------
154+
+ cross_sections:
155+
o G4NeutronInelasticXS, G4NeutronCaptureXS: fixed isotope cross-sections
156+
including retrieve, data management, isotope x-section and isotope
157+
selection. Fixed Coverity defects.
158+
+ models/cascade:
159+
o G4CascadeCoalescence: added explicit inclusion of
160+
G4InuclElementaryParticle header to address compiler error from Cray
161+
(as reported in Configuration Hypernews Forum #1764).
162+
+ models/coherent_elastic:
163+
o G4DiffuseElastic: bug-fix in BuildAngleTable() to improve the angle
164+
bin accuracy at high energies.
165+
+ models/im_r_matrix:
166+
o Fixed compiler warning in clang-3.6.
167+
168+
o Run:
169+
---
170+
+ G4PhysicsListHelper: add entry for G4ParallelWorldProcess.
171+
+ G4RunManager, G4WorkerRunManager: fixed process order index of
172+
G4ParallelWorldProcess to 9900 to make sure it is registered
173+
prior to G4OpBoundaryProcess.
174+
175+
o Tracking:
176+
--------
177+
+ G4SteppingManager: fix to properly set 'OriginTouchableHandle' for the
178+
primary track. Addressing problem report #1773.
179+
180+
o Examples:
181+
--------
182+
+ Updated reference outputs.
183+
+ basic/B4:
184+
o Restored the third parameter in G4UIsession construction, which was
185+
lost when moving G4UIExecutive at the beginning of main().
186+
Addressing problem report #1802.
187+
188+
----------------------------------------------------------------------------
189+
190+
Technical Notes
191+
---------------
192+
193+
o This patch should be applied on top of release 10.1, 10.1.p01 or 10.1.p02.
194+
o Technical notes distributed for release 10.1 are also applicable and
195+
valid for this patch.
196+
197+
The code and rebuilt binary libraries for release 10.1.p03 are available
198+
through our "Download" Web page.
199+
200+
Please refer to the Geant4 User Documentation for further information about
201+
using Geant4.

cmake/History

+16
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@ add this in the documentation for the changed file as [BUGFIX #BUGNUMBER].
3131

3232
----------------------------------------------------------
3333

34+
6th October 2015 - Ben Morgan (cmake-V10-00-43, 42)
35+
- Modules/Geant4MakeRules_cxx.cmake: Update AppleClang detection to
36+
for Xcode 7 and match to CMake 3's AppleClang rules. Provide
37+
CXXSTD_IS_AVAILABLE for MSVC 19 so that appropriate standard selection
38+
preprocessor symbols are defined.
39+
40+
27th July 2015 - Ben Morgan
41+
- Modules/Geant4MakeRules_cxx.cmake : Always use libc++ with Apple
42+
Clang so that std-supporting library is used for C++11 mode on
43+
older Mac systems where libstdc++ is the default.
44+
45+
23rd July 2015 - Ben Morgan
46+
- Modules/Geant4MakeRules_cxx.cmake : To permit transition to C++11
47+
update std-flag setting rules to only allow C++11 builds with compiler
48+
versions that are know to support the features in current use.
49+
3450
8th June 2015 - Ben Morgan (cmake-V10-00-41)
3551
- Templates/Geant4Config.cmake.in : Always re-find Qt5 via find_package
3652
if Geant4 was configured with Qt5 support. Qt5 libraries are in

cmake/Modules/Geant4LibraryBuildOptions.cmake

+12
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,18 @@ if(CXXSTD_IS_AVAILABLE)
132132
if(GEANT4_BUILD_CXXSTD MATCHES "c\\+\\+11")
133133
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
134134
endif()
135+
if(GEANT4_BUILD_CXXSTD MATCHES "c\\+\\+14")
136+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
137+
endif()
138+
if(GEANT4_BUILD_CXXSTD MATCHES "c\\+\\+1y")
139+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
140+
endif()
141+
if(GEANT4_BUILD_CXXSTD MATCHES "c\\+\\+1z")
142+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
143+
endif()
144+
if(GEANT4_BUILD_CXXSTD MATCHES "c\\+\\+17")
145+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
146+
endif()
135147
endif()
136148

137149
#-----------------------------------------------------------------------

cmake/Modules/Geant4MakeRules_cxx.cmake

+76-26
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,17 @@ function(__configure_cxxstd_gnu)
4646
OUTPUT_STRIP_TRAILING_WHITESPACE
4747
)
4848

49-
if(_gnucxx_version VERSION_LESS 4.3)
49+
# Set allowed flags based, temporarily, on KNOWN abilities of compiler
50+
# rather than what flags it supports (e.g. GCC 4.7 claims -std=c++11
51+
# works, but it does not support inheriting constructors...)
52+
if(_gnucxx_version VERSION_LESS 4.8)
5053
set(_CXXSTDS "c++98")
51-
elseif(_gnucxx_version VERSION_LESS 4.7)
52-
set(_CXXSTDS "c++98" "c++0x")
5354
elseif(_gnucxx_version VERSION_LESS 4.9)
54-
set(_CXXSTDS "c++98" "c++0x" "c++11")
55+
set(_CXXSTDS "c++98" "c++11")
56+
elseif(_gnucxx_version VERSION_LESS 5.3)
57+
set(_CXXSTDS "c++98" "c++11" "c++1y")
5558
else()
56-
set(_CXXSTDS "c++98" "c++0x" "c++11" "c++1y")
59+
set(_CXXSTDS "c++98" "c++11" "c++14" "c++1z")
5760
endif()
5861

5962
set(CXXSTD_IS_AVAILABLE ${_CXXSTDS} PARENT_SCOPE)
@@ -75,33 +78,71 @@ function(__configure_cxxstd_clang)
7578
ERROR_STRIP_TRAILING_WHITESPACE
7679
)
7780
string(REGEX REPLACE ".*clang version ([0-9]\\.[0-9]+).*" "\\1" _clangcxx_version ${_clangcxx_dumpedversion})
78-
# Apple Clang 4.2 no longer reports clang version but LLVM version
79-
# Moreover, this is Apple versioning, not LLVM upstream
80-
# If this is the case, the previous regex will not do anything.
81-
# Check to see if we have "Apple LLVM version" in the output,
82-
# and if so extract the original LLVM version which should appear as
83-
# "based on LLVM X.Ysvn". The "svn" extension means the development
84-
# version of LLVM X.Y, not a release, so it may not provide all features
85-
# present in the X.Y release.
86-
if(APPLE AND "${_clangcxx_version}" MATCHES ".*Apple LLVM version.*")
87-
string(REGEX REPLACE ".*based on LLVM ([0-9](\\.[0-9])+)svn.*" "\\1" _clangcxx_version ${_clangcxx_version})
88-
endif()
89-
message(STATUS "Clang version : ${_clangcxx_version}")
9081

91-
if(_clangcxx_version VERSION_LESS 2.9)
92-
set(_CXXSTDS "c++98")
93-
elseif(_clangcxx_version VERSION_LESS 3.3)
94-
set(_CXXSTDS "c++98" "c++0x" "c++11")
95-
elseif(_clangcxx_version VERSION_LESS 3.5)
96-
set(_CXXSTDS "c++98" "c++0x" "c++11" "c++1y")
82+
# Set allowed flags based, temporarily, on KNOWN abilities of compiler
83+
# rather than what flags it supports (e.g. Clang 3.4 claims -std=c++11
84+
# works, but it does not support <type_traits>...)
85+
86+
# Apple Clang Versioning works slightly differently...
87+
# We follow CMake conventions, allowing minimal changes for
88+
# CMake 3's 'AppleClang' convention
89+
if(APPLE AND "${_clangcxx_version}" MATCHES ".*Apple (LLVM|clang) version.*")
90+
# Apple LLVM version
91+
string(REGEX
92+
REPLACE ".*Apple (LLVM|clang) version ([0-9](\\.[0-9])+) .*" "\\2"
93+
APPLE_LLVM_VERSION_STR
94+
"${_clangcxx_version}"
95+
)
96+
# Apple build version
97+
string(REGEX REPLACE ".*[\\(/]clang\\-([0-9\\.]+)\\).*" "\\1"
98+
APPLE_BUILD_VERSION_STR
99+
"${_clangcxx_version}"
100+
)
101+
string(REPLACE "." ""
102+
APPLE_BUILD_VERSION_STR
103+
"${APPLE_BUILD_VERSION_STR}"
104+
)
105+
106+
# Format should be XXX.YY.ZZ, but 'YY' often appears as single digit,
107+
# so pad if length < 7 chars
108+
string(LENGTH ${APPLE_BUILD_VERSION_STR} ABVS_LENGTH)
109+
if(ABVS_LENGTH LESS 7)
110+
string(SUBSTRING "${APPLE_BUILD_VERSION_STR}" 0 3 APPLE_BUILD_VERSION_MAJOR)
111+
string(SUBSTRING "${APPLE_BUILD_VERSION_STR}" 3 -1 APPLE_BUILD_VERSION_REMAINDER)
112+
set(APPLE_BUILD_VERSION_STR "${APPLE_BUILD_VERSION_MAJOR}0${APPLE_BUILD_VERSION_REMAINDER}")
113+
endif()
114+
115+
set(__appleclang_version "${APPLE_LLVM_VERSION_STR}.${APPLE_BUILD_VERSION_STR}")
116+
117+
# Handle AppleClang versions
118+
if(__appleclang_version VERSION_LESS 5.1)
119+
set(_CXXSTDS "c++98")
120+
elseif(__appleclang_version VERSION_LESS 6.1)
121+
set(_CXXSTDS "c++98" "c++11" "c++1y")
122+
else()
123+
# As Apple's exact clang version is unclear, only use c++14 when
124+
# the 3.6svn version started to be used.
125+
set(_CXXSTDS "c++98" "c++11" "c++14")
126+
endif()
127+
128+
# Apple Clang requires use of libc++ for full C++11 support.
129+
# From OS X 10.9, libc++ is the default, but set it explicitly so
130+
# that 10.8 can be supported.
131+
set(_CXXSTDLIBFLAGS "-stdlib=libc++")
97132
else()
98-
# Be cautious for now and only use c++1y rather than c++14
99-
set(_CXXSTDS "c++98" "c++0x" "c++11" "c++1y")
133+
# Otherwise, have out-the-box clang
134+
if(_clangcxx_version VERSION_LESS 3.4)
135+
set(_CXXSTDS "c++98")
136+
elseif(_clangcxx_version VERSION_LESS 3.5)
137+
set(_CXXSTDS "c++98" "c++11" "c++1y")
138+
else()
139+
set(_CXXSTDS "c++98" "c++11" "c++14")
140+
endif()
100141
endif()
101142

102143
set(CXXSTD_IS_AVAILABLE ${_CXXSTDS} PARENT_SCOPE)
103144
foreach(_s ${_CXXSTDS})
104-
set(${_s}_FLAGS "-std=${_s}" PARENT_SCOPE)
145+
set(${_s}_FLAGS "-std=${_s} ${_CXXSTDLIBFLAGS}" PARENT_SCOPE)
105146
endforeach()
106147
endfunction()
107148

@@ -205,6 +246,15 @@ if(MSVC)
205246
set(CMAKE_CXX_FLAGS_TESTRELEASE_INIT "-MDd -Zi -G4DEBUG_VERBOSE")
206247
set(CMAKE_CXX_FLAGS_MAINTAINER_INIT "-MDd -Zi")
207248

249+
# C++ Standard modes - don't have flags, but is needed to set compile
250+
# defs
251+
# NB: Visual Studio 14 2015 => MSVC 19.X, and this is CMake's compiler
252+
# version
253+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0)
254+
set(CXXSTD_IS_AVAILABLE "c++98")
255+
else()
256+
set(CXXSTD_IS_AVAILABLE "c++98" "c++11")
257+
endif()
208258
# We may also have to set linker flags....
209259
endif()
210260

0 commit comments

Comments
 (0)