Import Geant4 11.2.2 source tree

This commit is contained in:
Gabriele Cosmo
2024-06-21 15:46:33 +02:00
parent dda54bbdcf
commit f7b23877ed
411 changed files with 22817 additions and 21317 deletions
+13
View File
@@ -6,6 +6,19 @@ It must **not** be used as a substitute for writing good git commit messages!
-------------------------------------------------------------------------------
## 2024-04-25 Pere Mato (global-V11-01-28)
- Changed Windows.h to windows.h since for MinGW always seems to be lower case, not relevant for native builds.
_MSC_VER is only available for VC compiler, the os one is _WIN32.
## 2024-04-20 Gabriele Cosmo
- Fixed compilation error in G4PhysicsModelCatalog on Windows VC++ with
C++20 Standard enabled.
Based on [GitHub PR#69](https://github.com/Geant4/geant4/pull/69).
## 2024-04-04 Stephan Hageboeck
- Provide a helpful error message when GEANT4_DATA_DIR is set to an invalid
location.
## 2023-12-21 Yoshihide Sato (global-V11-01-27)
- G4PhysicsModelCatalog.cc: added the ID for the Light-Ion QMD model.
@@ -43,7 +43,7 @@
/// |--> patch number (single digit)
///
#ifndef G4VERSION_NUMBER
#define G4VERSION_NUMBER 1121
#define G4VERSION_NUMBER 1122
#endif
/// @def G4VERSION_REFERENCE_TAG
@@ -59,7 +59,7 @@
#endif
#ifndef G4VERSION_TAG
#define G4VERSION_TAG "$Name: geant4-11-02-patch-01 $"
#define G4VERSION_TAG "$Name: geant4-11-02-patch-02 $"
#endif
// as variables
@@ -68,10 +68,10 @@
#include "G4Types.hh"
#ifdef G4MULTITHREADED
static const G4String G4Version = "$Name: geant4-11-02-patch-01 [MT]$";
static const G4String G4Version = "$Name: geant4-11-02-patch-02 [MT]$";
#else
static const G4String G4Version = "$Name: geant4-11-02-patch-01 $";
static const G4String G4Version = "$Name: geant4-11-02-patch-02 $";
#endif
static const G4String G4Date = "(16-February-2024)";
static const G4String G4Date = "(21-June-2024)";
#endif
@@ -29,12 +29,13 @@
#ifndef G4GMAKE
#include "G4FindDataDir.hh"
#include "G4Filesystem.hh"
#include "G4Exception.hh"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#if defined(_MSC_VER)
#if defined(_WIN32)
#define setenv(name, value, overwrite) _putenv_s(name, value)
#endif
@@ -91,7 +92,7 @@ static const char* G4FindDataDir(const char* name, const path& prefix, const pat
}
const char* G4FindDataDir(const char* name)
{
{
#if defined(G4MULTITHREADED)
static std::mutex mutex;
std::lock_guard<std::mutex> lock(mutex);
@@ -104,8 +105,12 @@ const char* G4FindDataDir(const char* name)
/* If we know which directory/version to search for, try to find it */
if (const char *dataset = G4GetDataDir(name)) {
/* If GEANT4_DATA_DIR environment variable is set, use it and don't search further */
if (const char *basedir = std::getenv("GEANT4_DATA_DIR"))
return G4FindDataDir(name, basedir, dataset);
if (const char *basedir = std::getenv("GEANT4_DATA_DIR")) {
if (is_directory(basedir)) return G4FindDataDir(name, basedir, dataset);
G4Exception("G4FindDataDir", "Invalid GEANT4_DATA_DIR", JustWarning, "The GEANT4_DATA_DIR environment variable points to an invalid directory.\n"
"Will try fallback locations now. Correct the variable to disable this behaviour.");
}
/* If GEANT4_DATA_DIR environment variable is not set, search in default system paths */
for (const auto prefix : system_paths)
@@ -377,7 +377,7 @@ void G4PhysicsModelCatalog::Initialize() {
// --- Low-energy data-driven : 25'000 - 25'999 ---
// ------------------------------------------------
// - 25'000 - 25'199 : ParticleHP
// - 25'200 - 25'200 : LEND
// - 25'200 - 25'299 : LEND
// ...
// - 25'500 - 25'999 : RadioactiveDecay
@@ -585,7 +585,7 @@ void G4PhysicsModelCatalog::Initialize() {
// --- Others ... ---
// ======================================================================
// ================== 4th MODELS ADDED AFTER Geant4 11 ==================
// ================== 4th MODELS ADDED AFTER Geant4 11.0 ================
// ======================================================================
// PLEASE ADD MODELS ONLY BELOW HERE, WITH PROPER modelID .
// IF YOU ARE NOT SURE, PLEASE CONTACT ONE OF THE COORDINATORS OF THE
@@ -684,12 +684,14 @@ const G4String G4PhysicsModelCatalog::GetModelNameFromID( const G4int modelID )
// --------------------------------------------------------------------------
const G4String G4PhysicsModelCatalog::GetModelNameFromIndex( const G4int modelIndex ) {
return ( modelIndex >= 0 && modelIndex < Entries() ) ? (*theVectorOfModelNames)[ modelIndex ] : "Undefined";
return ( modelIndex >= 0 && modelIndex < Entries() )
? (*theVectorOfModelNames)[ modelIndex ] : G4String("Undefined");
}
// --------------------------------------------------------------------------
G4int G4PhysicsModelCatalog::GetModelID( const G4int modelIndex ) {
return ( modelIndex >= 0 && modelIndex < Entries() ) ? (*theVectorOfModelIDs)[ modelIndex ] : -1;
return ( modelIndex >= 0 && modelIndex < Entries() )
? (*theVectorOfModelIDs)[ modelIndex ] : -1;
}
// --------------------------------------------------------------------------
+2 -2
View File
@@ -34,8 +34,8 @@
#include "G4AutoLock.hh"
#include "globals.hh"
#if defined(WIN32) || defined(__MINGW32__)
# include <Windows.h>
#if defined(_WIN32)
# include <windows.h>
#else
# include <sys/syscall.h>
# include <sys/types.h>