Import Geant4 11.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2025-12-05 08:54:02 +01:00
parent a499fb82e9
commit b4a16de652
6484 changed files with 232674 additions and 221097 deletions
@@ -6,6 +6,10 @@ It must **not** be used as a substitute for writing good git commit messages!
-------------------------------------------------------------------------------
## 2025-10-19 Makoto Asai (exampleRE03-V11-03-00)
- Protect against the use of parallel geometry initialization if runnung in
sub-event parallel mode. This feature will be enabled next year.
## 2024-11-11 Gabriele Cosmo (exampleRE03-V11-02-01)
- Fixed CMake script for missing input macros.
+6 -4
View File
@@ -23,17 +23,15 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file runAndEvent/RE03/RE03.cc
/// \file RE03.cc
/// \brief Main program of the runAndEvent/RE03 example
//
//
//
#include "G4Types.hh"
#include "G4RunManagerFactory.hh"
#include "G4UImanager.hh"
#include "G4ScoringManager.hh"
#include "G4GeometryManager.hh"
#include "RE03DetectorConstruction.hh"
#include "FTFP_BERT.hh"
@@ -60,6 +58,10 @@ int main(int argc,char** argv)
auto* runManager = G4RunManagerFactory::CreateRunManager();
runManager->SetNumberOfThreads(4);
// Disable parallel geometry optimization for sub-event parallel mode
if(runManager->GetRunManagerType()==G4RunManager::subEventMasterRM)
{ G4GeometryManager::GetInstance()->RequestParallelOptimisation(false); }
// Activate UI-command base scorer
G4ScoringManager * scManager = G4ScoringManager::GetScoringManager();
scManager->SetVerboseLevel(1);
-88
View File
@@ -1,88 +0,0 @@
RE03 - An extended example for run and event
--------------------------------------------
Contact : M.Asai (SLAC/JLab), A.Kimura (AIT), T.Aso (TNCMT)
1. Introduction
This example demonstrates how to use UI-command base scoring.
It create parallel world(s) for defining scoring mesh(es).
Due to some performance overhead, this functionality is not
provided by default. To get it included, the pointer to
G4ScoringManager must be accessed. The access to the static
method G4ScoringManager::GetScoringManager() activates this
functionality.
1.1 Geometry and primary particle
It has just one water box in the world volume filled by air.
No detector in the mass geometry. Particle gun shoots a gamma
into the water box.
1.2 Physics
The physics list is taken from referenced physics-list QGS_BIC
in Geant4.
2. Macro files
2.1 "run.mac"
"run.mac" is the main macro file of this example for both
batch and interactive modes.
In interactive mode, trajectories are not visualized by default
for the sake of execution speed. To visualize them, comment out
lines of /vis/disable and /vis/enable in "run.mac".
In addition, in sub-event parallel mode, only the trajectories
created in the master thread are visualized by default.
Un-comment the line of /run/trajectoriesToBeMerged in "vis.mac"
to visualize all trajectories.
"draw.mac" is used by "run.mac" to visualize a score.
2.2 Other macro files
"run2.mac" through "run4.mac" macro files should be used
independently. They demonstrate additional functionalities of
command-based scoring. Each macro file create its own scoring
parallel world(s).
- "run2.mac" : defining three box meshes of different sizes
and granurarities touching to each other
- "run3.mac" : defining two box meshes of different sizes and
granurarities overlaying one over the other to demonstrate
changing granurarity of a box mesh
- "run4.mac" " defining a cylindrical mesh
IMPORTANT: DO NOT use more than one of these macro files in
one execution of this example.
"drawSlice.mac" and "drawCylinderSlice.mac" are used internally
from "run*.mac" to draw a single slice of the corresponding mesh.
3. RE03ActionInitialization
This UserActionInitialization class works for all Geant4 run
modes, i.e. sequential mode, event-level paralle mode and
sub-event-level parallel mode.
4. RE03UserScoreWriter
G4ScoringManager has a default score writer which dumps every
entry of one quantity of a mesh for all quantities of the mesh
one by one in CSV format. To alternate the file format the user
can implement his/her own score writer deriving from G4VUserScoreWriter
base class and set it to G4ScoringManager. To demonstrate this,
RE03UserScoreWriter is included in this example. To use this
alternative writer, un-comment its instantiation in RE03.cc.
@@ -1,13 +1,9 @@
///\file "runAndEvent/RE03/.README.txt"
///\brief Example RE03 README page
/*! \page ExampleRE03 Example RE03
\page ExampleRE03 Example RE03
Contact : M.Asai (SLAC/JLab), A.Kimura (AIT), T.Aso (TNCMT)
\section RE03_s1 Introduction
## Introduction
This example demonstrates how to use UI-command base scoring.
It create parallel world(s) for defining scoring mesh(es).
@@ -18,64 +14,64 @@ G4ScoringManager must be accessed. The access to the static
method G4ScoringManager::GetScoringManager() activates this
functionality.
\subsection RE03_s11 Geometry and primary particle
### Geometry and primary particle
It has just one water box in the world volume filled by air.
No detector in the mass geometry. Particle gun shoots a gamma
into the water box.
\subsection RE03_s12 Physics
### Physics
The physics list is taken from referenced physics-list QGS_BIC
in Geant4.
\section RE03_s2 Macro files
## Macro files
\subsection RE03_s21 "run.mac"
### "run.mac"
"run.mac" is the main macro file of this example for both
run.mac is the main macro file of this example for both
batch and interactive modes.
In interactive mode, trajectories are not visualized by default
for the sake of execution speed. To visualize them, comment out
lines of /vis/disable and /vis/enable in "run.mac".
lines of `/vis/disable` and `/vis/enable` in run.mac.
In addition, in sub-event parallel mode, only the trajectories
created in the master thread are visualized by default.
Un-comment the line of /run/trajectoriesToBeMerged in "vis.mac"
Un-comment the line of /run/trajectoriesToBeMerged in vis.mac
to visualize all trajectories.
"draw.mac" is used by "run1.mac" to visualize a score.
draw.mac is used by run.mac to visualize a score.
\subsection RE03_s22 Other macro files
### Other macro files
"run2.mac" through "run4.mac" macro files should be used
run2.mac through run4.mac macro files should be used
independently. They demonstrate additional functionalities of
command-based scoring. Each macro file create its own scoring
parallel world(s).
- "run2.mac" : defining three box meshes of different sizes
- run2.mac : defining three box meshes of different sizes
and granurarities touching to each other
- "run3.mac" : defining two box meshes of different sizes and
- run3.mac : defining two box meshes of different sizes and
granurarities overlaying one over the other to demonstrate
changing granurarity of a box mesh
- "run4.mac" " defining a cylindrical mesh
- run4.mac : defining a cylindrical mesh
IMPORTANT: DO NOT use more than one of these macro files in
one execution of this example.
"drawSlice.mac" and "drawCylinderSlice.mac" are used internally
from "run*.mac" to draw a single slice of the corresponding mesh.
drawSlice.mac and drawCylinderSlice.mac are used internally
from run*.mac to draw a single slice of the corresponding mesh.
\section RE03_s3 RE03ActionInitialization
## RE03ActionInitialization
This UserActionInitialization class works for all Geant4 run
The RE03ActionInitialization class works for all Geant4 run
modes, i.e. sequential mode, event-level paralle mode and
sub-event-level parallel mode.
\section RE03_s4 RE03UserScoreWriter
## RE03UserScoreWriter
G4ScoringManager has a default score writer which dumps every
G4ScoringManager has a default score writer which dumps every
entry of one quantity of a mesh for all quantities of the mesh
one by one in CSV format. To alternate the file format the user
can implement his/her own score writer deriving from G4VUserScoreWriter
@@ -83,8 +79,6 @@ base class and set it to G4ScoringManager. To demonstrate this,
RE03UserScoreWriter is included in this example. To use this
alternative writer, un-comment its instantiation in RE03.cc.
*/
@@ -23,11 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file runAndEvent/RE03/include/RE03ActionInitialization.hh
/// \file RE03ActionInitialization.hh
/// \brief Definition of the RE03ActionInitialization class
//
//
//
#ifndef RE03ActionInitialization_h
#define RE03ActionInitialization_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file runAndEvent/RE03/include/RE03DetectorConstruction.hh
/// \file RE03DetectorConstruction.hh
/// \brief Definition of the RE03DetectorConstruction class
//
//
#ifndef RE03DetectorConstruction_h
#define RE03DetectorConstruction_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file runAndEvent/RE03/include/RE03PrimaryGeneratorAction.hh
/// \file RE03PrimaryGeneratorAction.hh
/// \brief Definition of the RE03PrimaryGeneratorAction class
//
//
#ifndef RE03PrimaryGeneratorAction_h
#define RE03PrimaryGeneratorAction_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file runAndEvent/RE03/include/RE03UserScoreWriter.hh
/// \file RE03UserScoreWriter.hh
/// \brief Definition of the RE03UserScoreWriter class
//
//
#ifndef RE03UserScoreWriter_h
#define RE03UserScoreWriter_h 1
+29 -30
View File
@@ -11,7 +11,7 @@ Environment variable "G4FORCE_RUN_MANAGER_TYPE" enabled with value == Serial. Fo
**************************************************************
Geant4 version Name: geant4-11-03-ref-06 (30-June-2025)
Geant4 version Name: geant4-11-04-ref-00 (5-December-2025)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
@@ -29,7 +29,6 @@ You have successfully registered the following graphics systems.
Registered graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRepFile (HepRepFile)
RayTracer (RT)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)
@@ -42,13 +41,12 @@ Registered graphics systems are:
OpenGLStoredX (OGLSX, OGLSQt_FALLBACK, OGLSXm_FALLBACK)
RayTracerX (RTX)
RayTracerQt (RTQt)
Qt3D (Qt3D)
TOOLSSG_X11_GLES (TSG_X11_GLES, TSGX11, TSG_XT_GLES_FALLBACK)
TOOLSSG_X11_ZB (TSG_X11_ZB, TSGX11ZB)
TOOLSSG_XT_GLES (TSG_XT_GLES, TSGXt, TSG_QT_GLES_FALLBACK)
TOOLSSG_XT_ZB (TSG_XT_ZB, TSGXtZB)
TOOLSSG_QT_GLES (TSG_QT_GLES, TSGQt, TSG, OGL)
TOOLSSG_QT_ZB (TSG_QT_ZB, TSGQtZB)
TOOLSSG_QT_ZB (TSG_QT_ZB, TSGQtZB, TSGZB)
You may choose a graphics system (driver) with a parameter of
the command "/vis/open" or "/vis/sceneHandler/create",
or you may omit the driver parameter and choose at run time:
@@ -163,7 +161,7 @@ Lowest muon/hadron kinetic energy 1 keV
Use ICRU90 data 0
Fluctuations of dE/dx are enabled 1
Type of fluctuation model for leptons and hadrons Urban
Use built-in Birks satuaration 0
Use built-in Birks saturation 0
Build CSDA range enabled 0
Use cut as a final range enabled 0
Enable angular generator interface 0
@@ -300,7 +298,7 @@ hBrems: for proton XStype:1 SubType=3
hPairProd: for proton XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Sampling table 17x1001 from 7.50618 GeV to 100 TeV
Sampling table 17x1001, from 7.50618 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
@@ -358,7 +356,7 @@ hBrems: for anti_proton XStype:1 SubType=3
hPairProd: for anti_proton XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Sampling table 17x1001 from 7.50618 GeV to 100 TeV
Sampling table 17x1001, from 7.50618 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
@@ -390,7 +388,7 @@ hBrems: for kaon+ XStype:1 SubType=3
hPairProd: for kaon+ XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Sampling table 18x1001 from 3.94942 GeV to 100 TeV
Sampling table 18x1001, from 3.94942 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
@@ -422,7 +420,7 @@ hBrems: for kaon- XStype:1 SubType=3
hPairProd: for kaon- XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Sampling table 18x1001 from 3.94942 GeV to 100 TeV
Sampling table 18x1001, from 3.94942 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
@@ -454,7 +452,7 @@ muBrems: for mu+ XStype:1 SubType=3
muPairProd: for mu+ XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Sampling table 21x1001 from 0.85 GeV to 100 TeV
Sampling table 21x1001, from 0.85 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
muPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
@@ -486,7 +484,7 @@ muBrems: for mu- XStype:1 SubType=3
muPairProd: for mu- XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Sampling table 21x1001 from 0.85 GeV to 100 TeV
Sampling table 21x1001, from 0.85 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
muPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
@@ -518,7 +516,7 @@ hBrems: for pi+ XStype:1 SubType=3
hPairProd: for pi+ XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Sampling table 20x1001 from 1.11656 GeV to 100 TeV
Sampling table 20x1001, from 1.11656 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
@@ -550,7 +548,7 @@ hBrems: for pi- XStype:1 SubType=3
hPairProd: for pi- XStype:1 SubType=4
dE/dx and range tables from 100 eV to 100 TeV in 84 bins
Lambda tables from threshold to 100 TeV, 7 bins/decade, spline: 1
Sampling table 20x1001 from 1.11656 GeV to 100 TeV
Sampling table 20x1001, from 1.11656 GeV to 100 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi
@@ -805,8 +803,8 @@ CoulombScat: for pi- XStype:1 SubType=1 BuildTable=1
Type of pre-compound model 0
Type of pre-compound inverse x-section 1
Pre-compound model active 1
Pre-compound excitation low energy 100 keV
Pre-compound excitation high energy 30 MeV
Pre-compound excitation low energy 0.1 MeV
Pre-compound excitation high energy 15 MeV
Angular generator for pre-compound model 1
Use NeverGoBack option for pre-compound model 0
Use SoftCutOff option for pre-compound model 0
@@ -820,9 +818,8 @@ Type of de-excitation inverse x-section 3
Type of de-excitation factory Evaporation+GEM
Number of de-excitation channels 68
Type of Fermi BreakUp model ModelVI
Min excitation energy 10 eV
Min energy per nucleon for multifragmentation 200 GeV
Limit excitation energy for Fermi BreakUp 20 MeV
Min excitation energy 0.01 keV
Min energy per nucleon for multifragmentation 2e+05 MeV
Level density (1/MeV) 0.075
Use simple level density model 1
Use discrete excitation energy of the residual 0
@@ -867,7 +864,7 @@ Index : 1 used in the geometry : Yes
Start closing geometry.
--------------------------------------------------------------------------------
G4GeometryManager::ReportVoxelStats -- Voxel Statistics
G4VoxelisationHelper::ReportVoxelStats -- Voxel Statistics
Total memory consumed for geometry optimisation: 5 kByte
Total CPU time elapsed for geometry optimisation: 0 seconds
@@ -891,7 +888,7 @@ G4GeometryManager::ReportVoxelStats -- Voxel Statistics
Run terminated.
Run Summary
Number of events processed : 2000
User=2.690000s Real=2.703055s Sys=0.010000s
User=2.590000s Real=2.595587s Sys=0.000000s
/control/doifInteractive /vis/enable
#
########################################
@@ -912,9 +909,9 @@ Graphics systems deleted.
Visualization Manager deleting...
G4 kernel has come to Quit state.
Deleting G4Run (id:0)
UserDetectorConstruction deleted 0x1c89530
UserPhysicsList deleted 0x1c85880
UserActionInitialization deleted 0x1e45430
UserDetectorConstruction deleted 0x91f900
UserPhysicsList deleted 0x91bc50
UserActionInitialization deleted 0xadb3f0
UserWorkerInitialization deleted 0
UserWorkerThreadInitialization deleted 0
UserRunAction deleted.
@@ -924,21 +921,23 @@ G4SDManager deleted.
EventManager deleted.
Units table cleared.
TransportationManager deleted.
Total navigation history collections cleaned: 49
Total navigation history collections cleaned: 54
G4RNGHelper object is deleted.
================== Deleting memory pools ===================
Pool ID '20G4NavigationLevelRep', size : 0.0779 MB
Pool ID '20G4NavigationLevelRep', size : 0.0865 MB
Pool ID '24G4ReferenceCountedHandleIvE', size : 0.000961 MB
Pool ID '17G4DynamicParticle', size : 0.0211 MB
Pool ID '17G4DynamicParticle', size : 0.0202 MB
Pool ID '7G4Event', size : 0.000961 MB
Pool ID '15G4PrimaryVertex', size : 0.000961 MB
Pool ID '17G4PrimaryParticle', size : 0.000961 MB
Pool ID '15G4HCofThisEvent', size : 0.000961 MB
Pool ID '7G4Track', size : 0.0413 MB
Pool ID '18G4TouchableHistory', size : 0.00577 MB
Pool ID '7G4Track', size : 0.0404 MB
Pool ID '18G4TouchableHistory', size : 0.00673 MB
Pool ID '15G4CountedObjectIvE', size : 0.000961 MB
Number of memory pools allocated: 10 of which, static: 0
Dynamic pools deleted: 10 / Total memory freed: 0.15 MB
Pool ID '10G4Fragment', size : 0.000961 MB
Pool ID '17G4ReactionProduct', size : 0.000961 MB
Number of memory pools allocated: 12 of which, static: 0
Dynamic pools deleted: 12 / Total memory freed: 0.16 MB
============================================================
G4Allocator objects are deleted.
UImanager deleted.
@@ -23,11 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file runAndEvent/RE03/src/RE03ActionInitialization.cc
/// \file RE03ActionInitialization.cc
/// \brief Implementation of the RE03ActionInitialization class
//
//
//
#include "RE03ActionInitialization.hh"
#include "G4RunManager.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file runAndEvent/RE03/src/RE03DetectorConstruction.cc
/// \file RE03DetectorConstruction.cc
/// \brief Implementation of the RE03DetectorConstruction class
//
//
#include "RE03DetectorConstruction.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file runAndEvent/RE03/src/RE03PrimaryGeneratorAction.cc
/// \file RE03PrimaryGeneratorAction.cc
/// \brief Implementation of the RE03PrimaryGeneratorAction class
//
//
#include "RE03PrimaryGeneratorAction.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file runAndEvent/RE03/src/RE03UserScoreWriter.cc
/// \file RE03UserScoreWriter.cc
/// \brief Implementation of the RE03UserScoreWriter class
//
//
#include "RE03UserScoreWriter.hh"