diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d4ff86a4a..a714957fd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,9 +16,10 @@ endif() #----------------------------------------------------------------------- # - Define CMake requirements and override make rules as needed # -cmake_minimum_required(VERSION 3.8 FATAL_ERROR) - -# - Any policy requirements should go here +cmake_minimum_required(VERSION 3.8...3.18 FATAL_ERROR) +if(${CMAKE_VERSION} VERSION_LESS 3.12) + cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) +endif() # - Make overrides for default flags, so they appear in interfaces set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0c15bf7afd..883c00d901 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,6 +11,6 @@ the development repository of Geant4, to be included in a future release or patch. For simple bug-fixes, it is anyhow recommended to use the official -[Bugzilla problem reporting system](https://bugzilla-geant4.kek.jp). +`Bugzilla problem reporting system `. The Geant4 Collaboration diff --git a/ReleaseNotes/Beta4.10.3-1.txt b/ReleaseNotes/Beta4.10.3-1.txt index 6708c988ae..5d734f9abb 100644 --- a/ReleaseNotes/Beta4.10.3-1.txt +++ b/ReleaseNotes/Beta4.10.3-1.txt @@ -224,8 +224,8 @@ List of features and fixes included in this Beta release since 10.2.p02: hadrons. - G4EmStandardPhysicsGS: set default range factor to 0.1. - DNA and ModelActivator constructors: corrected model/process names; - adjusted high energy threshold of solvation (kill) in respect to the - energy range of the elastic model. + adjusted high energy threshold of solvation (kill) in respect to the + energy range of the elastic model. Added G4DNAElectronSolvation to all DNA constructors. - Updated G4EmDNAPhysics_option5 and G4EmDNAChemistry. - Updated G4EmDNAPhysics_option7 constructor. diff --git a/ReleaseNotes/Beta4.10.7-1.txt b/ReleaseNotes/Beta4.10.7-1.txt index 027681990e..6bea03e120 100644 --- a/ReleaseNotes/Beta4.10.7-1.txt +++ b/ReleaseNotes/Beta4.10.7-1.txt @@ -7,7 +7,7 @@ Migration Notes & Main New Features ----------------------------------- - o Introducing new optional (experimental) tasking system, based on TBL + o Introducing new optional (experimental) tasking system, based on PTL (Parallel Tasking Library), dedicated run manager (G4TaskRunManager) and factory (G4RunManagerFactory), enabling use of tasks for the event loop. The tasking system is fully compatible with Intel TBB, which can be @@ -740,7 +740,7 @@ List of features and fixes included in this Beta release since 10.6.p02: o Tasking ------- + New module implementing a new Geant4 run manager, G4TaskRunManager, - enabling use of the TBL tasking system for the event loop. The tasking + enabling use of the PTL tasking system for the event loop. The tasking system is fully compatible with Intel TBB, which can be selected if GEANT4_USE_TBB=ON is specified when configuring CMake. The default behavior, however, is to submit the tasks to an internal thread-pool diff --git a/ReleaseNotes/Patch4.10.6-3.txt b/ReleaseNotes/Patch4.10.6-3.txt new file mode 100644 index 0000000000..32233ae6ae --- /dev/null +++ b/ReleaseNotes/Patch4.10.6-3.txt @@ -0,0 +1,114 @@ + + Geant4 10.6 - patch-03 Release Notes + ------------------------------------ + + 6 November 2020 + +List of fixes included in this public patch since the public release 10.6.p02: + + o Analysis: + -------- + + Fixed definition of UI commands in G4AnalysisMessenger (for 2D and + 3D histograms). + + Updated to g4tools 5.0.6: + o Changed usage of Google style fonts. + o Fixed compilation warnings on clang-10. + + o Event: + ----- + + Fixed misleading error message in G4SPSPosDistribution. + Addressing problem report #2275. + + o Global: + ------ + + Re-instate static pointer for 'masterG4coutDestination' in + G4coutDestination with proper symbol exporting on Windows + (necessary for MT builds). Restores trapping of G4cout from + workers in Qt GUI. + + Updated date and version for 10.6.p03. + + o Intercoms: + --------- + + Added StoL() method in G4UImessenger for parsing string to long int. + Addressing problem report #2276. + + o Interfaces: + ---------- + + Added fix in G4Qt to properly set GL on Windows (see Forum topic #3144). + + o Persistency - gdml: + ------------------ + + Fixed treatment of loops. Addressing problem report #2273. + + o Processes - Hadronic: + -------------------- + + cross_sections: + o G4CrossSectionElastic, G4CrossSectionInelastic: fix for ions and + anti-ions, where the max energy of applicability of the (elastic and + inelastic) cross-sections must scale with the absolute baryonic number; + however, the cross-sections objects are often shared between the + different types of ions (d, t, He3, alpha, and genericIon), therefore + we scale by a large value (256, safely larger than the number of + nucleons of the heaviest nuclides). + + models/de_excitation: + o G4NuclearLevelData: more safe initialisation of data in MT mode, use + mutex locks only within each method, whithout calls to other methods. + o G4ExcitationHandler: call to G4NuclearLevelData to initialise data for + levels for all elements possibly involved in the geometry. + o G4FermiFragmentsPoolVI: use old interface to nuclear levels. + + models/particle_hp: + o G4ParticleHPInelastic, G4ParticleHPInelasticData: improved error + message in the case that both G4PARTICLEHPDATA and the related + particle-specific environmental variable (e.g. G4PROTONHPDATA) are + not defined. The recommendation is to define only G4PARTICLEHPDATA. + + models/parton_string/diffraction: + o G4FTFModel: quasi-elastic is not applied any longer when the target + nucleus has one nucleon and the projectile hadron is not an ion. This + avoids to double count elastic scattering (as reported by NA61/SHINE + in 158 GeV/c proton interactions on liquid hydrogen). + Addressing problem report #2274. + + models/parton_string/hadronization: + o G4VLongitudinalStringDecay: fix in ProduceOneHadron() method, to remove + an inconsistency in the treatment of low-mass strings with respect to + the method G4QGSMFragmentation::FragmentString(). As consequence of + this inconsistency, interactions with fewer intra-nuclear collisions + were favored, therefore producing fewer secondary hadrons. + o G4QGSMFragmentation : proper exit in the method FragmentString() + when the string mass is below the threshold. + + models/parton_string/qgsm: + o G4BaryonSplitter: removed inexisting in Geant4 excited hyperon states + (Sigma* and Xi*). + + o Run: + --- + + Fix for rndmSaveThisEvent() not properly working in multi-threaded mode. + Addressing problem report #2278. + + Allow setting of seeds with 'long' values for '/random/setSeeds' + UI command. Addresses problem report #2276. + + o Visualization: + ------------- + + Fixed compilation warnings on clang-10 in gMocren and gl2ps. + + o Examples: + -------- + + advanced/brachytherapy + o Added missing call to "/run/initialize" in VisualisationMacro.mac. + + advanced/purging_magnet + + advanced/STCyclotron + o Fixed README. + + ---------------------------------------------------------------------------- + + Technical Notes + --------------- + + o This patch should be applied on top of release 10.6 or 10.6.p01/p02. + o Technical notes distributed for release 10.6 are also applicable and + valid for this patch. + +The code and rebuilt binary libraries for release 10.6.p03 are available +through the Geant4 "Download" Web page. + +Please refer to the Geant4 User Documentation for further information about +using Geant4. diff --git a/ReleaseNotes/ReleaseNotes4.10.0.html b/ReleaseNotes/ReleaseNotes4.10.0.html index 0c86b37270..61113d52d4 100644 --- a/ReleaseNotes/ReleaseNotes4.10.0.html +++ b/ReleaseNotes/ReleaseNotes4.10.0.html @@ -174,7 +174,7 @@ re-compilation) and a re-compilation of user applications is required.
  • The G4Polycone solid no longer supports the case in which either the outer or the inner surface has more than one cone or tube section over a finite interval of Z values. These shapes must use the - new class G4GenericPolycone instead. The general constructor + new class G4GenericPolycone instead. The general constructor of G4Polycone, which uses a series of vertices, includes a check whether the vertices are monotonic along Z for its inner and outer surfaces, and issues an error if not.
  • diff --git a/ReleaseNotes/ReleaseNotes4.10.7.html b/ReleaseNotes/ReleaseNotes4.10.7.html new file mode 100644 index 0000000000..9b138bb542 --- /dev/null +++ b/ReleaseNotes/ReleaseNotes4.10.7.html @@ -0,0 +1,2591 @@ + + +Geant4 10.7 Release Notes + + + +

    +
    +

    + +

    + +Geant4 10.7 Release Notes + + + + +
    + +December 4th, 2020 + +
    + +

    +


    +

    +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

    +
      +
    1. Supported and Tested Platforms
    2. +
    3. Supported CLHEP and VecGeom versions
    4. +
    5. Items for migration of the user code
    6. +
    7. New Developments and Capabilities
    8. +
    9. Expected effects on physics and performance
    10. +
    11. Known Run-Time Problems and Limitations
    12. +
    13. Compilation Warnings
    14. +
    15. Geant4 Software License
    16. +
    17. Detailed list of changes and fixes
    18. +
    + +

    + +
    + + + +

    1. Supported and Tested Platforms

    + +Platforms: + + +More verified and tested configurations (64 bits): + + +

    + +
    + + + +

    2. Supported CLHEP and VecGeom version

    + +This release of Geant4 requires and has been verified with +CLHEP, release 2.4.4.0. +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 +1.1.8 is required when using such configuration. + +

    + +
    + + + +

    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 +

    + + +

    +Geometry, Fields and Transportation +

    + + +

    +Electromagnetic and optical physics +

    + + +

    +Hadronic physics +

    + + +

    +Data Sets +

    + + + +
    + + + +

    4. New Developments and Capabilities

    + +General + + +Analysis + + +Digitization, Hits & Scoring + + +Geometry and Field + + +Materials + + +Electromagnetic physics + + +Hadronic physics + + +Physics Lists + + +Visualization and Interfaces + + +Examples + + + +
    + + + +

    5. Expected effects on physics and computing performance

    + +General + + +Electromagnetic physics + + +Hadronic physics + + +

    + +
    + + + +

    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, particularly +on Windows with Visual Studio, where warnings level has been raised when +building examples. +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 +http://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

    + + + +

    Analysis

    + + + +

    Digitization & Hits

    + + + +

    Electromagnetic Processes

    + + + +

    Error Propagation

    + + + +

    Event

    + + + +

    Externals

    + + + +

    G3toG4

    + + + +

    General Processes

    + + + +

    Geometry

    + + + +

    Global

    + + + +

    Graphical Representations

    + + + +

    Hadronic Processes

    + + + +

    Intercoms

    + + + +

    Interfaces

    + + + +

    Materials

    + + + +

    Parameterisations

    + + + +

    Particles

    + + + +

    Persistency

    + + + +

    Physics lists

    + + + +

    Run

    + + + +

    Tasking

    + + + +

    Track & Tracking

    + + + +

    Visualization

    +
  • Use CMake AUTOMOC to automatically generate and compile Moc sources + and fixed CMake script to support new CMake system.
  • +
  • Fixed text typos in printout. Problem report + #2285 + and GitHub PR#15.
  • + + + +

    Environments

    + + + +

    Data sets

    + + + +

    Examples

    + + +
    + + + diff --git a/cmake/History b/cmake/History index dbbce7757e..567df3ce67 100644 --- a/cmake/History +++ b/cmake/History @@ -30,6 +30,93 @@ add this in the documentation for the changed file as [BUGFIX #BUGNUMBER]. ---------------------------------------------------------- +20th November 2020 - Ben Morgan (cmake-V10-06-46) +- Make GEANT4_USE_SYSTEM_PTL option advanced + +12th November 2020 - Jonathan Madsen (cmake-V10-06-45) +- Updated find package routines for timemory + +19th November 2020 - Ben Morgan (cmake-V10-06-44) +- Require VecGeom 1.1.8 or newer + +18th November 2020 - Ben Morgan (cmake-V10-06-43) +- Add GEANT4_BUILD_BUILTIN_BACKTRACE option to enable automatic + use of G4BackTrace signal handling in G4RunManager. + +17th November 2020 - Gunter Folger (cmake-V10-06-42) +- Bump CLHEP minimum required version to 2.4.4.0 + +4th November 2020 - Ben Morgan (cmake-V10-06-41) +- Make Qt53D driver optional based on find of required Qt5 modules + +2nd/3rd November 2020 - Gunter Folger (cmake-V10-06-40) +- Update to dataset RadioactiveDecay5.6 and PhotonEvaporation5.7 as + provided by Laurent + +30th October 2020 - Gunter Folger (cmake-V10-06-39) +- Update datasets as provided by Laurent: + - G4ENSDFSTATE2.3 + - PhotonEvaporation5.6 + - RadioactiveDecay5.5 + +29th October 2020 - Ben Morgan (cmake-V10-06-38) +- Remove obsolete Geant4MacroDefineModule and G4DeveloperAPI_OLD modules +- Make Geant4MacroLibraryTargets module a no-op pending final removal in + 2021 +- Remove GEANT4_USE_NEW_CMAKE option to complete migration to new system +- Use STRINGS cache property for enum options and CMAKE_BUILD_TYPE to + give easier interface in (G)UIs +- Remove pre CMake3 functionality from G4InstallData module + +27th October 2020 - Gunter Folger (cmake-V10-06-37) +- Add optional TENDL dataset + +26th October 2020 - Ben Morgan (cmake-V10-06-36) +- Explicitly initialize GEANT4_USE_QT3D to OFF to prevent + user override. + +26th October 2020 - Gunter Folger (cmake-V10-06-35) +- Switch to G4PARTICLEXS 3.1 + +23rd October 2020 - John Allison (cmake-V10-06-34) +- Introduce changes for Qt3D vis driver. + +20th October 2020 - Ben Morgan (cmake-V10-06-33) +- Update functions to use G4expat{-static} as custom built targets. + Fixes GitLab Issue #44. + +19th October 2020 - Ben Morgan (cmake-V10-06-32) +- Support CMake 3.8 through 3.18 +- Allow specification of C++20 for CMake 3.12 and above + +12th October 2020 - Daren Sawkey (cmake-V10-06-31) +- Switch to new data set G4RealSurface 2.2 + +12th October 2020 - Gunter Folger (cmake-V10-06-30) +- Switch to G4PARTICLEXS 3.0 + +24th September 2020 - Gunter Folger (cmake-V10-06-29) +- Switch to G4EMLOW 7.13 + +15 September 2020 - Jonathan Madsen (cmake-V10-06-28) +- Updated GEANT4_TEST_ENVIRONMENT to set G4RUN_MANAGER_TYPE=TBB when MT and + GEANT4_USE_TBB=ON + +28 August - Ben Morgan (cmake-V10-06-27) +- Improve support for Inventor (Coin) + - Simplify configuration options, handling co-working ones both + at configure time and by client applications. + - Separate out dependency finding to keep these in one place. + - Improve consistency of using XQuartz vs System OpenGL on + macOS. + - Remove obsolete FindInventor module + +21 July 2020 - Ben Morgan (cmake-V10-06-26) +- Provide new GEANT4_BUILD_PHP_AS_HP option to enable ParticleHP as + HP in G4processes. Replaces PHP_AS_HP environment variable. +- Add PHP_AS_HP "feature" in Geant4Config.cmake/geant4-config to allow + clients to check availability. + 17th June 2020 - Jonathan Madsen (cmake-V10-06-25) - Moved TBB before PTL - Forced PTL_USE_TBB to be set to GEANT4_USE_TBB when not diff --git a/cmake/Modules/FindInventor.cmake b/cmake/Modules/FindInventor.cmake deleted file mode 100644 index 96a8c6d0b2..0000000000 --- a/cmake/Modules/FindInventor.cmake +++ /dev/null @@ -1,260 +0,0 @@ -# - Locate Open Inventor -# -# The file tries to locate Open Inventor compatible library -# and associated libraries (SoXt, SoQt,...). -# -# Currently tested Open Inventor clones: -# - Coin (+SoXt and SoWin coming with Coin) -# - SGI Inventor -# -# Detection algorithms are described through the file. -# -# Author: PCJohn (Jan Peciva, jpeciva@strathmore.edu) -# http://www.cmake.org/pipermail/cmake/2008-August/023446.html -# Modifications by Ben Morgan (Ben.Morgan@warwick.ac.uk) -# -# This module defines: -# INVENTOR_FOUND, if false, do not try to link against Inventor. -# INVENTOR_INCLUDE_DIR, where to find headers. -# INVENTOR_LIBRARY, the library to link against. -# INVENTOR_LIBRARY_DEBUG, the debug library to link against. -# INVENTOR_SOWIN_LIBRARY, the SoWin library - window binding library for Inventor -# INVENTOR_SOWIN_LIBRARY_DEBUG, the SoWin debug library -# -# INVENTOR_SOXT_LIBRARY, the SoXt library - window binding library for Inventor -# INVENTOR_SOXT_LIBRARY_DEBUG, the SoXt debug library -# -# notes: -# - Coin is honored over SGI Inventor -# - Coin is detected by coin-config script, COINDIR environment variable, -# and finally standard system locations are searched -# - SGI Inventor is searched at standard system locations only -# - -# coin-config is used (if present) to find a prefix -execute_process (COMMAND coin-config --prefix - OUTPUT_VARIABLE COIN_PREFIX - OUTPUT_STRIP_TRAILING_WHITESPACE) - -# try to find Inventor includes (priority paths from coin-config and COINDIR) -FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h - ${COIN_PREFIX}/include - $ENV{COINDIR}/include - NO_DEFAULT_PATH -) - -# try to find Inventor includes (system paths) -FIND_PATH(INVENTOR_INCLUDE_DIR Inventor/So.h - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include -) - -# default Inventor lib search paths -SET(INVENTOR_LIB_SEARCH_PATH - /usr/local/lib - /usr/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib -) - -# try to find Coin release lib (priority paths) -FIND_LIBRARY(INVENTOR_LIBRARY - NAMES coin5 coin4 coin3 coin2 coin1 Coin - PATHS ${COIN_PREFIX}/lib - $ENV{COINDIR}/lib - NO_DEFAULT_PATH -) - -# try to find Coin release lib (regular paths) -FIND_LIBRARY(INVENTOR_LIBRARY - NAMES coin5 coin4 coin3 coin2 coin1 Coin - PATHS ${INVENTOR_LIB_SEARCH_PATH} -) - -# try to find SGI Inventor lib -FIND_LIBRARY(INVENTOR_LIBRARY - NAMES Inventor - PATHS ${INVENTOR_LIB_SEARCH_PATH} -) - -# try to find Coin debug lib (priority paths) -#FIND_LIBRARY(INVENTOR_LIBRARY_DEBUG -# NAMES coin5d coin4d coin3d coin2d coin1d -# PATHS ${COIN_PREFIX}/lib -# $ENV{COINDIR}/lib -# NO_DEFAULT_PATH -#) - -# try to find Coin debug lib (regular paths) -#FIND_LIBRARY(INVENTOR_LIBRARY_DEBUG -# NAMES coin5d coin4d coin3d coin2d coin1d -# PATHS ${INVENTOR_LIB_SEARCH_PATH} -#) - -# set release to debug if only debug found -#IF(NOT INVENTOR_LIBRARY_RELEASE AND INVENTOR_LIBRARY_DEBUG) -# SET(INVENTOR_LIBRARY_RELEASE ${INVENTOR_LIBRARY_DEBUG}) -#ENDIF(NOT INVENTOR_LIBRARY_RELEASE AND INVENTOR_LIBRARY_DEBUG) - -# set debug to release (if only release found) -#IF(NOT INVENTOR_LIBRARY_DEBUG AND INVENTOR_LIBRARY_RELEASE) -# SET(INVENTOR_LIBRARY_DEBUG ${INVENTOR_LIBRARY_RELEASE}) -#ENDIF(NOT INVENTOR_LIBRARY_DEBUG AND INVENTOR_LIBRARY_RELEASE) - -# INVENTOR_LIBRARY -#IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) -# SET(INVENTOR_LIBRARY -# optimized ${INVENTOR_LIBRARY_RELEASE} -# debug ${INVENTOR_LIBRARY_RELEASE}) -#ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) -# SET(INVENTOR_LIBRARY -# ${INVENTOR_LIBRARY_RELEASE}) -#ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - -# set INVENTOR_FOUND appropriately -SET(INVENTOR_FOUND "NO") -IF(INVENTOR_INCLUDE_DIR AND INVENTOR_LIBRARY) - SET(INVENTOR_FOUND "YES") -ENDIF(INVENTOR_INCLUDE_DIR AND INVENTOR_LIBRARY) - - -if(WIN32 AND NOT CYGWIN) - # - # SoWin - # - # notes: SoWin is searched by COINDIR environment variable - # (as expected to be located at Windows platform) - - # try to find SoWin lib (priority paths) - FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY - NAMES sowin1 - PATHS $ENV{COINDIR}/lib - NO_DEFAULT_PATH - ) - - # try to find SoWin lib (regular paths) - FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY - NAMES sowin1 - PATHS ${INVENTOR_LIB_SEARCH_PATH} - ) - - # try to find SoWin debug lib (priority paths) - FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY_DEBUG - NAMES sowin1d - PATHS $ENV{COINDIR}/lib - NO_DEFAULT_PATH - ) - - # try to find SoWin debug lib (regular paths) - FIND_LIBRARY(INVENTOR_SOWIN_LIBRARY_DEBUG - NAMES sowin1d - PATHS ${INVENTOR_LIB_SEARCH_PATH} - ) - - # SoWin debug library defaults to non-debug lib - IF(NOT INVENTOR_SOWIN_LIBRARY_DEBUG) - IF(INVENTOR_SOWIN_LIBRARY) - SET(INVENTOR_SOWIN_LIBRARY_DEBUG INVENTOR_SOWIN_LIBRARY) - ENDIF(INVENTOR_SOWIN_LIBRARY) - ENDIF(NOT INVENTOR_SOWIN_LIBRARY_DEBUG) -endif() - - - -if(UNIX) - # - # SoXt - # - # notes: - # - SoXt is detected by soxt-config script (as expected by - # Coin's SoXt on Linux/Unix) and on standard system locations - # - SGI's InventorXt support is missing now - # - - # soxt-config tells much of SoXt instalation (if present) - execute_process (COMMAND soxt-config --prefix - OUTPUT_VARIABLE SOXT_PREFIX - OUTPUT_STRIP_TRAILING_WHITESPACE) - - # try to find Inventor includes (priority paths from coin-config and COINDIR) - FIND_PATH(INVENTOR_SOXT_INCLUDE_DIR Inventor/Xt/SoXt.h - ${SOXT_PREFIX}/include - $ENV{COINDIR}/include - NO_DEFAULT_PATH - ) - - # try to find Inventor includes (system paths) - FIND_PATH(INVENTOR_SOXT_INCLUDE_DIR Inventor/Xt/SoXt.h - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - ) - - # try to find SoXt lib (priority paths) - FIND_LIBRARY(INVENTOR_SOXT_LIBRARY - NAMES soxt1 SoXt - PATHS ${SOXT_PREFIX}/lib - $ENV{COINDIR}/lib - NO_DEFAULT_PATH - ) - - # try to find SoXt lib (regular paths) - FIND_LIBRARY(INVENTOR_SOXT_LIBRARY - NAMES soxt1 SoXt - PATHS ${INVENTOR_LIB_SEARCH_PATH} - ) - - # - # SoQt - # - # notes: - # - SoQt is detected by soqt-config script (as expected by - # Coin's SoQt on Linux/Unix) and on standard system locations - # - - # soqt-config tells much of SoQt installation (if present) - execute_process (COMMAND soqt-config --prefix - OUTPUT_VARIABLE SOQT_PREFIX - OUTPUT_STRIP_TRAILING_WHITESPACE) - - # try to find Inventor includes (priority paths from coin-config and COINDIR) - FIND_PATH(INVENTOR_SOQT_INCLUDE_DIR Inventor/Qt/SoQt.h - ${SOQT_PREFIX}/include - $ENV{COINDIR}/include - NO_DEFAULT_PATH - ) - - # try to find Inventor includes (system paths) - FIND_PATH(INVENTOR_SOQT_INCLUDE_DIR Inventor/Qt/SoQt.h - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - ) - - # try to find SoQt lib (priority paths) - FIND_LIBRARY(INVENTOR_SOQT_LIBRARY - NAMES soqt1 SoQt - PATHS ${SOQT_PREFIX}/lib - $ENV{COINDIR}/lib - NO_DEFAULT_PATH - ) - - # try to find SoQt lib (regular paths) - FIND_LIBRARY(INVENTOR_SOQT_LIBRARY - NAMES soqt1 SoQt - PATHS ${INVENTOR_LIB_SEARCH_PATH} - ) - -endif() diff --git a/cmake/Modules/FindXQuartzGL.cmake b/cmake/Modules/FindXQuartzGL.cmake index d30e40d350..c26754a611 100644 --- a/cmake/Modules/FindXQuartzGL.cmake +++ b/cmake/Modules/FindXQuartzGL.cmake @@ -41,7 +41,7 @@ The following cache variables may also be set # Just don't run if we're on macOS if(NOT APPLE) - message(FATAL_ERROR "FindXquartzGL is only for use on macOS platforms") + message(FATAL_ERROR "FindXQuartzGL is only for use on macOS platforms") endif() # - This is for X11 GL drivers, so we DON'T want Framework! @@ -79,7 +79,7 @@ mark_as_advanced(XQuartzGL_INCLUDE_DIR XQuartzGL_gl_LIBRARY XQuartzGL_glu_LIBRAR if(XQuartzGL_FOUND) if(NOT TARGET XQuartzGL::GL) add_library(XQuartzGL::GL UNKNOWN IMPORTED) - set_target_properties(XQuartzGL::GL PROPERTIES + set_target_properties(XQuartzGL::GL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${XQuartzGL_INCLUDE_DIR}" IMPORTED_LOCATION "${XQuartzGL_gl_LIBRARY}" ) @@ -87,7 +87,7 @@ if(XQuartzGL_FOUND) if(NOT TARGET XQuartzGL::GLU AND XQuartzGL_glu_LIBRARY) add_library(XQuartzGL::GLU UNKNOWN IMPORTED) - set_target_properties(XQuartzGL::GLU PROPERTIES + set_target_properties(XQuartzGL::GLU PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${XQuartzGL_INCLUDE_DIR}" INTERFACE_LINK_LIBRARIES XQuartzGL::GL IMPORTED_LOCATION "${XQuartzGL_glu_LIBRARY}" diff --git a/cmake/Modules/G4BuildSettings.cmake b/cmake/Modules/G4BuildSettings.cmake index a4348bbb72..a4a67ff15e 100644 --- a/cmake/Modules/G4BuildSettings.cmake +++ b/cmake/Modules/G4BuildSettings.cmake @@ -117,6 +117,7 @@ mark_as_advanced(CMAKE_CXX_FLAGS_MAINTAINER) # if(NOT CMAKE_CONFIGURATION_TYPES) # Single mode build tools like Make, Ninja, + set(__g4buildmodes "" Release TestRelease MinSizeRel Debug Debug_FPE RelWithDebInfo MinSizeRel Maintainer) if(NOT CMAKE_BUILD_TYPE) # Default to a Release build if nothing else... set(CMAKE_BUILD_TYPE Release @@ -130,6 +131,7 @@ if(NOT CMAKE_CONFIGURATION_TYPES) FORCE ) endif() + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${__g4buildmodes}) else() # Multimode tools like VS, Xcode list(APPEND CMAKE_CONFIGURATION_TYPES Debug_FPE) @@ -154,14 +156,19 @@ endif() #NOT WIN32 # #.rst -# - ``GEANT4_BUILD_CXXSTD`` (Allowed values: 11, 14, 17, c++11, c++14, c++17) +# - ``GEANT4_BUILD_CXXSTD`` (Allowed values: 11, 14, 17, 20) # # - Choose C++ Standard to build against from supported list. # - Note that only C++17 is supported on Windows with MSVC +# - C++20 awareness is only available from CMake 3.12 onwards # -set(__g4_default_cxxstd 11 14 17 c++11 c++14 c++17) +set(__g4_default_cxxstd 11 14 17) if(MSVC) - set(__g4_default_cxxstd 17 c++17) + set(__g4_default_cxxstd 17) +endif() + +if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) + list(APPEND __g4_default_cxxstd 20) endif() enum_option(GEANT4_BUILD_CXXSTD @@ -175,7 +182,9 @@ mark_as_advanced(GEANT4_BUILD_CXXSTD) geant4_add_feature(GEANT4_BUILD_CXXSTD "Compiling against C++ Standard '${GEANT4_BUILD_CXXSTD}'") -# Require at least C++11 with no extensions and the following features +# Require at minimal set of C++11 features plus user's selection of standard, no extensions +# Explicit features are retained for C++11 to identify use of old compilers with partial support. +# Here, the `cxx_std_11` epoch feature might not be sufficient. set(CMAKE_CXX_EXTENSIONS OFF) set(GEANT4_TARGET_COMPILE_FEATURES cxx_alias_templates @@ -190,36 +199,25 @@ set(GEANT4_TARGET_COMPILE_FEATURES cxx_range_for cxx_strong_enums cxx_uniform_initialization - # Features that MSVC 18.0 cannot support but in list of Geant4 coding - # guidelines - to be required once support for that compiler is dropped. - # Version 10.2 is coded without these being required. - #cxx_deleted_functions - #cxx_generalized_initializers - #cxx_constexpr - #cxx_inheriting_constructors - ) + cxx_std_${GEANT4_BUILD_CXXSTD}) -# If a standard higher than 11 has been selected, check that compiler has -# at least one feature from that standard and append these to the required -# feature list -if(GEANT4_BUILD_CXXSTD GREATER 11) - if(CMAKE_CXX${GEANT4_BUILD_CXXSTD}_COMPILE_FEATURES) - list(APPEND GEANT4_TARGET_COMPILE_FEATURES ${CMAKE_CXX${GEANT4_BUILD_CXXSTD}_COMPILE_FEATURES}) - else() - message(FATAL_ERROR "Geant4 requested to be compiled against C++ standard '${GEANT4_BUILD_CXXSTD}'\nbut detected compiler '${CMAKE_CXX_COMPILER_ID}', version '${CMAKE_CXX_COMPILER_VERSION}'\ndoes not support, or CMake (${CMAKE_VERSION}) is not aware of, any features of that standard.") - endif() +# Emit early fatal error if we don't have a record of the core standard +# in CMake's known features. CMake will check this for us as well, but doing +# the check here only emits one error. We can also give a better hint on the +# cause/resolution +if(NOT ("${CMAKE_CXX_COMPILE_FEATURES}" MATCHES "cxx_std_${GEANT4_BUILD_CXXSTD}")) + message(FATAL_ERROR + "Geant4 requested compilation using C++ standard '${GEANT4_BUILD_CXXSTD}' using compiler\n" + "'${CMAKE_CXX_COMPILER_ID}', version '${CMAKE_CXX_COMPILER_VERSION}'\n" + "but CMake ${CMAKE_VERSION} is not aware of any support for that standard by this compiler. You may need a newer CMake and/or compiler.\n") endif() # - Check for Standard Library Implementation Features -# Smart pointers are a library implementation feature -# Hashed containers are a library implementation feature -# Random numbers are a library implementation feature? -# An example of where a workaround is needed -# Rest of concurrency a library implementation feature +# e.g. Smart pointers are a library implementation feature +# and provide workarounds if needed # Hold any appropriate compile flag(s) in variable for later export to -# config files. Needed to support clients using late CMake 2.8 where compile features -# are not available. +# non-cmake config files set(GEANT4_CXXSTD_FLAGS "${CMAKE_CXX${GEANT4_BUILD_CXXSTD}_STANDARD_COMPILE_OPTION}") #----------------------------------------------------------------------- @@ -276,6 +274,27 @@ if(GEANT4_BUILD_MULTITHREADED) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GEANT4_MULTITHREADED_CXX_FLAGS}") endif() +#----------------------------------------------------------------------- +# Physics +#----------------------------------------------------------------------- +#.rst: +# - ``GEANT4_BUILD_PHP_AS_HP`` (Default: OFF, ON if ``PHP_AS_HP`` set in environment) +# +# - Build ParticleHP as HP. +# - Use of the ``PHP_AS_HP`` environment variable to enable this build +# option is deprecated and will be removed in the next release +# +set(_default_build_php_as_hp OFF) +if(DEFINED ENV{PHP_AS_HP}) + message(WARNING "Use of the PHP_AS_HP environment variable to enable building ParticleHP as HP is deprecated. " + "Use the GEANT4_BUILD_PHP_AS_HP CMake option to enable this functionality.") + set(_default_build_php_as_hp ON) +endif() + +option(GEANT4_BUILD_PHP_AS_HP "Build ParticleHP as HP" ${_default_build_php_as_hp}) +mark_as_advanced(GEANT4_BUILD_PHP_AS_HP) +geant4_add_feature(GEANT4_BUILD_PHP_AS_HP "Building ParticleHP as HP") + #----------------------------------------------------------------------- # Miscellaneous #----------------------------------------------------------------------- @@ -303,6 +322,20 @@ option(GEANT4_BUILD_VERBOSE_CODE ON) mark_as_advanced(GEANT4_BUILD_VERBOSE_CODE) +#.rst: +# - ``GEANT4_BUILD_BUILTIN_BACKTRACE`` (Unix only, Default: OFF) +# +# - Setting to ``ON`` will build in automatic signal handling for ``G4RunManager`` +# through ``G4Backtrace``. Applications requiring/implenting their own signal +# handling should not enable this option. +# +if(UNIX) + option(GEANT4_BUILD_BUILTIN_BACKTRACE + "Enable automatic G4Backtrace signal handling in G4RunManager. Switch off for applications implementing their own signal handling" + OFF) + mark_as_advanced(GEANT4_BUILD_BUILTIN_BACKTRACE) +endif() + #.rst: # - ``GEANT4_BUILD_MSVC_MP`` (Windows only, Default: OFF) # diff --git a/cmake/Modules/G4CMakeMain.cmake b/cmake/Modules/G4CMakeMain.cmake index a700137de3..0aa2afd610 100644 --- a/cmake/Modules/G4CMakeMain.cmake +++ b/cmake/Modules/G4CMakeMain.cmake @@ -79,7 +79,7 @@ option(GEANT4_USE_PYTHON "Build Python bindings for Geant4" OFF) if(GEANT4_USE_PYTHON) # We can only build g4py with MT geant4 if TLS is global-dynamic (or auto?) if(GEANT4_BUILD_MULTITHREADED AND (NOT GEANT4_BUILD_TLS_MODEL MATCHES "global-dynamic")) - message(FATAL_ERROR "Geant4Py only supports 'global-dynamic' thread local storage + message(FATAL_ERROR "Geant4Py only supports 'global-dynamic' thread local storage, but '${GEANT4_BUILD_TLS_MODEL}' selected by GEANT4_BUILD_TLS_MODEL option ") endif() diff --git a/cmake/Modules/G4CMakeUtilities.cmake b/cmake/Modules/G4CMakeUtilities.cmake index 4e5023827d..511c4d9991 100644 --- a/cmake/Modules/G4CMakeUtilities.cmake +++ b/cmake/Modules/G4CMakeUtilities.cmake @@ -42,7 +42,6 @@ endif() # # This module includes the following modules: include(CMakeDependentOption) -include(Geant4MacroDefineModule) include(Geant4MacroLibraryTargets) #----------------------------------------------------------------------- @@ -118,6 +117,7 @@ function(enum_option _var) endif() endif() endif() + set_property(CACHE ${_var} PROPERTY STRINGS ${_ENUMOP_VALUES}) endfunction() #----------------------------------------------------------------------- diff --git a/cmake/Modules/G4CTest.cmake b/cmake/Modules/G4CTest.cmake index 93c25b8b32..d530fecd55 100644 --- a/cmake/Modules/G4CTest.cmake +++ b/cmake/Modules/G4CTest.cmake @@ -41,6 +41,12 @@ if(GEANT4_ENABLE_TESTING) if(GEANT4_USE_FREETYPE) list(APPEND GEANT4_TEST_ENVIRONMENT TOOLS_FONT_PATH=${PROJECT_SOURCE_DIR}/source/analysis/fonts) endif() + + # - Configure 'G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default)' + # to use TBB + if(GEANT4_BUILD_MULTITHREADED AND GEANT4_USE_TBB) + list(APPEND GEANT4_TEST_ENVIRONMENT G4RUN_MANAGER_TYPE=TBB) + endif() endif() #----------------------------------------------------------------------- diff --git a/cmake/Modules/G4ConfigurePkgConfigHelpers.cmake b/cmake/Modules/G4ConfigurePkgConfigHelpers.cmake index d3d846c078..3d6abd771a 100644 --- a/cmake/Modules/G4ConfigurePkgConfigHelpers.cmake +++ b/cmake/Modules/G4ConfigurePkgConfigHelpers.cmake @@ -123,6 +123,13 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX) set(G4_BUILTWITH_MULTITHREADING "no") endif() + # - PHP_AS_HP + if(GEANT4_BUILD_PHP_AS_HP) + set(G4_BUILTWITH_PHP_AS_HP "yes") + else() + set(G4_BUILTWITH_PHP_AS_HP "no") + endif() + # - Smart Stack if(GEANT4_USE_SMARTSTACK) set(G4_BUILTWITH_SMARTSTACK "yes") @@ -222,7 +229,7 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX) set(G4_BUILTWITH_FREETYPE "no") endif() - # - Freetype + # - HDF5 if(GEANT4_USE_HDF5) set(G4_BUILTWITH_HDF5 "yes") else() @@ -232,7 +239,7 @@ if(NOT GEANT4_BUILD_GRANULAR_LIBS AND UNIX) # - Qt if(GEANT4_USE_QT) set(G4_BUILTWITH_QT "yes") - set(G4_QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS}) + set(G4_QT_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS} ${Qt53DCore_INCLUDE_DIRS} ${Qt53DExtras_INCLUDE_DIRS} ${Qt53DRender_INCLUDE_DIRS}) list(REMOVE_DUPLICATES G4_QT_INCLUDE_DIRS) if(_cxx_compiler_dirs) diff --git a/cmake/Modules/G4DatasetDefinitions.cmake b/cmake/Modules/G4DatasetDefinitions.cmake index 6b7f1e34c7..aa9c7486ba 100644 --- a/cmake/Modules/G4DatasetDefinitions.cmake +++ b/cmake/Modules/G4DatasetDefinitions.cmake @@ -18,41 +18,41 @@ geant4_add_dataset( # - Low energy electromagnetics geant4_add_dataset( NAME G4EMLOW - VERSION 7.12 + VERSION 7.13 FILENAME G4EMLOW EXTENSION tar.gz ENVVAR G4LEDATA - MD5SUM 0d3d46eeb7420f2b996242fec756ee52 + MD5SUM 55922521aa331655a0494cdf8f9a70e8 ) # - Photon evaporation geant4_add_dataset( NAME PhotonEvaporation - VERSION 5.5 + VERSION 5.7 FILENAME G4PhotonEvaporation EXTENSION tar.gz ENVVAR G4LEVELGAMMADATA - MD5SUM 707514c864414089af9671db0f656e35 + MD5SUM 81ff27deb23af4aa225423e6b3a06b39 ) # - Radioisotopes geant4_add_dataset( NAME RadioactiveDecay - VERSION 5.4 + VERSION 5.6 FILENAME G4RadioactiveDecay EXTENSION tar.gz ENVVAR G4RADIOACTIVEDATA - MD5SUM 08abe2bcc0bcd1ac4bbe09f5ae69cdbe + MD5SUM acc1dbeb87b6b708b2874ced729a3a8f ) # - Particle XS - replaces Neutron XS geant4_add_dataset( NAME G4PARTICLEXS - VERSION 2.1 + VERSION 3.1 FILENAME G4PARTICLEXS EXTENSION tar.gz ENVVAR G4PARTICLEXSDATA - MD5SUM 24a68bb627a95629e2edcd098131d6b3 + MD5SUM 35a3fe5cf0a29d453e6805e2cfacacee ) # - PII @@ -68,11 +68,11 @@ geant4_add_dataset( # - Optical Surfaces geant4_add_dataset( NAME RealSurface - VERSION 2.1.1 + VERSION 2.2 FILENAME G4RealSurface EXTENSION tar.gz ENVVAR G4REALSURFACEDATA - MD5SUM 1d0fcc24c7082edae1e22a3d43fbb4d9 + MD5SUM ea8f1cfa8d8aafd64b71fb30b3e8a6d9 ) # - SAID @@ -109,10 +109,26 @@ geant4_add_dataset( # - ENSDFSTATE geant4_add_dataset( NAME G4ENSDFSTATE - VERSION 2.2 + VERSION 2.3 FILENAME G4ENSDFSTATE EXTENSION tar.gz ENVVAR G4ENSDFSTATEDATA - MD5SUM 495439cf600225753d7bd99825e5c6bc + MD5SUM 6f18fce8f217e7aaeaa3711be9b2c7bf + ) + +# - TENDL +option(GEANT4_INSTALL_DATASETS_TENDL "Install optional TENDL dataset" OFF) +mark_as_advanced(GEANT4_INSTALL_DATASETS_TENDL) + +if(GEANT4_INSTALL_DATASETS_TENDL) + geant4_add_dataset( + NAME G4TENDL + VERSION 1.4 + FILENAME G4TENDL + EXTENSION tar.gz + ENVVAR G4PARTICLEHPDATA + MD5SUM ecdad2f8234c10caecaac82ac0cb96f8 ) +endif() + diff --git a/cmake/Modules/G4DeveloperAPI.cmake b/cmake/Modules/G4DeveloperAPI.cmake index f75a52e4cd..03cf2ce80e 100644 --- a/cmake/Modules/G4DeveloperAPI.cmake +++ b/cmake/Modules/G4DeveloperAPI.cmake @@ -41,15 +41,6 @@ else() return() endif() -# Whilst we test, allow switching between old and new implementations -option(GEANT4_USE_NEW_CMAKE "Use new CMake module/library implementation" ON) -mark_as_advanced(GEANT4_USE_NEW_CMAKE) - -if(NOT GEANT4_USE_NEW_CMAKE) - include(G4DeveloperAPI_OLD) - return() -endif() - # Needed modules include(G4ClangFormat) @@ -499,12 +490,12 @@ function(geant4_compose_targets) endif() endforeach() - # Process all defined libraries, except for G4clhep{-static} - # G4clhep/G4ptl are a corner cases because its call to add_library happens + # Process all defined libraries, except for G4{clhep,expat,ptl}{-static} + # These are corner cases because its call to add_library happens # at a different (lower) directory level than all the other targets # This means we cannot install it here. That's left to it get_property(__g4definedlibraries GLOBAL PROPERTY GEANT4_DEFINED_CATEGORIES) - list(REMOVE_ITEM __g4definedlibraries G4clhep G4clhep-static G4ptl G4ptl-static) + list(REMOVE_ITEM __g4definedlibraries G4clhep G4clhep-static G4expat G4expat-static G4ptl G4ptl-static) set(__g4builtlibraries) set(__g4public_headers) @@ -670,8 +661,8 @@ endfunction() # GEANT4_LINK_LIBRARIES lib1 [lib2 ...] # LINK_LIBRARIES lib1 [lib2 ...]) # -# DEPRECATED: Maintained only for building internal G4clhep target because of its -# different include structure. +# Maintained for building internal G4clhep,G4expat targets because we try and +# reuse their upstream code/build layout as far as possible # function(geant4_library_target) cmake_parse_arguments(G4GLOBLIB @@ -681,7 +672,7 @@ function(geant4_library_target) ${ARGN} ) # Currently a hack to get G4clhep to build, so an error if used elsewhere - if(NOT (${G4GLOBLIB_NAME} STREQUAL "G4clhep")) + if(NOT (${G4GLOBLIB_NAME} MATCHES "G4clhep|G4expat")) message(FATAL_ERROR "geant4_library_target called for '${G4GLOBLIB_NAME}' in '${CMAKE_CURRENT_LIST_DIR}'") endif() @@ -856,8 +847,8 @@ endfunction() # This is used internally by the ``geant4_compose_targets`` command. # function(__geant4_add_library _name _type) - # TEMP HACK: G4clhep/G4ptl are a special cases, and build is handled separately - if(_name MATCHES "G4clhep|G4ptl") + # TEMP HACK: G4clhep/G4expat/G4ptl are a special cases, and build is handled separately + if(_name MATCHES "G4clhep|G4expat|G4ptl") return() endif() diff --git a/cmake/Modules/G4DeveloperAPI_OLD.cmake b/cmake/Modules/G4DeveloperAPI_OLD.cmake deleted file mode 100644 index 8e93cb8e94..0000000000 --- a/cmake/Modules/G4DeveloperAPI_OLD.cmake +++ /dev/null @@ -1,453 +0,0 @@ -#.rst: -# G4DeveloperAPI_OLD -# ------------------ -# -# Old style API for declaring Geant4 source code modules and -# compiling, linking and installing binary libraries composed -# from one or more source code modules. -# - -#----------------------------------------------------------------- -# License and Disclaimer -# -# The Geant4 software is copyright of the Copyright Holders of -# the Geant4 Collaboration. It is provided under the terms and -# conditions of the Geant4 Software License, included in the file -# LICENSE and available at http://cern.ch/geant4/license . These -# include a list of copyright holders. -# -# Neither the authors of this software system, nor their employing -# institutes,nor the agencies providing financial support for this -# work make any representation or warranty, express or implied, -# regarding this software system or assume any liability for its -# use. Please see the license in the file LICENSE and URL above -# for the full disclaimer and the limitation of liability. -# -# This code implementation is the result of the scientific and -# technical work of the GEANT4 collaboration. -# By using, copying, modifying or distributing the software (or -# any work based on the software) you agree to acknowledge its -# use in resulting scientific publications, and indicate your -# acceptance of all terms of the Geant4 Software license. -# -#----------------------------------------------------------------- - - -# - Include guard -if(NOT __G4DEVELOPERAPI_OLD_INCLUDED) - set(__G4DEVELOPERAPI_OLD_INCLUDED 1) -else() - return() -endif() - -# - Needed CMake modules -include(CMakeParseArguments) -include(G4ClangFormat) - -#----------------------------------------------------------------------- -#.rst: -# Source Code Module Declaration Functions -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# -# Geant4's source code is organised into categories composed of one or -# more "modules" of source code. Each module has the following layout -# of headers and sources: -# -# - include/ -# - Public headers -# - src/ -# - Implementations -# -# The functions here declare a module ready for it to be integrated -# by the library build functions described below. - -#----------------------------------------------------------------------- -# macro geant4_define_module(NAME -# HEADERS ... -# SOURCES ... -# GRANULAR_DEPENDENCIES ... -# GLOBAL_DEPENDENCIES ... -# LINK_LIBRARIES ... ) -# Define a Geant4 Module's sources and what internal and external -# libraries it links to. -# -# GEANT4_DEFINE_MODULE will take the name of the module, a list of header -# files, a list of source files and dependencies: -# -# GEANT4_DEFINE_MODULE(NAME name -# HEADERS hdr1 hdr2 ... -# SOURCES src1 src2 ... -# GRANULAR_DEPENDENCIES dep1 dep2 ... -# GLOBAL_DEPENDENCIES dep1 dep2 ... -# LINK_LIBRARIES lib1 lib2 ...) -# -# It assumes that it will be called from a CMake located in the module -# root directory (i.e. the directory containing the include and src -# subdirectories). It uses this location to define absolute paths to the -# headers and sources, and will ignore any absolute paths passed in HEADERS -# or SOURCES so that generated files can be passed in. -# -# The macro defines the variables -# -# G4MODULENAME = name -# ${G4MODULENAME}_HEADERS = List of absolute paths to files given in HEADERS -# ${G4MODULENAME}_SOURCES = List of absolute paths to files given in SOURCES -# ${G4MODULENAME}_GRANULAR_DEPS = List of granular libraries on which this -# module depends -# ${G4MODULENAME}_GLOBAL_DEPS = List of global libraries on which this module -# depends -# ${G4MODULENAME}_LINK_LIBRARIES = List of external libraries to be linked to -# this module -# -# It will also add the module include directory to the list of directories -# using include_directories -# -macro(geant4_define_module) - set(multiargs - HEADERS SOURCES GRANULAR_DEPENDENCIES GLOBAL_DEPENDENCIES LINK_LIBRARIES - HEADERS_EXCLUDE_FORMAT SOURCES_EXCLUDE_FORMAT) - cmake_parse_arguments(G4DEFMOD - "" - "NAME" - "${multiargs}" - ${ARGN} - ) - - set(G4MODULENAME ${G4DEFMOD_NAME}) - - get_filename_component(${G4MODULENAME}_BASEDIR ${CMAKE_CURRENT_LIST_FILE} PATH) - set(${G4MODULENAME}_SRCDIR ${${G4MODULENAME}_BASEDIR}/src) - set(${G4MODULENAME}_INCDIR ${${G4MODULENAME}_BASEDIR}/include) - - # We now create absolute paths to the headers and sources, - # ignoring any already absolute paths - foreach(_HDR ${G4DEFMOD_HEADERS}) - if(IS_ABSOLUTE ${_HDR}) - list(APPEND ${G4MODULENAME}_HEADERS ${_HDR}) - else() - list(APPEND ${G4MODULENAME}_HEADERS ${${G4MODULENAME}_INCDIR}/${_HDR}) - endif() - endforeach() - - foreach(_SRC ${G4DEFMOD_SOURCES}) - if(IS_ABSOLUTE ${_SRC}) - list(APPEND ${G4MODULENAME}_SOURCES ${_SRC}) - else() - list(APPEND ${G4MODULENAME}_SOURCES ${${G4MODULENAME}_SRCDIR}/${_SRC}) - endif() - endforeach() - - exclude_from_format( - HEADERS ${G4DEFMOD_HEADERS_EXCLUDE_FORMAT} - SOURCES ${G4DEFMOD_SOURCES_EXCLUDE_FORMAT}) - - foreach(_LIB ${G4DEFMOD_GRANULAR_DEPENDENCIES}) - list(APPEND ${G4MODULENAME}_GRANULAR_DEPENDENCIES ${_LIB}) - endforeach() - - foreach(_LIB ${G4DEFMOD_GLOBAL_DEPENDENCIES}) - list(APPEND ${G4MODULENAME}_GLOBAL_DEPENDENCIES ${_LIB}) - endforeach() - - foreach(_LIB ${G4DEFMOD_LINK_LIBRARIES}) - list(APPEND ${G4MODULENAME}_LINK_LIBRARIES ${_LIB}) - endforeach() -endmacro() - - -#----------------------------------------------------------------------- -# macro geant4_add_compile_definitions(SOURCES ... -# COMPILE_DEFINITIONS ... -# ) -# Add extra compile definitions to a specific list of sources -# in the current module. Macroized to handle the need to specify absolute paths. -# and *must* be called at the same level as geant4_define_module -# -macro(geant4_add_compile_definitions) - cmake_parse_arguments(G4ADDDEF - "" - "" - "SOURCES;COMPILE_DEFINITIONS" - ${ARGN} - ) - - # We assume that the sources have been added at the level of a - # a sources.cmake, so are inside the src subdir of the sources.cmake - get_filename_component(_ACD_BASE_PATH ${CMAKE_CURRENT_LIST_FILE} PATH) - - # Now for each file, add the definitions - foreach(_acd_source ${G4ADDDEF_SOURCES}) - # Extract any existing compile definitions - get_source_file_property( - _acd_existing_properties - ${_ACD_BASE_PATH}/src/${_acd_source} - COMPILE_DEFINITIONS) - - if(_acd_existing_properties) - set(_acd_new_defs ${_acd_existing_properties} - ${G4ADDDEF_COMPILE_DEFINITIONS}) - else() - set(_acd_new_defs ${G4ADDDEF_COMPILE_DEFINITIONS}) - endif() - - # quote compile defs because this must epand to space separated list - set_source_files_properties(${_ACD_BASE_PATH}/src/${_acd_source} - PROPERTIES COMPILE_DEFINITIONS "${_acd_new_defs}") - endforeach() -endmacro() - - -#----------------------------------------------------------------------- -#.rst: -# Library Declaration, Build and Install API -# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -# -# - Define useful macros for building and installing Geant4 library targets -# -# This file defines the following macros for Geant4 developers needing to -# add shared and static library targets. -# -# GEANT4_LIBRARY_TARGET - define standard Geant4 library targets -# -# The macro will take the name of the library and its sources, defining -# static and shared targets depending on the value of BUILD_SHARED_LIBS and -# BUILD_STATIC_LIBS. Install targets are also created. -# -# A custom compile definition "GEANT4_DEVELOPER_" is set on -# each target using the target property COMPILE_DEFINITIONS_ -# target property - - -#----------------------------------------------------------------------- - -#----------------------------------------------------------------------- -# - GEANT4_LIBRARY_TARGET -# General build and install of a Geant4 library target -# -macro(geant4_library_target) - cmake_parse_arguments(G4LIBTARGET - "" - "NAME" "SOURCES;GEANT4_LINK_LIBRARIES;LINK_LIBRARIES" - ${ARGN} - ) - - geant4_format_target(NAME ${G4LIBTARGET_NAME}-format SOURCES ${G4LIBTARGET_SOURCES}) - - if(BUILD_SHARED_LIBS) - # Add the shared library target and link its dependencies - # - Common shared lib commands - add_library(${G4LIBTARGET_NAME} SHARED ${G4LIBTARGET_SOURCES}) - target_compile_definitions(${G4LIBTARGET_NAME} PRIVATE GEANT4_DEVELOPER_$) - target_compile_features(${G4LIBTARGET_NAME} PUBLIC ${GEANT4_TARGET_COMPILE_FEATURES}) - - set(__sorted_link_libs ${G4LIBTARGET_GEANT4_LINK_LIBRARIES} ${G4LIBTARGET_LINK_LIBRARIES}) - if(__sorted_link_libs) - list(SORT __sorted_link_libs) - endif() - - target_link_libraries(${G4LIBTARGET_NAME} ${__sorted_link_libs}) - # DLL support, portable to all platforms - # G4LIB_BUILD_DLL is public as despite the name it indicates the shared/archive mode - # and clients must apply it when linking to the shared libs. The global - # category handles the exact import/export statements - target_compile_definitions(${G4LIBTARGET_NAME} PUBLIC G4LIB_BUILD_DLL) - set_target_properties(${G4LIBTARGET_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) - - # Set the include directory usage requirements - target_include_directories(${G4LIBTARGET_NAME} PUBLIC "$") - - # This property is set to prevent concurrent builds of static and - # shared libs removing each others files. - set_target_properties(${G4LIBTARGET_NAME} - PROPERTIES CLEAN_DIRECT_OUTPUT 1) - - # Use '@rpath' in install names of libraries on macOS to provide relocatibility - set_target_properties(${G4LIBTARGET_NAME} - PROPERTIES MACOSX_RPATH 1 - ) - # Add '@loader_path' to INSTALL_RPATH on macOS so that Geant4 - # libraries self-locate each other whilst remaining relocatable - if(APPLE) - set_property(TARGET ${G4LIBTARGET_NAME} - APPEND PROPERTY INSTALL_RPATH "@loader_path" - ) - endif() - - # Alias the library for transparent internal use in build or link contexts - add_library(Geant4::${G4LIBTARGET_NAME} ALIAS ${G4LIBTARGET_NAME}) - - # Install the library - note the use of RUNTIME, LIBRARY and ARCHIVE - # this helps with later DLL builds. - # Export to standard depends file for later install - install(TARGETS ${G4LIBTARGET_NAME} - EXPORT Geant4LibraryDepends - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) - endif() - - # - # As above, but for static rather than shared library - if(BUILD_STATIC_LIBS) - # We have to distinguish the static from shared lib, so use -static in - # name. Link its dependencies, and ensure we actually link to the - # -static targets (We should strictly do this for the external - # libraries as well if we want a pure static build). - add_library(${G4LIBTARGET_NAME}-static STATIC ${G4LIBTARGET_SOURCES}) - target_compile_definitions(${G4LIBTARGET_NAME}-static PRIVATE GEANT4_DEVELOPER_$) - target_compile_features(${G4LIBTARGET_NAME}-static PUBLIC ${GEANT4_TARGET_COMPILE_FEATURES}) - target_include_directories(${G4LIBTARGET_NAME}-static PUBLIC "$") - - set(G4LIBTARGET_GEANT4_LINK_LIBRARIES_STATIC ) - foreach(_tgt ${G4LIBTARGET_GEANT4_LINK_LIBRARIES}) - list(APPEND G4LIBTARGET_GEANT4_LINK_LIBRARIES_STATIC ${_tgt}-static) - endforeach() - - # If we are building both types of library and builtin clhep etc, - # we want to link shared->shared and static->static. - # Because externals like clhep appear in G4LIBTARGET_LINK_LIBRARIES, - # filter this list to replace shared builtins with their static variant - string(REGEX REPLACE - "(G4clhep|G4expat|G4zlib|G4ptl|G4geomUSolids)(;|$)" "\\1-static\\2" - G4LIBTARGET_LINK_LIBRARIES_STATIC - "${G4LIBTARGET_LINK_LIBRARIES}" - ) - - set(__sorted_link_libs ${G4LIBTARGET_GEANT4_LINK_LIBRARIES_STATIC} ${G4LIBTARGET_LINK_LIBRARIES_STATIC}) - if(__sorted_link_libs) - list(SORT __sorted_link_libs) - endif() - target_link_libraries(${G4LIBTARGET_NAME}-static PUBLIC ${__sorted_link_libs}) - - # But we can rename the output library to the correct name - # On WIN32 we *retain* the -static postfix to avoid name clashes - # with the DLL import lib. - if(NOT WIN32) - set_target_properties(${G4LIBTARGET_NAME}-static - PROPERTIES OUTPUT_NAME ${G4LIBTARGET_NAME}) - endif() - - set_target_properties(${G4LIBTARGET_NAME}-static - PROPERTIES CLEAN_DIRECT_OUTPUT 1) - - # Alias the library for transparent internal use in build or link contexts - add_library(Geant4::${G4LIBTARGET_NAME}-static ALIAS ${G4LIBTARGET_NAME}-static) - - install(TARGETS ${G4LIBTARGET_NAME}-static - EXPORT Geant4LibraryDepends - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Runtime - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) - endif() -endmacro() - -#----------------------------------------------------------------------- -# - GEANT4_HEADER_MODULE_TARGET -# Build and install for a header only Geant4 module. -# -macro(geant4_header_module_target) - CMAKE_PARSE_ARGUMENTS(G4HEADERMOD - "" - "COMPONENT" - "" - ${ARGN} - ) - - # Only has one component, and we just have to pick out the headers - include(${G4HEADERMOD_COMPONENT}) - - # Header install? - install(FILES ${${G4MODULENAME}_HEADERS} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} - COMPONENT Development) - - # Store the include path of the component so that the build tree - # config file can pick up all needed header paths - set_property(GLOBAL APPEND - PROPERTY GEANT4_BUILDTREE_INCLUDE_DIRS "${${G4MODULENAME}_INCDIR}") -endmacro() - -#----------------------------------------------------------------------- -# - GEANT4_GRANULAR_LIBRARY_TARGET -# Build and install for a Geant4 module (granular) library -# -macro(geant4_granular_library_target) - cmake_parse_arguments(G4GRANLIB - "" - "COMPONENT" - "" - ${ARGN} - ) - - message(FATAL_ERROR "geant4_granular_library_target is no longer supported") -endmacro() - -#----------------------------------------------------------------------- -# - GEANT4_GLOBAL_LIBRARY_TARGET -# Build and install of a Geant4 category (global) library -# -macro(geant4_global_library_target) - cmake_parse_arguments(G4GLOBLIB - "" - "NAME" - "COMPONENTS" - ${ARGN} - ) - - # We loop over the component sources one at a time, - # appending properties as we go. - foreach(_comp ${G4GLOBLIB_COMPONENTS}) - include(${_comp}) - # In case we have a global lib with one component, ensure name gets set - if(NOT G4GLOBLIB_NAME) - set(G4GLOBLIB_NAME ${G4MODULENAME}) - endif() - - list(APPEND ${G4GLOBLIB_NAME}_GLOBAL_SOURCES ${${G4MODULENAME}_SOURCES}) - list(APPEND ${G4GLOBLIB_NAME}_GLOBAL_HEADERS ${${G4MODULENAME}_HEADERS}) - - list(APPEND ${G4GLOBLIB_NAME}_GLOBAL_DEPENDENCIES - ${${G4MODULENAME}_GLOBAL_DEPENDENCIES}) - - list(APPEND ${G4GLOBLIB_NAME}_LINK_LIBRARIES - ${${G4MODULENAME}_LINK_LIBRARIES}) - - list(APPEND ${G4GLOBLIB_NAME}_BUILDTREE_INCLUDES ${${G4MODULENAME}_INCDIR}) - endforeach() - - # Reset directory scope include dirs so we enforce usage requirements - set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "") - - # Filter out duplicates/self in GLOBAL_DEPENDENCIES and LINK_LIBRARIES - if(${G4GLOBLIB_NAME}_GLOBAL_DEPENDENCIES) - list(REMOVE_DUPLICATES ${G4GLOBLIB_NAME}_GLOBAL_DEPENDENCIES) - list(REMOVE_ITEM ${G4GLOBLIB_NAME}_GLOBAL_DEPENDENCIES ${G4GLOBLIB_NAME}) - endif() - if(${G4GLOBLIB_NAME}_LINK_LIBRARIES) - list(REMOVE_DUPLICATES ${G4GLOBLIB_NAME}_LINK_LIBRARIES) - endif() - - # Now add the library target - geant4_library_target(NAME ${G4GLOBLIB_NAME} - SOURCES - ${${G4GLOBLIB_NAME}_GLOBAL_SOURCES} - ${${G4GLOBLIB_NAME}_GLOBAL_HEADERS} - GEANT4_LINK_LIBRARIES - ${${G4GLOBLIB_NAME}_GLOBAL_DEPENDENCIES} - LINK_LIBRARIES - ${${G4GLOBLIB_NAME}_LINK_LIBRARIES}) - - # Header install? - install(FILES ${${G4GLOBLIB_NAME}_GLOBAL_HEADERS} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} - COMPONENT Development) - - # Store the include path of the component. Only used so that - # other tools like GNUmake/pkg-config can be configured for the - # build tree - set_property(GLOBAL APPEND - PROPERTY GEANT4_BUILDTREE_INCLUDE_DIRS ${${G4GLOBLIB_NAME}_BUILDTREE_INCLUDES}) -endmacro() - diff --git a/cmake/Modules/G4InstallData.cmake b/cmake/Modules/G4InstallData.cmake index 7928c97875..263225bf2c 100644 --- a/cmake/Modules/G4InstallData.cmake +++ b/cmake/Modules/G4InstallData.cmake @@ -75,21 +75,6 @@ # If it is not installed, warn user that it will need installing # manually in destination. # -# -# Private API -# ----------- -# function _geant4_dataproject( -# PREFIX installdir -# SOURCE_DIR wheretounpack -# URL whattodownload -# URL_MD5 expectedMD5ofdownload -# TIMEOUT timeoutafter(seconds)) -# Download, unpack and install a dataset for CMake < 2.8.2 -# This largely replicates the functionality of ExternalProject -# so that CMake 2.6.4 can still be supported (It is also needed -# for CMake 2.8.{0,1} where ExternalProject does not provide MD5 -# validation. -# #----------------------------------------------------------------------- # GEANT4 PHYSICS DATA - GLOBAL CMAKE VARIABLES @@ -419,28 +404,17 @@ function(geant4_install_dataset _name _destination _timeout) # - Dispatch to ExternalProject or our own implementation. # Use of URL_MD5 *and* TIMEOUT require CMake 2.8.2 or higher. - if(${CMAKE_VERSION} VERSION_GREATER "2.8.1") - include(ExternalProject) - ExternalProject_Add(${_name} - PREFIX Externals/${_name}-${_ds_version} - SOURCE_DIR ${GEANT4_BUILD_FULL_DATADIR}/${_ds_dir} - URL ${_ds_url} - URL_MD5 ${_ds_md5sum} - TIMEOUT ${_timeout} - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" - ) - else() - _geant4_dataproject(${_name} - PREFIX Externals/${_name}-${_ds_version} - SOURCE_DIR ${GEANT4_BUILD_FULL_DATADIR} - URL ${_ds_url} - URL_MD5 ${_ds_md5sum} - TIMEOUT ${_timeout} - ) - endif() - + include(ExternalProject) + ExternalProject_Add(${_name} + PREFIX Externals/${_name}-${_ds_version} + SOURCE_DIR ${GEANT4_BUILD_FULL_DATADIR}/${_ds_dir} + URL ${_ds_url} + URL_MD5 ${_ds_md5sum} + TIMEOUT ${_timeout} + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + ) # - Configure the dataset's build and install locations geant4_set_dataset_property(${_name} BUILD_DIR "${PROJECT_BINARY_DIR}/data/${_ds_dir}") geant4_set_dataset_property(${_name} INSTALL_DIR "${_destination}/${_ds_dir}") @@ -472,119 +446,6 @@ function(geant4_reuse_dataset _name _destination _ispresent) geant4_set_dataset_property(${_name} INSTALL_DIR "${_destination}/${_ds_dir}") endfunction() - -#----------------------------------------------------------------------- -# GEANT4 PHYSICS DATA - PRIVATE CMAKE API FOR DATASET HANDLING -#----------------------------------------------------------------------- -# function _geant4_dataproject( -# PREFIX installdir -# SOURCE_DIR wheretounpack -# URL whattodownload -# URL_MD5 expectedMD5ofdownload -# TIMEOUT timeoutafter(seconds)) -# Download, unpack and install a dataset for CMake < 2.8.2 -# This largely replicates the functionality of ExternalProject -# so that CMake 2.6.4 can still be supported (It is also needed -# for CMake 2.8.{0,1} where ExternalProject does not provide MD5 -# validation. -# -function(_geant4_dataproject _name) - # - Parse arguments and create any extra needed variables - set(oneValueArgs PREFIX SOURCE_DIR URL URL_MD5 TIMEOUT) - cmake_parse_arguments(_G4DATA "" "${oneValueArgs}" "" ${ARGN}) - get_filename_component(_G4DATA_FILE ${_G4DATA_URL} NAME) - - # - Write Download script - file(WRITE ${PROJECT_BINARY_DIR}/${_G4DATA_PREFIX}/${_name}-Download.cmake " - message(STATUS \"downloading ${_G4DATA_URL}...\") - file(DOWNLOAD - ${_G4DATA_URL} - \"${_G4DATA_PREFIX}/${_G4DATA_FILE}\" - TIMEOUT ${_G4DATA_TIMEOUT} - STATUS _status) - # LOG _log) - LOG with TIMEOUT fails due to curl issue, prefer TIMEOUT - list(GET _status 0 _status_code) - list(GET _status 1 _status_msg) - if(NOT _status_code EQUAL 0) - message(FATAL_ERROR \"error: downloading ${_G4DATA_URL} failed - status_code : \${_status_code} - status_msg : \${_status_msg} - #log : \${_log}\" - ) - endif() - ") - - # - Write Verify script - file(WRITE ${PROJECT_BINARY_DIR}/${_G4DATA_PREFIX}/${_name}-Verify.cmake " - message(STATUS \"verifying ${_G4DATA_FILE} ...\") - execute_process( - COMMAND \"${CMAKE_COMMAND}\" -E md5sum \"${PROJECT_BINARY_DIR}/${_G4DATA_PREFIX}/${_G4DATA_FILE}\" - OUTPUT_VARIABLE ov - OUTPUT_STRIP_TRAILING_WHITESPACE - RESULT_VARIABLE _result_code - ) - if(NOT _result_code EQUAL 0) - message(FATAL_ERROR \"error: computing md5sum of ${_G4DATA_FILE} failed\") - endif() - string(REGEX MATCH \"^([0-9A-Fa-f]+)\" md5_actual \"\${ov}\") - string(TOLOWER \"\${md5_actual}\" md5_actual) - string(TOLOWER \"${_G4DATA_URL_MD5}\" md5) - if(NOT \"\${md5}\" STREQUAL \"\${md5_actual}\") - message(FATAL_ERROR \"error: md5sum of '${_G4DATA_FILE}' does not match expected value - md5_expected: \${md5} - md5_actual: \${md5_actual} -\") - endif() - message(STATUS \"verifying ${_G4DATA_FILE} ... done\") - ") - - # - Write Unpack script - if(${_G4DATA_FILE} MATCHES "(\\.|=)(tar\\.gz|zip)$") - else() - message(FATAL_ERROR "error: do not know how to extract '${_G4DATA_FILE}' -- file needs to be .tar.gz or zip") - endif() - file(WRITE ${PROJECT_BINARY_DIR}/${_G4DATA_PREFIX}/${_name}-Unpack.cmake " - message(STATUS \"unpacking ${_G4DATA_FILE} ...\") - file(MAKE_DIRECTORY ${_G4DATA_SOURCE_DIR}) - execute_process(COMMAND - \${CMAKE_COMMAND} -E tar xfz \"${PROJECT_BINARY_DIR}/${_G4DATA_PREFIX}/${_G4DATA_FILE}\" - WORKING_DIRECTORY ${_G4DATA_SOURCE_DIR} - RESULT_VARIABLE rv) - if(NOT rv EQUAL 0) - message(STATUS \"extracting... [error clean up]\") - file(REMOVE_RECURSE \"${_G4DATA_SOURCE_DIR}\") - message(FATAL_ERROR \"error: extract of '${_G4DATA_FILE}' failed\") - endif() - message(STATUS \"unpacking ${_G4DATA_FILE} ... done\") - ") - - # - Add custom commands for each step, each depending on the last - foreach(_step Download Verify Unpack) - if(_last_step) - set(_deps DEPENDS ${PROJECT_BINARY_DIR}/${_G4DATA_PREFIX}/${_name}-${_last_step}.stamp) - endif() - - add_custom_command( - OUTPUT ${PROJECT_BINARY_DIR}/${_G4DATA_PREFIX}/${_name}-${_step}.stamp - COMMENT "${_step} ${_name}" - COMMAND "${CMAKE_COMMAND}" -P ${PROJECT_BINARY_DIR}/${_G4DATA_PREFIX}/${_name}-${_step}.cmake - COMMAND "${CMAKE_COMMAND}" -E touch ${PROJECT_BINARY_DIR}/${_G4DATA_PREFIX}/${_name}-${_step}.stamp - VERBATIM - ${_deps} - ) - - set(_last_step ${_step}) - endforeach() - - # - Add the main target which will run all the above steps - add_custom_target(${_name} ALL - COMMENT "Completed ${_name}" - DEPENDS ${PROJECT_BINARY_DIR}/${_G4DATA_PREFIX}/${_name}-${_last_step}.stamp - VERBATIM - ) -endfunction() - - #----------------------------------------------------------------------- # GEANT4 PHYSICS DATA - USER INTERFACE AND PROCESSING #----------------------------------------------------------------------- diff --git a/cmake/Modules/G4InterfaceOptions.cmake b/cmake/Modules/G4InterfaceOptions.cmake index 93a4517250..d21c350096 100644 --- a/cmake/Modules/G4InterfaceOptions.cmake +++ b/cmake/Modules/G4InterfaceOptions.cmake @@ -35,65 +35,108 @@ # Specific UI/Vis options are also handled here. # +#----------------------------------------------------------------------- +# Select options first because these are interdependent +# +# - Coin3D/So{XT,Win,Qt} +option(GEANT4_USE_INVENTOR "Build Geant4 OpenInventor Xt/Win Visualization Driver" OFF) +geant4_add_feature(GEANT4_USE_INVENTOR "Build OpenInventor Xt/Win Driver") + +option(GEANT4_USE_INVENTOR_QT "Build Geant4 OpenInventor Qt Visualization Driver" OFF) +geant4_add_feature(GEANT4_USE_INVENTOR_QT "Build OpenInventor Qt Driver") + +# GEANT4_USE_INVENTOR is a dual-purpose variable - it marks use of Xt/Win driver for +# user, and marks enablement of G4OpenInventor internally. Check that user-set options +# are consistent before setting *internal* value +if(GEANT4_USE_INVENTOR AND GEANT4_USE_INVENTOR_QT) + message(FATAL_ERROR "Only one of GEANT4_USE_INVENTOR and GEANT4_USE_INVENTOR_QT can be set ON, but both are ON.") +endif() + +# User settings o.k., so mark that we're enabling G4OpenInventor +if(GEANT4_USE_INVENTOR_QT) + set(GEANT4_USE_INVENTOR ON) +endif() + +# - Qt (may be required by Coin driver) +option(GEANT4_USE_QT "Build Geant4 with Qt support" OFF) +if(GEANT4_USE_INVENTOR_QT AND NOT GEANT4_USE_QT) + set(GEANT4_USE_QT ON CACHE BOOL "Build Geant4 with Qt support" FORCE) + message(STATUS "Forcing GEANT4_USE_QT to ON, required by GEANT4_USE_INVENTOR_QT") +endif() + +geant4_add_feature(GEANT4_USE_QT "Build Geant4 with Qt support") + +# - Unix only +if(UNIX) + # - Client/Server DAWN driver + # mark as advanced because user should know what they're doing here + option(GEANT4_USE_NETWORKDAWN "Build Dawn driver with Client/Server support" OFF) + geant4_add_feature(GEANT4_USE_NETWORKDAWN "Build Dawn driver with Client/Server support") + mark_as_advanced(GEANT4_USE_NETWORKDAWN) + + # - Client/Server VRML driver + option(GEANT4_USE_NETWORKVRML "Build VRML driver with Client/Server support" OFF) + geant4_add_feature(GEANT4_USE_NETWORKVRML "Build VRML driver with Client/Server support") + mark_as_advanced(GEANT4_USE_NETWORKVRML) + + # - Motif UI/Vis (may be required by Coin Vis driver) + option(GEANT4_USE_XM "Build Geant4 with Motif (X11) support" OFF) + if(GEANT4_USE_INVENTOR AND NOT GEANT4_USE_INVENTOR_QT AND NOT GEANT4_USE_XM) + set(GEANT4_USE_XM ON CACHE BOOL "Build Geant4 with Motif (X11) support" FORCE) + message(STATUS "Forcing GEANT4_USE_XM to ON, required by GEANT4_USE_INVENTOR") + endif() + + geant4_add_feature(GEANT4_USE_XM "Build Geant4 with Xm Support") + + # OpenGL/X11 Vis Driver + option(GEANT4_USE_OPENGL_X11 "Build Geant4 OpenGL driver with X11 support" OFF) + geant4_add_feature(GEANT4_USE_OPENGL_X11 "Build Geant4 OpenGL driver with X11 support") + + # RayTracer driver with X11 support + option(GEANT4_USE_RAYTRACER_X11 "Build RayTracer driver with X11 support" OFF) + geant4_add_feature(GEANT4_USE_RAYTRACER_X11 "Build RayTracer driver with X11 support") +endif() + +# Windows only +if(WIN32) + option(GEANT4_USE_OPENGL_WIN32 "Build OpenGL driver with Win32 support") + geant4_add_feature(GEANT4_USE_OPENGL_WIN32 "Build OpenGL driver with Win32 support") +endif() + +#----------------------------------------------------------------------- +# Find dependencies +# # Prefer Legacy GL when using CMake >= 3.10 set(OpenGL_GL_PREFERENCE "LEGACY") -#----------------------------------------------------------------------- -# Configure OpenInventor support -# -option(GEANT4_USE_INVENTOR "Build Geant4 OpenInventor Visualization Driver" OFF) -option(GEANT4_USE_INVENTOR_QT "Build Geant4 OpenInventor Qt Visualization Driver" OFF) - -if(GEANT4_USE_INVENTOR_QT) - set(GEANT4_USE_INVENTOR ON) - set(GEANT4_USE_QT ON) -endif() - +# - Coin plus So{Xt,Qt,Win} if(GEANT4_USE_INVENTOR) - # Always need Inventor and OpenGL - find_package(Inventor REQUIRED) - find_package(OpenGL REQUIRED) + find_package(Coin 4.0.0 REQUIRED) + geant4_save_package_variables(Inventor Coin_DIR) - # On UNIX, we also require Xm and X11 (inc. Xpm)... - if(UNIX) - if (GEANT4_USE_INVENTOR_QT) - if (NOT INVENTOR_SOQT_LIBRARY OR NOT INVENTOR_SOQT_INCLUDE_DIR) - message(FATAL_ERROR "Could not find SoQt library and/or headers") - endif() - set(INVENTOR_INCLUDE_DIR "${INVENTOR_INCLUDE_DIR}" "${INVENTOR_SOQT_INCLUDE_DIR}") - else() - if(NOT INVENTOR_SOXT_LIBRARY OR NOT INVENTOR_SOXT_INCLUDE_DIR) - message(FATAL_ERROR "Could not find SoXt library and/or headers") - endif() - set(INVENTOR_INCLUDE_DIR "${INVENTOR_INCLUDE_DIR}" "${INVENTOR_SOXT_INCLUDE_DIR}") - set(GEANT4_USE_XM ON) - find_package(Motif REQUIRED) - endif() - - find_package(X11 REQUIRED) - - if(NOT X11_Xpm_FOUND) - message(FATAL_ERROR "Could not find X11 Xpm headers and/or library (Required by GEANT4_USE_INVENTOR)") + if(GEANT4_USE_INVENTOR_QT) + find_package(SoQt 1.6.0 REQUIRED) + geant4_save_package_variables(Inventor SoQt_DIR) + else() + if(UNIX) + find_package(SoXt 1.4.0 REQUIRED) + geant4_save_package_variables(Inventor SoXt_DIR) + set(GEANT4_USE_INVENTOR_XT ON) + elseif(WIN32) + find_package(SoWin 1.4.0 REQUIRED) + geant4_save_package_variables(Inventor SoWin_DIR) + set(GEANT4_USE_INVENTOR_WIN ON) endif() endif() - - geant4_add_feature(GEANT4_USE_INVENTOR "Build OpenInventor Driver") endif() - -#----------------------------------------------------------------------- -# Configure Qt Support if needed (CROSSPLATFORM). -# -option(GEANT4_USE_QT "Build Geant4 with Qt support" OFF) - +# - Qt5 if(GEANT4_USE_QT) - # Find and configure Qt and OpenGL find_package(Qt5Core REQUIRED) find_package(Qt5Gui REQUIRED) find_package(Qt5Widgets REQUIRED) find_package(Qt5OpenGL REQUIRED) find_package(Qt5PrintSupport REQUIRED) - set(QT_QTCORE_LIBRARY Qt5::Core Qt5::PrintSupport) set(QT_QTGUI_LIBRARY Qt5::Gui Qt5::Widgets) set(QT_OPENGL_LIBRARY Qt5::Gui Qt5::OpenGL) @@ -101,90 +144,72 @@ if(GEANT4_USE_QT) get_target_property(QT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION) geant4_save_package_variables(Qt5 Qt5Core_DIR Qt5Gui_DIR Qt5Widgets_DIR Qt5OpenGL_DIR Qt5PrintSupport_DIR) - find_package(OpenGL REQUIRED) - geant4_save_package_variables(OpenGL OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY) + # Qt3D is only supported on 5.15 and above, but always on if available + set(QT3D_MINIMUM_VERSION 5.15.0) + set(GEANT4_USE_QT3D OFF) + if(Qt5Core_VERSION GREATER_EQUAL QT3D_MINIMUM_VERSION) + find_package(Qt53DCore ${QT3D_MINIMUM_VERSION} QUIET) + find_package(Qt53DExtras ${QT3D_MINIMUM_VERSION} QUIET) + find_package(Qt53DRender ${QT3D_MINIMUM_VERSION} QUIET) + + if(Qt53DCore_FOUND AND Qt53DExtras_FOUND AND Qt53DRender_FOUND) + set(GEANT4_USE_QT3D ON) + geant4_save_package_variables(Qt5 Qt53DCore_DIR Qt53DExtras_DIR Qt53DRender_DIR) + geant4_add_feature(GEANT4_USE_QT3D "Build Geant4 Qt3D driver") + else() + set(_g4_qt53d_missing) + if(NOT Qt53DCore_FOUND) + list(APPEND _g4_qt53d_missing "Qt53DCore") + endif() + if(NOT Qt53DExtras_FOUND) + list(APPEND _g4_qt53d_missing "Qt53DExtras") + endif() + if(NOT Qt53DRender_FOUND) + list(APPEND _g4_qt53d_missing "Qt53DRender") + endif() + + message(STATUS "Disabling Geant4 Qt3D driver, missing Qt5 packages: ${_g4_qt53d_missing}") + endif() + endif() # Variables for export to GNUmake execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_PREFIX OUTPUT_VARIABLE G4QTHOME OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_LIBS OUTPUT_VARIABLE G4QTLIBPATH OUTPUT_STRIP_TRAILING_WHITESPACE) +endif() - # OpenGL part of Qt is in OpenGL component so mark the need to - # add OpenGL. +# - OpenGL +if(GEANT4_USE_INVENTOR + OR GEANT4_USE_QT + OR GEANT4_USE_OPENGL_X11 + OR GEANT4_USE_XM + OR GEANT4_USE_OPENGL_WIN32) + find_package(OpenGL REQUIRED) + geant4_save_package_variables(OpenGL OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY) + + # X11 drivers on macOS need XQuartzGL + if(APPLE AND (GEANT4_USE_INVENTOR_XT OR GEANT4_USE_OPENGL_X11 OR GEANT4_USE_XM)) + find_package(XQuartzGL REQUIRED) + geant4_save_package_variables(XQuartzGL XQuartzGL_INCLUDE_DIR XQuartzGL_gl_LIBRARY) + endif() + + # Enable driver set(GEANT4_USE_OPENGL ON) - geant4_add_feature(GEANT4_USE_QT "Build Geant4 with Qt support") endif() -#----------------------------------------------------------------------- -# Configure Wt Support -# -if(GEANT4_USE_WT) - message(WARNING "Support for Wt in Geant4 is no longer available and may be removed in future releases") -endif() -set(GEANT4_USE_WT OFF) - -#option(GEANT4_USE_WT "Build Geant4 with Wt4 support" OFF) -#mark_as_advanced(GEANT4_USE_WT) -# -#if(GEANT4_USE_WT) -# # Find and configure Wt and OpenGL -# find_package(Wt REQUIRED) -# find_package(OpenGL REQUIRED) -# -# geant4_save_package_variables(Wt Wt_INCLUDE_DIR Wt_LIBRARY_RELEASE Wt_LIBRARY_DEBUG Wt_HTTP_LIBRARY_RELEASE Wt_HTTP_LIBRARY_DEBUG) -# geant4_save_package_variables(OpenGL OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY) -# -# set(WT_DEFINITIONS "-DQT_NO_KEYWORDS") -# -# # WebGL part of Wt is in OpenGL component so mark the need to -# # add OpenGL. -# set(GEANT4_USE_OPENGL ON) -# geant4_add_feature(GEANT4_USE_WT "Build Geant4 with Wt support") -#endif() - - -#----------------------------------------------------------------------- -# UNIX PLATFORMS ONLY -#----------------------------------------------------------------------- if(UNIX) - # - Support for Client/Server DAWN driver - # mark as advanced because user should know what they're doing here - option(GEANT4_USE_NETWORKDAWN "Build Dawn driver with Client/Server support" OFF) - # - # Possible headers checks for needed network parts? - # - geant4_add_feature(GEANT4_USE_NETWORKDAWN "Build Dawn driver with Client/Server support") - mark_as_advanced(GEANT4_USE_NETWORKDAWN) - - # - Support for Client/Server VRML driver - # mark as advanced because user should know what they're doing to use this - option(GEANT4_USE_NETWORKVRML "Build VRML driver with Client/Server support" OFF) - geant4_add_feature(GEANT4_USE_NETWORKVRML "Build VRML driver with Client/Server support") - mark_as_advanced(GEANT4_USE_NETWORKVRML) - - # - Configure Xm support if requested - option(GEANT4_USE_XM "Build Geant4 with Motif (X11) support" OFF) - - # - Configure OpenGL X11 support if requested - option(GEANT4_USE_OPENGL_X11 "Build Geant4 OpenGL driver with X11 support" OFF) - - # - X11 Support for RayTracer driver - option(GEANT4_USE_RAYTRACER_X11 "Build RayTracer driver with X11 support" OFF) - - # -- Now configure needed X11, Motif and OpenGL packages - # We also have to be concerned with Inventor on UNIX, because - # that also needs the Xt configuration... # - X11 - if(GEANT4_USE_XM OR GEANT4_USE_OPENGL_X11 OR GEANT4_USE_RAYTRACER_X11 OR GEANT4_USE_INVENTOR) + if(GEANT4_USE_OPENGL_X11 + OR GEANT4_USE_RAYTRACER_X11 + OR GEANT4_USE_XM + OR GEANT4_USE_INVENTOR_XT) find_package(X11 REQUIRED) include("${CMAKE_CURRENT_LIST_DIR}/G4X11Shim.cmake") # Check for additional required X11 libraries - # - Xmu if(NOT X11_Xmu_FOUND) message(FATAL_ERROR "could not find X11 Xmu library and/or headers") endif() - # - Xt if(NOT X11_Xt_FOUND) message(FATAL_ERROR "could not find X11 Xt library and/or headers") endif() @@ -201,60 +226,14 @@ if(UNIX) X11_Xmu_INCLUDE_PATH X11_Xmu_LIB X11_Xt_INCLUDE_PATH - X11_Xt_LIB - ) - - # - If we got to this point, RayTracer is o.k., so add the feature - geant4_add_feature(GEANT4_USE_RAYTRACER_X11 "Build RayTracer driver with X11 support") + X11_Xt_LIB) endif() - #- OpenGL : we also do this for Inventor so that we pick up Mac X11 GL... - if(GEANT4_USE_INVENTOR OR GEANT4_USE_XM OR GEANT4_USE_OPENGL_X11) - # - Find native GL first - find_package(OpenGL REQUIRED) - geant4_save_package_variables(OpenGL OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY) - - # - If we're on Apple, also find the XQuartz GL libraries and append t. - if(APPLE) - find_package(XQuartzGL REQUIRED) - geant4_save_package_variables(XQuartzGL XQuartzGL_INCLUDE_DIR XQuartzGL_gl_LIBRARY) - endif() - - # Add feature for X11 GL - geant4_add_feature(GEANT4_USE_OPENGL_X11 "Build Geant4 OpenGL driver with X11 support") - endif() - - # - Add need for OpenGL in X11 case - if(GEANT4_USE_OPENGL_X11 OR GEANT4_USE_XM) - set(GEANT4_USE_OPENGL ON) - endif() - - # - Motif last of all, then can add the feature + # - Motif if(GEANT4_USE_XM) find_package(Motif REQUIRED) include("${CMAKE_CURRENT_LIST_DIR}/G4MotifShim.cmake") geant4_save_package_variables(Motif MOTIF_INCLUDE_DIR MOTIF_LIBRARIES) - geant4_add_feature(GEANT4_USE_XM "Build Geant4 with Xm Support") endif() endif() -#----------------------------------------------------------------------- -# WINDOWS PLATFORMS ONLY -#----------------------------------------------------------------------- -if(WIN32) - # - OpenGL Win32... - option(GEANT4_USE_OPENGL_WIN32 "Build OpenGL driver with Win32 support") - - if(GEANT4_USE_OPENGL_WIN32) - # Just need OpenGL and on Windows, this should be easy... - find_package(OpenGL REQUIRED) - - # This is part of the G4OpenGL component, so mark it as needed - set(GEANT4_USE_OPENGL ON) - geant4_add_feature(GEANT4_USE_OPENGL_WIN32 "Build OpenGL driver with Win32 support") - geant4_save_package_variables(OpenGL OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY) - endif() -endif() - -# - and we're done... - diff --git a/cmake/Modules/G4OptionalComponents.cmake b/cmake/Modules/G4OptionalComponents.cmake index 754fe77bfb..a1ab44bbbc 100644 --- a/cmake/Modules/G4OptionalComponents.cmake +++ b/cmake/Modules/G4OptionalComponents.cmake @@ -61,7 +61,7 @@ if(GEANT4_USE_SYSTEM_CLHEP) set(__system_clhep_mode " (granular)") endif() - find_package(CLHEP 2.3.3.0 REQUIRED ${__g4_clhep_components} CONFIG) + find_package(CLHEP 2.4.4.0 REQUIRED ${__g4_clhep_components} CONFIG) geant4_save_package_variables(CLHEP CLHEP_DIR) else() @@ -185,7 +185,7 @@ else() set(GEANT4_USE_BUILTIN_PTL TRUE) set(PTL_LIBRARIES G4ptl) endif() - +mark_as_advanced(GEANT4_USE_SYSTEM_PTL) geant4_add_feature(GEANT4_USE_SYSTEM_PTL "Using system PTL library") #----------------------------------------------------------------------- @@ -237,12 +237,20 @@ option(GEANT4_USE_TIMEMORY "Build Geant4 with TiMemory support" ${_default_use_t mark_as_advanced(GEANT4_USE_TIMEMORY) if(GEANT4_USE_TIMEMORY) - set(_G4timemory_DEFAULT_COMPONENTS headers caliper papi gotcha gperftools-cpu vector) + # by default just use the library which will import all the components that it + # was built with but once can add more + if(BUILD_SHARED_LIBS) + set(_G4timemory_DEFAULT_COMPONENTS cxx shared OPTIONAL_COMPONENTS) + else() + set(_G4timemory_DEFAULT_COMPONENTS cxx static OPTIONAL_COMPONENTS) + endif() set(G4timemory_COMPONENTS "${_G4timemory_DEFAULT_COMPONENTS}" CACHE STRING "timemory INTERFACE libraries that activate various capabilities in toolkit") - set(G4timemory_VERSION 3.0) + set(G4timemory_VERSION 3.2) set(timemory_FIND_COMPONENTS_INTERFACE geant4-timemory) + add_library(geant4-timemory INTERFACE) find_package(timemory ${G4timemory_VERSION} REQUIRED COMPONENTS ${G4timemory_COMPONENTS}) + install(TARGETS geant4-timemory EXPORT Geant4LibraryDepends) set(timemory_LIBRARIES geant4-timemory) geant4_save_package_variables(timemory timemory_DIR) endif() @@ -325,8 +333,7 @@ endif() # - Geant4 USolids/VecGom setup if(GEANT4_USE_ALL_USOLIDS OR GEANT4_USE_PARTIAL_USOLIDS) - # VecGeom's config file doesn't support versioning... - find_package(VecGeom REQUIRED) + find_package(VecGeom 1.1.8 REQUIRED) # Shim until VecGeom supports config mode properly include("${CMAKE_CURRENT_LIST_DIR}/G4VecGeomShim.cmake") # Backward Compatibility diff --git a/cmake/Modules/Geant4MacroDefineModule.cmake b/cmake/Modules/Geant4MacroDefineModule.cmake deleted file mode 100644 index 5780d0e8ea..0000000000 --- a/cmake/Modules/Geant4MacroDefineModule.cmake +++ /dev/null @@ -1,12 +0,0 @@ -# - Macros for organizing and specializing code in Geant4 modules -# - DEPRECATED: Functionality merged into G4DeveloperAPI/_OLD -# Retained as many modules still include it -# Simply forward to new module -# - Include guard -if(__GEANT4MACRODEFINEMODULE_INCLUDED) - return() -endif() -set(__GEANT4MACRODEFINEMODULE_INCLUDED YES) - -include(G4DeveloperAPI) - diff --git a/cmake/Modules/Geant4MacroLibraryTargets.cmake b/cmake/Modules/Geant4MacroLibraryTargets.cmake index 01d20afb72..7500e5a3d5 100644 --- a/cmake/Modules/Geant4MacroLibraryTargets.cmake +++ b/cmake/Modules/Geant4MacroLibraryTargets.cmake @@ -1,12 +1,3 @@ # - Define useful macros for building and installing Geant4 library targets # - DEPRECATED: Functionality merged into G4DeveloperAPI/_OLD -# Retained as many modules still include it -# Simply forward to new module -# - Include Guard -if(__GEANT4MACROLIBRARYTARGETS_INCLUDED) - return() -endif() -set(__GEANT4MACROLIBRARYTARGETS_INCLUDED TRUE) - -include(G4DeveloperAPI) - +# Retained as a no-op as many modules still include it diff --git a/cmake/Templates/Geant4Config.cmake.in b/cmake/Templates/Geant4Config.cmake.in index ed6d4444b1..edeaa3b62e 100644 --- a/cmake/Templates/Geant4Config.cmake.in +++ b/cmake/Templates/Geant4Config.cmake.in @@ -67,6 +67,8 @@ # # smartstack (G4event library G4StackManager uses G4SmartTrackStack) # +# php_as_hp (G4processes library ParticleHP built as HP) +# # Optional Components # ------------------- # gdml (GDML support) @@ -143,13 +145,6 @@ # #----------------------------------------------------------------------- -# Support CMake >= 3.8 -cmake_policy(VERSION 3.8) -if(CMAKE_VERSION VERSION_LESS 3.8) - message(FATAL_ERROR "Geant4Config requires CMake 3.8 or newer") -endif() -include(CMakeFindDependencyMacro) - #----------------------------------------------------------------------- # DEBUG : print out the variables passed via find_package arguments # @@ -166,6 +161,23 @@ if(Geant4_CONFIG_DEBUG) message(STATUS "G4CFG_DEBUG : Geant4_LIBDEPS_LOADED = ${Geant4_LIBDEPS_LOADED}") endif() +#----------------------------------------------------------------------- +# Check that consumers use the minimum needed CMake version +# Geant4 uses cxx_std_EP to define the standard it was built against +# 3.8 and above support EP=11,14,17. 3.12 and above add 20. We continue +# to support the earlier version whilst checking for consumers using 20 +cmake_policy(VERSION 3.8...3.18) +if(CMAKE_VERSION VERSION_LESS 3.8) + message(FATAL_ERROR "Projects consuming Geant4Config require CMake 3.8 or newer") +endif() + +if(("@GEANT4_BUILD_CXXSTD@" GREATER_EQUAL 20) AND (CMAKE_VERSION VERSION_LESS 3.12)) + message(FATAL_ERROR "Projects consuming Geant4Config require CMake 3.12 or newer") +endif() + +# - Help find dependencies +include(CMakeFindDependencyMacro) + #----------------------------------------------------------------------- # Locate ourselves, since all other config files should have been # installed alongside us... @@ -298,6 +310,9 @@ endif() # - Smart track stack set(Geant4_smartstack_FOUND @GEANT4_USE_SMARTSTACK@) +# - ParticleHP as HP +set(Geant4_php_as_hp_FOUND @GEANT4_BUILD_PHP_AS_HP@) + # - TBB set(Geant4_TBB_FOUND @GEANT4_USE_TBB@) if(Geant4_TBB_FOUND) @@ -309,8 +324,12 @@ set(Geant4_timemory_FOUND @GEANT4_USE_TIMEMORY@) if(Geant4_timemory_FOUND) set(_geant4_use_timemory_library ON) set(timemory_DIR "@timemory_DIR@" CACHE PATH "timemory installation for Geant4") - set(timemory_FIND_COMPONENTS_INTERFACE @timemory_FIND_COMPONENTS_INTERFACE@) - find_package(timemory @G4timemory_VERSION@ REQUIRED QUIET COMPONENTS @G4timemory_COMPONENTS@) + if(NOT TARGET @timemory_FIND_COMPONENTS_INTERFACE@) + add_library(@timemory_FIND_COMPONENTS_INTERFACE@ INTERFACE IMPORTED) + set(timemory_FIND_COMPONENTS_INTERFACE @timemory_FIND_COMPONENTS_INTERFACE@) + find_package(timemory @G4timemory_VERSION@ REQUIRED QUIET + COMPONENTS @G4timemory_COMPONENTS@) + endif() set(timemory_LIBRARIES @timemory_FIND_COMPONENTS_INTERFACE@) endif() @@ -415,6 +434,7 @@ endif() # - Qt (UI and Vis!) set(Geant4_qt_FOUND @GEANT4_USE_QT@) +set(Geant4_qt3d_FOUND @GEANT4_USE_QT3D@) if(Geant4_qt_FOUND) # Must always refind Qt5 to recreate imported targets. Because these # are in the public interface, always need linking. @@ -424,10 +444,19 @@ if(Geant4_qt_FOUND) find_dependency(Qt5OpenGL REQUIRED) find_dependency(Qt5PrintSupport REQUIRED) + if(Geant4_qt3d_FOUND) + find_dependency(Qt53DCore @QT3D_MINIMUM_VERSION@ REQUIRED) + find_dependency(Qt53DExtras @QT3D_MINIMUM_VERSION@ REQUIRED) + find_dependency(Qt53DRender @QT3D_MINIMUM_VERSION@ REQUIRED) + endif() + # Also require OpenGL find_dependency(OpenGL) - if(("qt" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_ui_all_FOUND OR Geant4_vis_all_FOUND) + # Qt must be activated both directly and for OpenInventor + if(("qt" IN_LIST Geant4_FIND_COMPONENTS) + OR ("vis_openinventor" IN_LIST Geant4_FIND_COMPONENTS) + OR Geant4_ui_all_FOUND OR Geant4_vis_all_FOUND) list(APPEND Geant4_DEFINITIONS -DG4INTY_USE_QT @@ -435,25 +464,11 @@ if(Geant4_qt_FOUND) -DG4VIS_USE_OPENGLQT ) set(_geant4_use_opengl_library ON) + # Qt3D is always on if available + set(_geant4_use_qt3D_library ${Geant4_qt3d_FOUND}) endif() endif() -# - Wt (UI and Vis!) -#set(Geant4_wt_FOUND @GEANT4_USE_WT@) -#if(Geant4_wt_FOUND) -# find_dependency(Wt) -# find_dependency(OpenGL) -# if(("wt" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_ui_all_FOUND OR Geant4_vis_all_FOUND) -# list(APPEND -# Geant4_DEFINITIONS -# -DG4INTY_USE_WT -# -DG4UI_USE_WT -# -DG4VIS_USE_OPENGLWT -# ) -# set(_geant4_use_opengl_library ON) -# endif() -#endif() - # - Motif (UI and Vis!) set(Geant4_motif_FOUND @GEANT4_USE_XM@) if(Geant4_motif_FOUND) @@ -461,12 +476,16 @@ if(Geant4_motif_FOUND) include("${CMAKE_CURRENT_LIST_DIR}/G4X11Shim.cmake") find_dependency(Motif) include("${CMAKE_CURRENT_LIST_DIR}/G4MotifShim.cmake") - find_dependency(OpenGL) if(APPLE) find_dependency(XQuartzGL) + else() + find_dependency(OpenGL) endif() - if(("motif" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_ui_all_FOUND OR Geant4_vis_all_FOUND) + # Motif can be activated both directly and for OpenInventor + if(("motif" IN_LIST Geant4_FIND_COMPONENTS) + OR ("vis_openinventor" IN_LIST Geant4_FIND_COMPONENTS) + OR Geant4_ui_all_FOUND OR Geant4_vis_all_FOUND) list(APPEND Geant4_DEFINITIONS -DG4INTY_USE_XT @@ -482,9 +501,10 @@ set(Geant4_vis_opengl_x11_FOUND @GEANT4_USE_OPENGL_X11@) if(Geant4_vis_opengl_x11_FOUND) find_dependency(X11) include("${CMAKE_CURRENT_LIST_DIR}/G4X11Shim.cmake") - find_dependency(OpenGL) if(APPLE) find_dependency(XQuartzGL) + else() + find_dependency(OpenGL) endif() if(("vis_opengl_x11" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_vis_all_FOUND) @@ -515,26 +535,31 @@ endif() set(Geant4_vis_openinventor_FOUND @GEANT4_USE_INVENTOR@) set(Geant4_vis_openinventor_qt_FOUND @GEANT4_USE_INVENTOR_QT@) if(Geant4_vis_openinventor_FOUND) + find_dependency(Coin) + + if(Geant4_vis_openinventor_qt_FOUND) + # Qt dependency handled by Geant4_vis_qt_FOUND earlier, + # always ON if Inventor_QT is + find_dependency(SoQt) + else() + if(WIN32) + find_dependency(SoWin) + else() + # Motif/X11/GL dependency handled by Geant4_motif_FOUND earlier, + # always ON if Inventor/Xt is. + find_dependency(SoXt) + endif() + endif() + if(("vis_openinventor" IN_LIST Geant4_FIND_COMPONENTS) OR Geant4_vis_all_FOUND) - if(UNIX AND NOT WIN32) - if(Geant4_vis_openinventor_qt_FOUND) - list(APPEND Geant4_DEFINITIONS - -DG4VIS_USE_OI - -DG4VIS_USE_OIQT - ) + if(Geant4_vis_openinventor_qt_FOUND) + list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_OI -DG4VIS_USE_OIQT) + else() + if(WIN32) + list(APPEND Geant4_DEFINITIONS -G4INTY_USE_WIN32 -DG4VIS_USE_OI -DG4VIS_USE_OIWIN32) else() - list(APPEND Geant4_DEFINITIONS - -DG4INTY_USE_XT - -DG4VIS_USE_OI - -DG4VIS_USE_OIX - ) + list(APPEND Geant4_DEFINITIONS -DG4INTY_USE_XT -DG4VIS_USE_OI -DG4VIS_USE_OIX) endif() - elseif(WIN32) - list(APPEND Geant4_DEFINITIONS - -G4INTY_USE_WIN32 - -DG4VIS_USE_OI - -DG4VIS_USE_OIWIN32 - ) endif() set(_geant4_use_inventor_library ON) @@ -601,6 +626,14 @@ if(_geant4_use_opengl_library) list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_OPENGL) endif() +# - Qt3D if it's requested. +if(_geant4_use_qt3D_library) + list(APPEND _geant4_internal_libraries + Geant4::G4visQt3D${_geant4_lib_use_suffix} + ) + list(APPEND Geant4_DEFINITIONS -DG4VIS_USE_QT3D) +endif() + # - G4OpenInventor if it's requested. if(_geant4_use_inventor_library) list(APPEND _geant4_internal_libraries diff --git a/cmake/Templates/geant4-config.in b/cmake/Templates/geant4-config.in index 45502b0db1..7716e7ad50 100644 --- a/cmake/Templates/geant4-config.in +++ b/cmake/Templates/geant4-config.in @@ -8,7 +8,7 @@ #----------------------------------------------------------------------- # Determine location of this script. # NB, we don't always use the result of this calculation, but it does not -# hurt to do it. Only possible error is if too long a chain of symbolic +# hurt to do it. Only possible error is if too long a chain of symbolic # links are used to point to the physical script. # # Resolve symbolic links to script - we should end up with a physical file @@ -32,8 +32,8 @@ while [ "x`readlink $script`" != "x" ] ; do fi done -# If we still have a relative path, then it must be relative to the -# calling dir. NB we don't attempt to resolve directory symbolic +# If we still have a relative path, then it must be relative to the +# calling dir. NB we don't attempt to resolve directory symbolic # links or remove '.' or '..' if [ ${script##/} = ${script##~} ] ; then script="$calldir/$script" @@ -102,6 +102,10 @@ if test "x${have_smartstack}" = "xyes" ; then cflags="-DG4_USESMARTSTACK ${cflags}" fi +# - ParticleHP was built as HP. Pure feature +have_php_as_hp="@G4_BUILTWITH_PHP_AS_HP@" +feature_list="${feature_list} php_as_hp[${have_php_as_hp}]" + # - Includes and Libs for g4incdir in ${includedirs} ; do cflags="${cflags} -I${g4incdir}" @@ -200,6 +204,12 @@ if test "x${have_qt}" = "xyes" ; then vis_cflags="${vis_cflags} \ -DG4INTY_USE_QT -DG4UI_USE_QT -DG4VIS_USE_OPENGLQT @G4_QT_CFLAGS@" +if test "x${qt_version}" \< "5.15.0" ; then + vis_libs="-lG4visQt3D ${vis_libs}" + libs="-lG4visQt3D ${libs}" + vis_cflags="${vis_cflags} -DG4UI_USE_QT3D" +fi + geant4_uses_opengl="yes" fi @@ -395,7 +405,7 @@ install_datasets() # Unpack bundle echo "+ untar ${dataset_file}" - ${G4TAR} -C ${g4downloaddir} -xf ${g4downloaddir}/${dataset_file} + ${G4TAR} -C ${g4downloaddir} -xf ${g4downloaddir}/${dataset_file} tar_status="$?" if [ "$tar_status" != "0" ] ; then echo "- untar of '${dataset_file}' failed : tar error $?" @@ -601,6 +611,9 @@ while test $# -gt 0 ; do openinventor) echo ${have_openinventor} ;; + php_as_hp) + echo ${have_php_as_hp} + ;; *) echo "no" ;; diff --git a/config/G4VIS_BUILD.gmk b/config/G4VIS_BUILD.gmk index c8c00e3059..fb22a00cfd 100644 --- a/config/G4VIS_BUILD.gmk +++ b/config/G4VIS_BUILD.gmk @@ -78,6 +78,11 @@ ifdef G4VIS_BUILD_OI_DRIVER INC_IV = 1 CPPFLAGS += -DG4VIS_BUILD_OI_DRIVER endif +ifdef G4VIS_BUILD_QT3D_DRIVER + G4INTY_BUILD_QT = 1 + INC_QT = 1 + CPPFLAGS += -DG4VIS_BUILD_QT3D_DRIVER +endif ifdef G4VIS_BUILD_RAYTRACERX_DRIVER CPPFLAGS += -DG4VIS_BUILD_RAYTRACERX_DRIVER diff --git a/config/G4VIS_USE.gmk b/config/G4VIS_USE.gmk index 64b69c9fcd..8119408c2f 100644 --- a/config/G4VIS_USE.gmk +++ b/config/G4VIS_USE.gmk @@ -118,6 +118,16 @@ ifdef G4VIS_USE_OI G4LIB_USE_GL2PS = 1 endif +ifdef G4VIS_USE_QT3D + CPPFLAGS += -DG4VIS_USE_QT3D + VISLIBS += -lG4visQt3D + ifneq ($(G4INCLUDE_EXEC),1) + CPPFLAGS += -I$(G4BASE)/visualization/Qt3D/include + endif + INC_QT = 1 + LOAD_3DQT = 1 +endif + ifdef G4VIS_USE_RAYTRACERX CPPFLAGS += -DG4VIS_USE_RAYTRACERX # CPPFLAGS += -I... and VISLIBS += set above. diff --git a/config/History b/config/History index 16a5281bcd..0ecb22b815 100644 --- a/config/History +++ b/config/History @@ -15,6 +15,9 @@ committal in the CVS repository ! * Reverse chronological order (last date on top), please * ---------------------------------------------------------- +22nd October 2020 Gabriele Cosmo (config-V10-06-07) +- Added configuration for Qt3D visualization driver. + 22nd June 2020 Gabriele Cosmo (config-V10-06-06) - Added -pthread to all builds in Linux targets. diff --git a/config/interactivity.gmk b/config/interactivity.gmk index 1691040148..8b263e5f65 100644 --- a/config/interactivity.gmk +++ b/config/interactivity.gmk @@ -31,6 +31,9 @@ endif ifdef LOAD_QT INTYLIBS += $(QTLIBS) endif +ifdef LOAD_3DQT + INTYLIBS += $(QT3DLIBS) +endif ifdef LOAD_GLQT INTYLIBS += $(GLQTLIBS) endif diff --git a/config/sys/Darwin-clang.gmk b/config/sys/Darwin-clang.gmk index ddec29465b..2391ec38af 100644 --- a/config/sys/Darwin-clang.gmk +++ b/config/sys/Darwin-clang.gmk @@ -105,9 +105,13 @@ ifeq ($(G4SYSTEM),Darwin-clang) QTMOC := /usr/bin/moc endif ifndef QTFLAGS - QTFLAGS := -I $(QTHOME)/QtCore.framework/Headers - QTFLAGS += -I $(QTHOME)/QtGui.framework/Headers + QTFLAGS := -I $(QTHOME)/QtCore.framework/Headers + QTFLAGS += -I $(QTHOME)/QtGui.framework/Headers + QTFLAGS += -I $(QTHOME)/QtWidgets.framework/Headers QTFLAGS += -I $(QTHOME)/QtOpenGL.framework/Headers + QTFLAGS += -I $(QTHOME)/Qt3DCore.framework/Headers + QTFLAGS += -I $(QTHOME)/Qt3DExtras.framework/Headers + QTFLAGS += -I $(QTHOME)/Qt3DRender.framework/Headers QTFLAGS += -I $(QTHOME)/include/Qt -I$(QTHOME)/include endif ifndef QTLIBPATH @@ -122,12 +126,20 @@ ifeq ($(G4SYSTEM),Darwin-clang) QTLIBS := -L$(QTLPATH) -lQtCore -lQtGui endif endif + ifndef QT3DLIBS + ifdef QT_AS_FRAMEWORK + QT3DLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui + QT3DLIBS += -framework QtWidgets -framework Qt3DCore -framework Qt3DExtras -framework Qt3DRender + else + QT3DLIBS := -L$(QTLPATH) -lQtCore -lQtGui + QT3DLIBS += -lQtWidgets -lQt3DCore -lQt3DExtras -lQt3DRender + endif + endif ifndef GLQTLIBS ifdef QT_AS_FRAMEWORK - GLQTLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui - GLQTLIBS += -framework QtOpenGL + GLQTLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui -framework QtOpenGL else - GLQTLIBS := -L$(QTLPATH) -lQtCore -lQtGui -lQtOpenGL + GLQTLIBS := -L$(QTLPATH) -lQtCore -lQtGui -lQtOpenGL endif endif else @@ -140,6 +152,9 @@ ifeq ($(G4SYSTEM),Darwin-clang) QTFLAGS += -I $(QTLPATH)/QtGui.framework/Headers QTFLAGS += -I $(QTLPATH)/QtWidgets.framework/Headers QTFLAGS += -I $(QTLPATH)/QtOpenGL.framework/Headers + QTFLAGS += -I $(QTLPATH)/Qt3DCore.framework/Headers + QTFLAGS += -I $(QTLPATH)/Qt3DExtras.framework/Headers + QTFLAGS += -I $(QTLPATH)/Qt3DRender.framework/Headers QTFLAGS += -I $(QTLPATH)/QtPrintSupport.framework/Headers QTFLAGS += -I $(QTHOME)/include/Qt -I$(QTHOME)/include endif @@ -147,6 +162,12 @@ ifeq ($(G4SYSTEM),Darwin-clang) QTLIBS := -F$(QTLPATH) -framework QtCore -framework QtGui QTLIBS += -framework QtWidgets -framework QtPrintSupport endif + ifndef QT3DLIBS + QT3DLIBS := -F$(QTLPATH) -framework QtCore -framework QtGui + QT3DLIBS += -framework QtWidgets + QT3DLIBS += -framework Qt3DCore -framework Qt3DExtras -framework Qt3DRender + QT3DLIBS += -framework QtPrintSupport + endif ifndef GLQTLIBS GLQTLIBS := -F$(QTLPATH) -framework QtCore -framework QtGui GLQTLIBS += -framework QtWidgets diff --git a/config/sys/Darwin-g++.gmk b/config/sys/Darwin-g++.gmk index dda03b2a4c..a1b73d5f58 100644 --- a/config/sys/Darwin-g++.gmk +++ b/config/sys/Darwin-g++.gmk @@ -131,9 +131,13 @@ ifeq ($(G4SYSTEM),Darwin-g++) QTMOC := /usr/bin/moc endif ifndef QTFLAGS - QTFLAGS := -I $(QTHOME)/QtCore.framework/Headers - QTFLAGS += -I $(QTHOME)/QtGui.framework/Headers + QTFLAGS := -I $(QTHOME)/QtCore.framework/Headers + QTFLAGS += -I $(QTHOME)/QtGui.framework/Headers + QTFLAGS += -I $(QTHOME)/QtWidgets.framework/Headers QTFLAGS += -I $(QTHOME)/QtOpenGL.framework/Headers + QTFLAGS += -I $(QTHOME)/Qt3DCore.framework/Headers + QTFLAGS += -I $(QTHOME)/Qt3DExtras.framework/Headers + QTFLAGS += -I $(QTHOME)/Qt3DRender.framework/Headers QTFLAGS += -I $(QTHOME)/include/Qt -I$(QTHOME)/include endif ifndef QTLIBPATH @@ -148,12 +152,20 @@ ifeq ($(G4SYSTEM),Darwin-g++) QTLIBS := -L$(QTLPATH) -lQtCore -lQtGui endif endif + ifndef QT3DLIBS + ifdef QT_AS_FRAMEWORK + QT3DLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui + QT3DLIBS += -framework QtWidgets -framework Qt3DCore -framework Qt3DExtras -framework Qt3DRender + else + QT3DLIBS := -L$(QTLPATH) -lQtCore -lQtGui + QT3DLIBS += -lQtWidgets -lQt3DCore -lQt3DExtras -lQt3DRender + endif + endif ifndef GLQTLIBS ifdef QT_AS_FRAMEWORK - GLQTLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui - GLQTLIBS += -framework QtOpenGL + GLQTLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui -framework QtOpenGL else - GLQTLIBS := -L$(QTLPATH) -lQtCore -lQtGui -lQtOpenGL + GLQTLIBS := -L$(QTLPATH) -lQtCore -lQtGui -lQtOpenGL endif endif else @@ -166,6 +178,9 @@ ifeq ($(G4SYSTEM),Darwin-g++) QTFLAGS += -I $(QTLPATH)/QtGui.framework/Headers QTFLAGS += -I $(QTLPATH)/QtWidgets.framework/Headers QTFLAGS += -I $(QTLPATH)/QtOpenGL.framework/Headers + QTFLAGS += -I $(QTLPATH)/Qt3DCore.framework/Headers + QTFLAGS += -I $(QTLPATH)/Qt3DExtras.framework/Headers + QTFLAGS += -I $(QTLPATH)/Qt3DRender.framework/Headers QTFLAGS += -I $(QTLPATH)/QtPrintSupport.framework/Headers QTFLAGS += -I $(QTHOME)/include/Qt -I$(QTHOME)/include endif @@ -173,6 +188,12 @@ ifeq ($(G4SYSTEM),Darwin-g++) QTLIBS := -F$(QTLPATH) -framework QtCore -framework QtGui QTLIBS += -framework QtWidgets -framework QtPrintSupport endif + ifndef QT3DLIBS + QT3DLIBS := -F$(QTLPATH) -framework QtCore -framework QtGui + QT3DLIBS += -framework QtWidgets + QT3DLIBS += -framework Qt3DCore -framework Qt3DExtras -framework Qt3DRender + QT3DLIBS += -framework QtPrintSupport + endif ifndef GLQTLIBS GLQTLIBS := -F$(QTLPATH) -framework QtCore -framework QtGui GLQTLIBS += -framework QtWidgets diff --git a/config/sys/Linux-clang.gmk b/config/sys/Linux-clang.gmk index 8ef23306af..65406a2f73 100644 --- a/config/sys/Linux-clang.gmk +++ b/config/sys/Linux-clang.gmk @@ -110,6 +110,9 @@ ifeq ($(G4SYSTEM),Linux-clang) QTFLAGS += -I $(QTHOME)/include/QtGui QTFLAGS += -I $(QTHOME)/include/QtWidgets QTFLAGS += -I $(QTHOME)/include/QtOpenGL + QTFLAGS += -I $(QTHOME)/include/Qt3DCore + QTFLAGS += -I $(QTHOME)/include/Qt3DExtras + QTFLAGS += -I $(QTHOME)/include/Qt3DRender QTFLAGS += -I $(QTHOME)/include/QtPrintSupport endif else # Qt4 @@ -131,6 +134,9 @@ ifeq ($(G4SYSTEM),Linux-clang) ifndef QTLIBS # Qt5 QTLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets -lQt5PrintSupport endif + ifndef QT3DLIBS + QT3DLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets -lQt53DCore -lQt53DExtras -lQt53DRender -lQt5PrintSupport + endif ifndef GLQTLIBS GLQTLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets -lQt5OpenGL -lQt5PrintSupport endif diff --git a/config/sys/Linux-g++.gmk b/config/sys/Linux-g++.gmk index d23b0e2488..163197615d 100644 --- a/config/sys/Linux-g++.gmk +++ b/config/sys/Linux-g++.gmk @@ -108,6 +108,9 @@ ifeq ($(G4SYSTEM),Linux-g++) QTFLAGS += -I $(QTHOME)/include/QtGui QTFLAGS += -I $(QTHOME)/include/QtWidgets QTFLAGS += -I $(QTHOME)/include/QtOpenGL + QTFLAGS += -I $(QTHOME)/include/Qt3DCore + QTFLAGS += -I $(QTHOME)/include/Qt3DExtras + QTFLAGS += -I $(QTHOME)/include/Qt3DRender QTFLAGS += -I $(QTHOME)/include/QtPrintSupport endif else # Qt4 @@ -129,6 +132,9 @@ ifeq ($(G4SYSTEM),Linux-g++) ifndef QTLIBS # Qt5 QTLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets -lQt5PrintSupport endif + ifndef QT3DLIBS + QT3DLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets -lQt53DCore -lQt53DExtras -lQt53DRender -lQt5PrintSupport + endif ifndef GLQTLIBS GLQTLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets -lQt5OpenGL -lQt5PrintSupport endif diff --git a/environments/g4py/CMakeLists.txt b/environments/g4py/CMakeLists.txt index d9dea8f61a..d4de53a8c1 100644 --- a/environments/g4py/CMakeLists.txt +++ b/environments/g4py/CMakeLists.txt @@ -8,7 +8,7 @@ # which Python an install of Boost Python uses)... find_package(PythonInterp 3.0 REQUIRED) find_package(PythonLibs REQUIRED) -find_package(Boost REQUIRED python) +find_package(Boost 1.65 REQUIRED python) # Variables and Functions to help build, organise, and install modules include(${CMAKE_CURRENT_SOURCE_DIR}/G4PythonHelpers.cmake) diff --git a/environments/g4py/G4PythonHelpers.cmake b/environments/g4py/G4PythonHelpers.cmake index b7c149a4c2..e1d2048f59 100644 --- a/environments/g4py/G4PythonHelpers.cmake +++ b/environments/g4py/G4PythonHelpers.cmake @@ -4,7 +4,8 @@ # any substructure set(GEANT4_PYTHON_OUTPUT_DIR "$/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages") -set(CMAKE_INSTALL_PYTHONDIR "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages") +set(CMAKE_INSTALL_PYTHONDIR "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages" CACHE PATH "Python modules/packages") +mark_as_advanced(CMAKE_INSTALL_PYTHONDIR) if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_PYTHONDIR}") set(CMAKE_INSTALL_FULL_PYTHONDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_PYTHONDIR}") else() @@ -40,6 +41,10 @@ function(g4py_add_module target_name) # to be checked for Windows) target_include_directories(${target_name} PRIVATE ${PYTHON_INCLUDE_DIRS}) target_link_libraries(${target_name} PRIVATE Boost::python "$<$:-undefined dynamic_lookup>") + + # Workaround to suppress pragma message spam in Boost >= 1.73 + # - See https://github.com/boostorg/python/pull/315 + target_compile_definitions(${target_name} PRIVATE BOOST_BIND_GLOBAL_PLACEHOLDERS) endfunction() diff --git a/environments/g4py/History b/environments/g4py/History index 612f1b1033..690bfd6f1c 100644 --- a/environments/g4py/History +++ b/environments/g4py/History @@ -11,6 +11,25 @@ Geant4Py is a Geant4-Python bridge. * Reverse chronological order (last date on top), please * ---------------------------------------------------------- +16 Nov. 2020 B. Morgan (geant4py-V10-06-04) +- Boost 1.73 modified use of its bind and placeholder functionality, resulting + in Boost.Python spamming pragma messages about deprecation of this. + See https://github.com/boostorg/python/pull/315. Add BOOST_BIND_GLOBAL_PLACEHOLDERS + as a private compile definition to geant4py targets to suppress these. + +11 Nov. 2020 B. Morgan (geant4py-V10-06-03) +- Address Bugzilla 2283 +- Make CMAKE_INSTALL_PYTHONDIR a user-configurable cache variable +- RPATH issue is addressed by use of CMAKE_SKIP_INSTALL_RPATH variable by client + +6 Oct. 2020 B. Morgan (geant4py-V10-06-02) +- Add binding to G4PhysListFactory (GitHub PR #14, contributed by Daniel Hellfeld) +- Add simple test case of binding. + +25 Aug. 2020 B. Morgan (geant4py-V10-06-01) +- Remove obsolete boost.python indexing suite. Only required on + very old Boost versions <= 1.33 + 19 Mar. 2020 B. Morgan (geant4py-V10-06-00) - Integrate build, test, and install of geant4py with core Geant4 CMake buildsystem. diff --git a/environments/g4py/examples/education/lesson1/demo.py b/environments/g4py/examples/education/lesson1/demo.py old mode 100644 new mode 100755 diff --git a/environments/g4py/source/CMakeLists.txt b/environments/g4py/source/CMakeLists.txt index d19cd0d730..03480a5a50 100644 --- a/environments/g4py/source/CMakeLists.txt +++ b/environments/g4py/source/CMakeLists.txt @@ -1,8 +1,4 @@ # - add libs components -# Private interface library to help Boost.Python usage -add_library(pyG4Boost INTERFACE) -target_include_directories(pyG4Boost INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/boost") - # Core Geant4 bindings add_subdirectory(global) add_subdirectory(interface) diff --git a/environments/g4py/source/boost/container_utils.hpp b/environments/g4py/source/boost/container_utils.hpp deleted file mode 100644 index a25185d077..0000000000 --- a/environments/g4py/source/boost/container_utils.hpp +++ /dev/null @@ -1,52 +0,0 @@ - -// (C) Copyright Joel de Guzman 2003. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef PY_CONTAINER_UTILS_JDG20038_HPP -# define PY_CONTAINER_UTILS_JDG20038_HPP - -# include -# include -# include - -namespace boost { namespace python { namespace container_utils { - - template - void - extend_container(Container& container, object l) - { - typedef typename Container::value_type data_type; - - // l must be a list or some container - - for (int i = 0; i < l.attr("__len__")(); i++) - { - object elem(l[i]); - extract x(elem); - // try if elem is an exact data_type type - if (x.check()) - { - container.push_back(x()); - } - else - { - // try to convert elem to data_type type - extract x(elem); - if (x.check()) - { - container.push_back(x()); - } - else - { - PyErr_SetString(PyExc_TypeError, "Incompatible Data Type"); - throw_error_already_set(); - } - } - } - } - -}}} // namespace boost::python::container_utils - -#endif diff --git a/environments/g4py/source/boost/detail/indexing_suite_detail.hpp b/environments/g4py/source/boost/detail/indexing_suite_detail.hpp deleted file mode 100644 index bf4fe91c68..0000000000 --- a/environments/g4py/source/boost/detail/indexing_suite_detail.hpp +++ /dev/null @@ -1,759 +0,0 @@ -// (C) Copyright Joel de Guzman 2003. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef INDEXING_SUITE_DETAIL_JDG20036_HPP -# define INDEXING_SUITE_DETAIL_JDG20036_HPP - -# include -# include -# include -# include -# include -# include -# include -# include -#include - -namespace boost { namespace python { namespace detail { - -#if defined(NDEBUG) -#define BOOST_PYTHON_INDEXING_CHECK_INVARIANT -#else -#define BOOST_PYTHON_INDEXING_CHECK_INVARIANT check_invariant() -#endif - - template - struct compare_proxy_index - { - // This functor compares a proxy and an index. - // This is used by proxy_group::first_proxy to - // get first proxy with index i. - - template - bool operator()(PyObject* prox, Index i) const - { - typedef typename Proxy::policies_type policies_type; - Proxy& proxy = extract(prox)(); - return policies_type:: - compare_index(proxy.get_container(), proxy.get_index(), i); - } - }; - - // The proxy_group class holds a vector of container element - // proxies. First, what is a container element proxy? A container - // element proxy acts like a smart pointer holding a reference to - // a container and an index (see container_element, for details). - // - // The proxies are held in a vector always sorted by its index. - // Various functions manage the addition, removal and searching - // of proxies from the vector. - // - template - class proxy_group - { - public: - - typedef typename std::vector::const_iterator const_iterator; - typedef typename std::vector::iterator iterator; - typedef typename Proxy::index_type index_type; - typedef typename Proxy::policies_type policies_type; - - iterator - first_proxy(index_type i) - { - // Return the first proxy with index <= i - return boost::detail::lower_bound( - proxies.begin(), proxies.end(), - i, compare_proxy_index()); - } - - void - remove(Proxy& proxy) - { - // Remove a proxy - for (iterator iter = first_proxy(proxy.get_index()); - iter != proxies.end(); ++iter) - { - if (&extract(*iter)() == &proxy) - { - proxies.erase(iter); - break; - } - } - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - } - - void - add(PyObject* prox) - { - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - // Add a proxy - proxies.insert( - first_proxy(extract(prox)().get_index()), prox); - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - } - - void - erase(index_type i, mpl::false_) - { - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - // Erase the proxy with index i - replace(i, i+1, 0); - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - } - - void - erase(index_type i, mpl::true_) - { - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - // Erase the proxy with index i - - iterator iter = first_proxy(i); - extract p(*iter); - - if (iter != proxies.end() && p().get_index() == i) - { - extract p(*iter); - p().detach(); - proxies.erase(iter); - } - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - } - - void - erase(index_type from, index_type to) - { - // note: this cannot be called when container is not sliceable - - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - // Erase all proxies with indexes from..to - replace(from, to, 0); - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - } - - void - replace( - index_type from, - index_type to, - typename std::vector::size_type len) - { - // note: this cannot be called when container is not sliceable - - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - // Erase all proxies with indexes from..to. - // Adjust the displaced indexes such that the - // final effect is that we have inserted *len* - // number of proxies in the vacated region. This - // procedure involves adjusting the indexes of - // the proxies. - - iterator left = first_proxy(from); - iterator right = proxies.end(); // we'll adjust this later - - for (iterator iter = left; iter != right; ++iter) - { - if (extract(*iter)().get_index() > to) - { - right = iter; // adjust right - break; - } - extract p(*iter); - p().detach(); - } - - typename std::vector::size_type - offset = left-proxies.begin(); - proxies.erase(left, right); - right = proxies.begin()+offset; - - while (right != proxies.end()) - { - typedef typename Proxy::container_type::difference_type difference_type; - extract p(*right); - p().set_index( - extract(*right)().get_index() - - (difference_type(to) - from - len) - ); - - ++right; - } - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - } - - PyObject* - find(index_type i) - { - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - // Find the proxy with *exact* index i. - // Return 0 (null) if no proxy with the - // given index is found. - iterator iter = first_proxy(i); - if (iter != proxies.end() - && extract(*iter)().get_index() == i) - { - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - return *iter; - } - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - return 0; - } - - typename std::vector::size_type - size() const - { - BOOST_PYTHON_INDEXING_CHECK_INVARIANT; - // How many proxies are there so far? - return proxies.size(); - } - - private: - -#if !defined(NDEBUG) - void - check_invariant() const - { - for (const_iterator i = proxies.begin(); i != proxies.end(); ++i) - { - if ((*i)->ob_refcnt <= 0) - { - PyErr_SetString(PyExc_RuntimeError, - "Invariant: Proxy vector in an inconsistent state"); - throw_error_already_set(); - } - - if (i+1 != proxies.end()) - { - if (extract(*(i+1))().get_index() == - extract(*(i))().get_index()) - { - PyErr_SetString(PyExc_RuntimeError, - "Invariant: Proxy vector in an inconsistent state (duplicate proxy)"); - throw_error_already_set(); - } - } - } - } -#endif - - std::vector proxies; - }; - - // proxy_links holds a map of Container pointers (keys) - // with proxy_group(s) (data). Various functions manage - // the addition, removal and searching of proxies from - // the map. - // - template - class proxy_links - { - public: - - typedef std::map > links_t; - typedef typename Proxy::index_type index_type; - - void - remove(Proxy& proxy) - { - // Remove a proxy. - typename links_t::iterator r = links.find(&proxy.get_container()); - if (r != links.end()) - { - r->second.remove(proxy); - if (r->second.size() == 0) - links.erase(r); - } - } - - void - add(PyObject* prox, Container& container) - { - // Add a proxy - links[&container].add(prox); - } - - template - void erase(Container& container, index_type i, NoSlice no_slice) - { - // Erase the proxy with index i - typename links_t::iterator r = links.find(&container); - if (r != links.end()) - { - r->second.erase(i, no_slice); - if (r->second.size() == 0) - links.erase(r); - } - } - - void - erase(Container& container, index_type from, index_type to) - { - // Erase all proxies with indexes from..to - typename links_t::iterator r = links.find(&container); - if (r != links.end()) - { - r->second.erase(from, to); - if (r->second.size() == 0) - links.erase(r); - } - } - - void - replace( - Container& container, - index_type from, index_type to, index_type len) - { - // Erase all proxies with indexes from..to. - // Adjust the displaced indexes such that the - // final effect is that we have inserted *len* - // number of proxies in the vacated region. This - // procedure involves adjusting the indexes of - // the proxies. - - typename links_t::iterator r = links.find(&container); - if (r != links.end()) - { - r->second.replace(from, to, len); - if (r->second.size() == 0) - links.erase(r); - } - } - - PyObject* - find(Container& container, index_type i) - { - // Find the proxy with *exact* index i. - // Return 0 (null) if no proxy with the given - // index is found. - typename links_t::iterator r = links.find(&container); - if (r != links.end()) - return r->second.find(i); - return 0; - } - - private: - - links_t links; - }; - - // container_element is our container proxy class. - // This class acts like a smart pointer to a container - // element. The class holds an index and a reference to - // a container. Dereferencing the smart pointer will - // retrieve the nth (index) element from the container. - // - // A container_element can also be detached from the - // container. In such a detached state, the container_element - // holds a copy of the nth (index) element, which it - // returns when dereferenced. - // - template - class container_element - { - public: - - typedef Index index_type; - typedef Container container_type; - typedef typename Policies::data_type element_type; - typedef Policies policies_type; - typedef container_element self_t; - typedef proxy_group links_type; - - container_element(object container, Index index) - : ptr() - , container(container) - , index(index) - { - } - - container_element(container_element const& ce) - : ptr(ce.ptr.get() == 0 ? 0 : new element_type(*ce.ptr.get())) - , container(ce.container) - , index(ce.index) - { - } - - ~container_element() - { - if (!is_detached()) - get_links().remove(*this); - } - - element_type& operator*() const - { - if (is_detached()) - return *get_pointer(ptr); - return Policies::get_item(get_container(), index); - } - - element_type* get() const - { - if (is_detached()) - return get_pointer(ptr); - return &Policies::get_item(get_container(), index); - } - - void - detach() - { - if (!is_detached()) - { - ptr.reset( - new element_type( - Policies::get_item(get_container(), index))); - container = object(); // free container. reset it to None - } - } - - bool - is_detached() const - { - return get_pointer(ptr) != 0; - } - - Container& - get_container() const - { - return extract(container)(); - } - - Index - get_index() const - { - return index; - } - - void - set_index(Index i) - { - index = i; - } - - static proxy_links& - get_links() - { - // All container_element(s) maintain links to - // its container in a global map (see proxy_links). - // This global "links" map is a singleton. - - static proxy_links links; - return links; // singleton - } - - private: - - container_element& operator=(container_element const& ce); - - scoped_ptr ptr; - object container; - Index index; - }; - - template < - class Container - , class DerivedPolicies - , class ContainerElement - , class Index - > - struct no_proxy_helper - { - static void - register_container_element() - { - } - - template - static object - base_get_item_helper(DataType const& p, mpl::true_) - { - return object(ptr(p)); - } - - template - static object - base_get_item_helper(DataType const& x, mpl::false_) - { - return object(x); - } - - static object - base_get_item_(back_reference const& container, PyObject* i) - { - return base_get_item_helper( - DerivedPolicies::get_item( - container.get(), DerivedPolicies:: - convert_index(container.get(), i)) - , is_pointer() - ); - } - - static void - base_replace_indexes( - Container& container, Index from, - Index to, Index n) - { - } - - template - static void - base_erase_index( - Container& container, Index i, NoSlice no_slice) - { - } - - static void - base_erase_indexes(Container& container, Index from, Index to) - { - } - }; - - template < - class Container - , class DerivedPolicies - , class ContainerElement - , class Index - > - struct proxy_helper - { - static void - register_container_element() - { - register_ptr_to_python(); - } - - static object - base_get_item_(back_reference const& container, PyObject* i) - { - // Proxy - Index idx = DerivedPolicies::convert_index(container.get(), i); - - if (PyObject* shared = - ContainerElement::get_links().find(container.get(), idx)) - { - handle<> h(python::borrowed(shared)); - return object(h); - } - else - { - object prox(ContainerElement(container.source(), idx)); - ContainerElement:: - get_links().add(prox.ptr(), container.get()); - return prox; - } - } - - static void - base_replace_indexes( - Container& container, Index from, - Index to, Index n) - { - ContainerElement::get_links().replace(container, from, to, n); - } - - template - static void - base_erase_index( - Container& container, Index i, NoSlice no_slice) - { - ContainerElement::get_links().erase(container, i, no_slice); - } - - static void - base_erase_indexes( - Container& container, Index from, Index to) - { - ContainerElement::get_links().erase(container, from, to); - } - }; - - template < - class Container - , class DerivedPolicies - , class ProxyHandler - , class Data - , class Index - > - struct slice_helper - { - static object - base_get_slice(Container& container, PySliceObject* slice) - { - Index from, to; - base_get_slice_data(container, slice, from, to); - return DerivedPolicies::get_slice(container, from, to); - } - - static void - base_get_slice_data( - Container& container, PySliceObject* slice, Index& from_, Index& to_) - { - if (Py_None != slice->step) { - PyErr_SetString( PyExc_IndexError, "slice step size not supported."); - throw_error_already_set(); - } - - Index min_index = DerivedPolicies::get_min_index(container); - Index max_index = DerivedPolicies::get_max_index(container); - - if (Py_None == slice->start) { - from_ = min_index; - } - else { - long from = extract( slice->start); - if (from < 0) // Negative slice index - from += max_index; - if (from < 0) // Clip lower bounds to zero - from = 0; - from_ = boost::numeric_cast(from); - if (from_ > max_index) // Clip upper bounds to max_index. - from_ = max_index; - } - - if (Py_None == slice->stop) { - to_ = max_index; - } - else { - long to = extract( slice->stop); - if (to < 0) - to += max_index; - if (to < 0) - to = 0; - to_ = boost::numeric_cast(to); - if (to_ > max_index) - to_ = max_index; - } - } - - static void - base_set_slice(Container& container, PySliceObject* slice, PyObject* v) - { - Index from, to; - base_get_slice_data(container, slice, from, to); - - extract elem(v); - // try if elem is an exact Data - if (elem.check()) - { - ProxyHandler::base_replace_indexes(container, from, to, 1); - DerivedPolicies::set_slice(container, from, to, elem()); - } - else - { - // try to convert elem to Data - extract elem(v); - if (elem.check()) - { - ProxyHandler::base_replace_indexes(container, from, to, 1); - DerivedPolicies::set_slice(container, from, to, elem()); - } - else - { - // Otherwise, it must be a list or some container - handle<> l_(python::borrowed(v)); - object l(l_); - - std::vector temp; - for (int i = 0; i < l.attr("__len__")(); i++) - { - object elem(l[i]); - extract x(elem); - // try if elem is an exact Data type - if (x.check()) - { - temp.push_back(x()); - } - else - { - // try to convert elem to Data type - extract x(elem); - if (x.check()) - { - temp.push_back(x()); - } - else - { - PyErr_SetString(PyExc_TypeError, - "Invalid sequence element"); - throw_error_already_set(); - } - } - } - - ProxyHandler::base_replace_indexes(container, from, to, - temp.end()-temp.begin()); - DerivedPolicies::set_slice(container, from, to, - temp.begin(), temp.end()); - } - } - } - - static void - base_delete_slice(Container& container, PySliceObject* slice) - { - Index from, to; - base_get_slice_data(container, slice, from, to); - ProxyHandler::base_erase_indexes(container, from, to); - DerivedPolicies::delete_slice(container, from, to); - } - }; - - template < - class Container - , class DerivedPolicies - , class ProxyHandler - , class Data - , class Index - > - struct no_slice_helper - { - static void - slicing_not_suported() - { - PyErr_SetString(PyExc_RuntimeError, "Slicing not supported"); - throw_error_already_set(); - } - - static object - base_get_slice(Container& container, PySliceObject* slice) - { - slicing_not_suported(); - return object(); - } - - static void - base_set_slice(Container& container, PySliceObject* slice, PyObject* v) - { - slicing_not_suported(); - } - - static void - base_delete_slice(Container& container, PySliceObject* slice) - { - slicing_not_suported(); - } - }; - -#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -}} // namespace python::detail -#endif - - template - inline typename Policies::data_type* - get_pointer( - python::detail::container_element const& p) - { - // Get the pointer of a container_element smart pointer - return p.get(); - } - -#ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP - // Don't hide these other get_pointer overloads - using boost::python::get_pointer; - using boost::get_pointer; -}} // namespace python::detail -#endif - -} // namespace boost - -#endif // INDEXING_SUITE_DETAIL_JDG20036_HPP diff --git a/environments/g4py/source/boost/indexing_suite.hpp b/environments/g4py/source/boost/indexing_suite.hpp deleted file mode 100644 index 66172c0fcf..0000000000 --- a/environments/g4py/source/boost/indexing_suite.hpp +++ /dev/null @@ -1,293 +0,0 @@ -// (C) Copyright Joel de Guzman 2003. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef INDEXING_SUITE_JDG20036_HPP -# define INDEXING_SUITE_JDG20036_HPP - -# include -# include -# include -# include "detail/indexing_suite_detail.hpp" -# include -# include -# include -# include - -namespace boost { namespace python { - - // indexing_suite class. This class is the protocol class for - // the management of C++ containers intended to be integrated - // to Python. The objective is make a C++ container look and - // feel and behave exactly as we'd expect a Python container. - // By default indexed elements are returned by proxy. This can be - // disabled by supplying *true* in the NoProxy template parameter. - // - // Derived classes provide the hooks needed by the indexing_suite - // to do its job: - // - // static data_type& - // get_item(Container& container, index_type i); - // - // static object - // get_slice(Container& container, index_type from, index_type to); - // - // static void - // set_item(Container& container, index_type i, data_type const& v); - // - // static void - // set_slice( - // Container& container, index_type from, - // index_type to, data_type const& v - // ); - // - // template - // static void - // set_slice(Container& container, index_type from, - // index_type to, Iter first, Iter last - // ); - // - // static void - // delete_item(Container& container, index_type i); - // - // static void - // delete_slice(Container& container, index_type from, index_type to); - // - // static size_t - // size(Container& container); - // - // template - // static bool - // contains(Container& container, T const& val); - // - // static index_type - // convert_index(Container& container, PyObject* i); - // - // static index_type - // adjust_index(index_type current, index_type from, - // index_type to, size_type len - // ); - // - // Most of these policies are self explanatory. convert_index and - // adjust_index, however, deserves some explanation. - // - // convert_index converts an Python index into a C++ index that the - // container can handle. For instance, negative indexes in Python, by - // convention, indexes from the right (e.g. C[-1] indexes the rightmost - // element in C). convert_index should handle the necessary conversion - // for the C++ container (e.g. convert -1 to C.size()-1). convert_index - // should also be able to convert the type of the index (A dynamic Python - // type) to the actual type that the C++ container expects. - // - // When a container expands or contracts, held indexes to its elements - // must be adjusted to follow the movement of data. For instance, if - // we erase 3 elements, starting from index 0 from a 5 element vector, - // what used to be at index 4 will now be at index 1: - // - // [a][b][c][d][e] ---> [d][e] - // ^ ^ - // 4 1 - // - // adjust_index takes care of the adjustment. Given a current index, - // the function should return the adjusted index when data in the - // container at index from..to is replaced by *len* elements. - // - - template < - class Container - , class DerivedPolicies - , bool NoProxy = false - , bool NoSlice = false - , class Data = typename Container::value_type - , class Index = typename Container::size_type - , class Key = typename Container::value_type - > - class indexing_suite - : public def_visitor< - indexing_suite< - Container - , DerivedPolicies - , NoProxy - , NoSlice - , Data - , Index - , Key - > > - { - private: - - typedef mpl::or_< - mpl::bool_ - , mpl::not_ > > - no_proxy; - - typedef detail::container_element - container_element_t; - -#if BOOST_WORKAROUND(BOOST_MSVC, == 1200) - struct return_policy : return_internal_reference<> {}; -#else - typedef return_internal_reference<> return_policy; -#endif - - typedef typename mpl::if_< - no_proxy - , iterator - , iterator >::type - def_iterator; - - typedef typename mpl::if_< - no_proxy - , detail::no_proxy_helper< - Container - , DerivedPolicies - , container_element_t - , Index> - , detail::proxy_helper< - Container - , DerivedPolicies - , container_element_t - , Index> >::type - proxy_handler; - - typedef typename mpl::if_< - mpl::bool_ - , detail::no_slice_helper< - Container - , DerivedPolicies - , proxy_handler - , Data - , Index> - , detail::slice_helper< - Container - , DerivedPolicies - , proxy_handler - , Data - , Index> >::type - slice_handler; - - public: - - template - void visit(Class& cl) const - { - // Hook into the class_ generic visitation .def function - proxy_handler::register_container_element(); - - cl - .def("__len__", base_size) - .def("__setitem__", &base_set_item) - .def("__delitem__", &base_delete_item) - .def("__getitem__", &base_get_item) - .def("__contains__", &base_contains) - .def("__iter__", def_iterator()) - ; - - DerivedPolicies::extension_def(cl); - } - - template - static void - extension_def(Class& cl) - { - // default. - // no more extensions - } - - private: - - static object - base_get_item(back_reference container, PyObject* i) - { - if (PySlice_Check(i)) - return slice_handler::base_get_slice( - container.get(), reinterpret_cast(i)); - - return proxy_handler::base_get_item_(container, i); - } - - static void - base_set_item(Container& container, PyObject* i, PyObject* v) - { - if (PySlice_Check(i)) - { - slice_handler::base_set_slice(container, - reinterpret_cast(i), v); - } - else - { - extract elem(v); - // try if elem is an exact Data - if (elem.check()) - { - DerivedPolicies:: - set_item(container, - DerivedPolicies:: - convert_index(container, i), elem()); - } - else - { - // try to convert elem to Data - extract elem(v); - if (elem.check()) - { - DerivedPolicies:: - set_item(container, - DerivedPolicies:: - convert_index(container, i), elem()); - } - else - { - PyErr_SetString(PyExc_TypeError, "Invalid assignment"); - throw_error_already_set(); - } - } - } - } - - static void - base_delete_item(Container& container, PyObject* i) - { - if (PySlice_Check(i)) - { - slice_handler::base_delete_slice( - container, reinterpret_cast(i)); - return; - } - - Index index = DerivedPolicies::convert_index(container, i); - proxy_handler::base_erase_index(container, index, mpl::bool_()); - DerivedPolicies::delete_item(container, index); - } - - static size_t - base_size(Container& container) - { - return DerivedPolicies::size(container); - } - - static bool - base_contains(Container& container, PyObject* key) - { - extract x(key); - // try if key is an exact Key type - if (x.check()) - { - return DerivedPolicies::contains(container, x()); - } - else - { - // try to convert key to Key type - extract x(key); - if (x.check()) - return DerivedPolicies::contains(container, x()); - else - return false; - } - } - }; - -}} // namespace boost::python - -#endif // INDEXING_SUITE_JDG20036_HPP diff --git a/environments/g4py/source/boost/map_indexing_suite.hpp b/environments/g4py/source/boost/map_indexing_suite.hpp deleted file mode 100644 index 4657cfe0f7..0000000000 --- a/environments/g4py/source/boost/map_indexing_suite.hpp +++ /dev/null @@ -1,181 +0,0 @@ -// (C) Copyright Joel de Guzman 2003. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef MAP_INDEXING_SUITE_JDG20038_HPP -# define MAP_INDEXING_SUITE_JDG20038_HPP - -# include "indexing_suite.hpp" -# include -# include -# include - -namespace boost { namespace python { - - // Forward declaration - template - class map_indexing_suite; - - namespace detail - { - template - class final_map_derived_policies - : public map_indexing_suite > {}; - } - - // The map_indexing_suite class is a predefined indexing_suite derived - // class for wrapping std::vector (and std::vector like) classes. It provides - // all the policies required by the indexing_suite (see indexing_suite). - // Example usage: - // - // class X {...}; - // - // ... - // - // class_ >("XMap") - // .def(map_indexing_suite >()) - // ; - // - // By default indexed elements are returned by proxy. This can be - // disabled by supplying *true* in the NoProxy template parameter. - // - template < - class Container, - bool NoProxy = false, - class DerivedPolicies - = detail::final_map_derived_policies > - class map_indexing_suite - : public indexing_suite< - Container - , DerivedPolicies - , NoProxy - , true - , typename Container::value_type::second_type - , typename Container::key_type - , typename Container::key_type - > - { - public: - - typedef typename Container::value_type value_type; - typedef typename Container::value_type::second_type data_type; - typedef typename Container::key_type key_type; - typedef typename Container::key_type index_type; - typedef typename Container::size_type size_type; - typedef typename Container::difference_type difference_type; - - template - static void - extension_def(Class& cl) - { - // Wrap the map's element (value_type) - std::string elem_name = "map_indexing_suite_"; - object class_name(cl.attr("__name__")); - extract class_name_extractor(class_name); - elem_name += class_name_extractor(); - elem_name += "_entry"; - - typedef typename mpl::if_< - is_class - , return_internal_reference<> - , default_call_policies - >::type get_data_return_policy; - - class_(elem_name.c_str()) - .def("__repr__", &DerivedPolicies::print_elem) - .def("data", &DerivedPolicies::get_data, get_data_return_policy()) - .def("key", &DerivedPolicies::get_key) - ; - } - - static object - print_elem(typename Container::value_type const& e) - { - return "(%s, %s)" % python::make_tuple(e.first, e.second); - } - - static - typename mpl::if_< - is_class - , data_type& - , data_type - >::type - get_data(typename Container::value_type& e) - { - return e.second; - } - - static typename Container::key_type - get_key(typename Container::value_type& e) - { - return e.first; - } - - static data_type& - get_item(Container& container, index_type i_) - { - typename Container::iterator i = container.find(i_); - if (i == container.end()) - { - PyErr_SetString(PyExc_KeyError, "Invalid key"); - throw_error_already_set(); - } - return i->second; - } - - static void - set_item(Container& container, index_type i, data_type const& v) - { - container[i] = v; - } - - static void - delete_item(Container& container, index_type i) - { - container.erase(i); - } - - static size_t - size(Container& container) - { - return container.size(); - } - - static bool - contains(Container& container, key_type const& key) - { - return container.find(key) != container.end(); - } - - static bool - compare_index(Container& container, index_type a, index_type b) - { - return container.key_comp()(a, b); - } - - static index_type - convert_index(Container& container, PyObject* i_) - { - extract i(i_); - if (i.check()) - { - return i(); - } - else - { - extract i(i_); - if (i.check()) - return i(); - } - - PyErr_SetString(PyExc_TypeError, "Invalid index type"); - throw_error_already_set(); - return index_type(); - } - }; - -}} // namespace boost::python - -#endif // MAP_INDEXING_SUITE_JDG20038_HPP diff --git a/environments/g4py/source/boost/vector_indexing_suite.hpp b/environments/g4py/source/boost/vector_indexing_suite.hpp deleted file mode 100644 index 96340779e2..0000000000 --- a/environments/g4py/source/boost/vector_indexing_suite.hpp +++ /dev/null @@ -1,243 +0,0 @@ -// (C) Copyright Joel de Guzman 2003. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef VECTOR_INDEXING_SUITE_JDG20036_HPP -# define VECTOR_INDEXING_SUITE_JDG20036_HPP - -# include "indexing_suite.hpp" -# include "container_utils.hpp" -# include - -namespace boost { namespace python { - - // Forward declaration - template - class vector_indexing_suite; - - namespace detail - { - template - class final_vector_derived_policies - : public vector_indexing_suite > {}; - } - - // The vector_indexing_suite class is a predefined indexing_suite derived - // class for wrapping std::vector (and std::vector like) classes. It provides - // all the policies required by the indexing_suite (see indexing_suite). - // Example usage: - // - // class X {...}; - // - // ... - // - // class_ >("XVec") - // .def(vector_indexing_suite >()) - // ; - // - // By default indexed elements are returned by proxy. This can be - // disabled by supplying *true* in the NoProxy template parameter. - // - template < - class Container, - bool NoProxy = false, - class DerivedPolicies - = detail::final_vector_derived_policies > - class vector_indexing_suite - : public indexing_suite - { - public: - - typedef typename Container::value_type data_type; - typedef typename Container::value_type key_type; - typedef typename Container::size_type index_type; - typedef typename Container::size_type size_type; - typedef typename Container::difference_type difference_type; - - template - static void - extension_def(Class& cl) - { - cl - .def("append", &base_append) - .def("push_back", &base_append) - .def("extend", &base_extend) - ; - } - - static - typename mpl::if_< - is_class - , data_type& - , data_type - >::type - get_item(Container& container, index_type i) - { - return container[i]; - } - - static object - get_slice(Container& container, index_type from, index_type to) - { - if (from > to) - return object(Container()); - return object(Container(container.begin()+from, container.begin()+to)); - } - - static void - set_item(Container& container, index_type i, data_type const& v) - { - container[i] = v; - } - - static void - set_slice(Container& container, index_type from, - index_type to, data_type const& v) - { - if (from > to) { - return; - } - else { - container.erase(container.begin()+from, container.begin()+to); - container.insert(container.begin()+from, v); - } - } - - template - static void - set_slice(Container& container, index_type from, - index_type to, Iter first, Iter last) - { - if (from > to) { - container.insert(container.begin()+from, first, last); - } - else { - container.erase(container.begin()+from, container.begin()+to); - container.insert(container.begin()+from, first, last); - } - } - - static void - delete_item(Container& container, index_type i) - { - container.erase(container.begin()+i); - } - - static void - delete_slice(Container& container, index_type from, index_type to) - { - if (from > to) { - // A null-op. - return; - } - container.erase(container.begin()+from, container.begin()+to); - } - - static size_t - size(Container& container) - { - return container.size(); - } - - static bool - contains(Container& container, key_type const& key) - { - return std::find(container.begin(), container.end(), key) - != container.end(); - } - - static index_type - get_min_index(Container& container) - { - return 0; - } - - static index_type - get_max_index(Container& container) - { - return container.size(); - } - - static bool - compare_index(Container& container, index_type a, index_type b) - { - return a < b; - } - - static index_type - convert_index(Container& container, PyObject* i_) - { - extract i(i_); - if (i.check()) - { - long index = i(); - if (index < 0) - index += DerivedPolicies::size(container); - if (index >= long(container.size()) || index < 0) - { - PyErr_SetString(PyExc_IndexError, "Index out of range"); - throw_error_already_set(); - } - return index; - } - - PyErr_SetString(PyExc_TypeError, "Invalid index type"); - throw_error_already_set(); - return index_type(); - } - - static void - append(Container& container, data_type const& v) - { - container.push_back(v); - } - - template - static void - extend(Container& container, Iter first, Iter last) - { - container.insert(container.end(), first, last); - } - - private: - - static void - base_append(Container& container, object v) - { - extract elem(v); - // try if elem is an exact Data - if (elem.check()) - { - DerivedPolicies::append(container, elem()); - } - else - { - // try to convert elem to data_type - extract elem(v); - if (elem.check()) - { - DerivedPolicies::append(container, elem()); - } - else - { - PyErr_SetString(PyExc_TypeError, - "Attempting to append an invalid type"); - throw_error_already_set(); - } - } - } - - static void - base_extend(Container& container, object v) - { - std::vector temp; - container_utils::extend_container(temp, v); - DerivedPolicies::extend(container, temp.begin(), temp.end()); - } - }; - -}} // namespace boost::python - -#endif // VECTOR_INDEXING_SUITE_JDG20036_HPP diff --git a/environments/g4py/source/global/CMakeLists.txt b/environments/g4py/source/global/CMakeLists.txt index 133cc60a6c..65f151a24f 100644 --- a/environments/g4py/source/global/CMakeLists.txt +++ b/environments/g4py/source/global/CMakeLists.txt @@ -23,5 +23,5 @@ geant4_add_pymodule(pyG4global pymodG4global.cc ) -target_link_libraries(pyG4global PRIVATE G4global G4track pyG4Boost) +target_link_libraries(pyG4global PRIVATE G4global G4track) install(TARGETS pyG4global DESTINATION "${CMAKE_INSTALL_PYTHONDIR}/Geant4") diff --git a/environments/g4py/source/global/pyG4UnitsTable.cc b/environments/g4py/source/global/pyG4UnitsTable.cc index 06a143f9d9..7adab84f48 100644 --- a/environments/g4py/source/global/pyG4UnitsTable.cc +++ b/environments/g4py/source/global/pyG4UnitsTable.cc @@ -29,7 +29,7 @@ // 2005 Q // ==================================================================== #include -#include "pyG4indexing.hh" +#include #include "G4UnitsTable.hh" using namespace boost::python; diff --git a/environments/g4py/source/global/pyglobals.cc b/environments/g4py/source/global/pyglobals.cc index aad3dd89dd..0a440b5e3b 100644 --- a/environments/g4py/source/global/pyglobals.cc +++ b/environments/g4py/source/global/pyglobals.cc @@ -29,7 +29,7 @@ // 2005 Q // ==================================================================== #include -#include "pyG4indexing.hh" +#include #include "G4Version.hh" #include "G4strstreambuf.hh" #include "G4UImanager.hh" diff --git a/environments/g4py/source/intercoms/pyG4UIcommandTree.cc b/environments/g4py/source/intercoms/pyG4UIcommandTree.cc index 05e59cb2d7..7a92ada318 100644 --- a/environments/g4py/source/intercoms/pyG4UIcommandTree.cc +++ b/environments/g4py/source/intercoms/pyG4UIcommandTree.cc @@ -66,7 +66,8 @@ void export_G4UIcommandTree() .def("CreateHTML", &G4UIcommandTree::CreateHTML) .def("GetGuidance", &G4UIcommandTree::GetGuidance, return_value_policy()) - .def("GetPathName", &G4UIcommandTree::GetPathName) + .def("GetPathName", &G4UIcommandTree::GetPathName, + return_value_policy()) // --- .def("GetTreeEntry", &G4UIcommandTree::GetTreeEntry) .def("GetCommandEntry", &G4UIcommandTree::GetCommandEntry) diff --git a/environments/g4py/source/intercoms/pyG4UIparameter.cc b/environments/g4py/source/intercoms/pyG4UIparameter.cc index 3be7ea5c98..78e8e4d5ba 100644 --- a/environments/g4py/source/intercoms/pyG4UIparameter.cc +++ b/environments/g4py/source/intercoms/pyG4UIparameter.cc @@ -45,13 +45,18 @@ void export_G4UIparameter() .def(init()) // --- .def("List", &G4UIparameter::List) - .def("GetDefaultValue", &G4UIparameter::GetDefaultValue) + .def("GetDefaultValue", &G4UIparameter::GetDefaultValue, + return_value_policy()) .def("GetParameterType", &G4UIparameter::GetParameterType) - .def("GetParameterRange", &G4UIparameter::GetParameterRange) - .def("GetParameterName", &G4UIparameter::GetParameterName) - .def("GetParameterCandidates", &G4UIparameter::GetParameterCandidates) + .def("GetParameterRange", &G4UIparameter::GetParameterRange, + return_value_policy()) + .def("GetParameterName", &G4UIparameter::GetParameterName, + return_value_policy()) + .def("GetParameterCandidates", &G4UIparameter::GetParameterCandidates, + return_value_policy()) .def("IsOmittable", &G4UIparameter::IsOmittable) .def("GetCurrentAsDefault", &G4UIparameter::GetCurrentAsDefault) - .def("GetParameterGuidance", &G4UIparameter::GetParameterGuidance) + .def("GetParameterGuidance", &G4UIparameter::GetParameterGuidance, + return_value_policy()) ; } diff --git a/environments/g4py/source/materials/CMakeLists.txt b/environments/g4py/source/materials/CMakeLists.txt index 662e4606e8..f50cc6c792 100644 --- a/environments/g4py/source/materials/CMakeLists.txt +++ b/environments/g4py/source/materials/CMakeLists.txt @@ -13,5 +13,5 @@ geant4_add_pymodule(pyG4materials pymodG4materials.cc ) -target_link_libraries(pyG4materials PRIVATE G4materials pyG4Boost) +target_link_libraries(pyG4materials PRIVATE G4materials) install(TARGETS pyG4materials DESTINATION "${CMAKE_INSTALL_PYTHONDIR}/Geant4") diff --git a/environments/g4py/source/materials/pyG4ElementTable.cc b/environments/g4py/source/materials/pyG4ElementTable.cc index 2398684dc5..9784807e29 100644 --- a/environments/g4py/source/materials/pyG4ElementTable.cc +++ b/environments/g4py/source/materials/pyG4ElementTable.cc @@ -29,7 +29,7 @@ // 2005 Q // ==================================================================== #include -#include "pyG4indexing.hh" +#include #include "G4Element.hh" #include "G4ElementTable.hh" diff --git a/environments/g4py/source/materials/pyG4ElementVector.cc b/environments/g4py/source/materials/pyG4ElementVector.cc index 76ca0f45d5..d2d935cd56 100644 --- a/environments/g4py/source/materials/pyG4ElementVector.cc +++ b/environments/g4py/source/materials/pyG4ElementVector.cc @@ -29,7 +29,7 @@ // 2005 Q // ==================================================================== #include -#include "pyG4indexing.hh" +#include #include "G4ElementVector.hh" using namespace boost::python; diff --git a/environments/g4py/source/materials/pyG4Isotope.cc b/environments/g4py/source/materials/pyG4Isotope.cc index 047fa74ffd..cafe8a05f5 100644 --- a/environments/g4py/source/materials/pyG4Isotope.cc +++ b/environments/g4py/source/materials/pyG4Isotope.cc @@ -29,8 +29,8 @@ // 2005 Q // ==================================================================== #include +#include #include "G4Version.hh" -#include "pyG4indexing.hh" #include "G4Isotope.hh" using namespace boost::python; diff --git a/environments/g4py/source/materials/pyG4MaterialTable.cc b/environments/g4py/source/materials/pyG4MaterialTable.cc index e0838198b2..b9a5f3b664 100644 --- a/environments/g4py/source/materials/pyG4MaterialTable.cc +++ b/environments/g4py/source/materials/pyG4MaterialTable.cc @@ -29,7 +29,7 @@ // 2005 Q // ==================================================================== #include -#include "pyG4indexing.hh" +#include #include "G4Material.hh" #include "G4MaterialTable.hh" diff --git a/environments/g4py/source/physics_lists/CMakeLists.txt b/environments/g4py/source/physics_lists/CMakeLists.txt index 7646835f28..be76a935c7 100644 --- a/environments/g4py/source/physics_lists/CMakeLists.txt +++ b/environments/g4py/source/physics_lists/CMakeLists.txt @@ -3,6 +3,7 @@ # library geant4_add_pymodule(pyG4physicslists pyPhysicsLists.cc + pyPhysListFactory.cc pymodG4physicslists.cc ) target_link_libraries(pyG4physicslists PRIVATE G4physicslists) diff --git a/environments/g4py/source/physics_lists/pyPhysListFactory.cc b/environments/g4py/source/physics_lists/pyPhysListFactory.cc new file mode 100644 index 0000000000..5a1f2112dc --- /dev/null +++ b/environments/g4py/source/physics_lists/pyPhysListFactory.cc @@ -0,0 +1,53 @@ +// +// ******************************************************************** +// * License and Disclaimer * +// * * +// * The Geant4 software is copyright of the Copyright Holders of * +// * the Geant4 Collaboration. It is provided under the terms and * +// * conditions of the Geant4 Software License, included in the file * +// * LICENSE and available at http://cern.ch/geant4/license . These * +// * include a list of copyright holders. * +// * * +// * Neither the authors of this software system, nor their employing * +// * institutes,nor the agencies providing financial support for this * +// * work make any representation or warranty, express or implied, * +// * regarding this software system or assume any liability for its * +// * use. Please see the license in the file LICENSE and URL above * +// * for the full disclaimer and the limitation of liability. * +// * * +// * This code implementation is the result of the scientific and * +// * technical work of the GEANT4 collaboration. * +// * By using, copying, modifying or distributing the software (or * +// * any work based on the software) you agree to acknowledge its * +// * use in resulting scientific publications, and indicate your * +// * acceptance of all terms of the Geant4 Software license. * +// ******************************************************************** +// +// ==================================================================== +// pyPhysListFactory.cc +// +// 2020 Q +// ==================================================================== +#include +#include "G4PhysListFactory.hh" + +using namespace boost::python; + +// ==================================================================== +// module definition +// ==================================================================== +void export_PhysListFactory() +{ + class_ + ("G4PhysListFactory", "phys list factory") + .def("GetReferencePhysList", &G4PhysListFactory::GetReferencePhysList, + return_internal_reference<>()) + .def("ReferencePhysList", &G4PhysListFactory::ReferencePhysList, + return_internal_reference<>()) + .def("IsReferencePhysList", &G4PhysListFactory::IsReferencePhysList) + .def("AvailablePhysLists", &G4PhysListFactory::AvailablePhysLists, + return_value_policy()) + .def("AvailablePhysListsEM", &G4PhysListFactory::AvailablePhysListsEM, + return_value_policy()) + ; +} diff --git a/environments/g4py/source/physics_lists/pymodG4physicslists.cc b/environments/g4py/source/physics_lists/pymodG4physicslists.cc index 07e1b6e634..ba23846b42 100644 --- a/environments/g4py/source/physics_lists/pymodG4physicslists.cc +++ b/environments/g4py/source/physics_lists/pymodG4physicslists.cc @@ -36,9 +36,10 @@ using namespace boost::python; // module definition // ==================================================================== void export_PhysicsLists(); +void export_PhysListFactory(); BOOST_PYTHON_MODULE(G4physicslists) { export_PhysicsLists(); + export_PhysListFactory(); } - diff --git a/environments/g4py/source/processes/CMakeLists.txt b/environments/g4py/source/processes/CMakeLists.txt index 551842b6a7..39c3f3450b 100644 --- a/environments/g4py/source/processes/CMakeLists.txt +++ b/environments/g4py/source/processes/CMakeLists.txt @@ -14,5 +14,5 @@ geant4_add_pymodule(pyG4processes pymodG4processes.cc ) -target_link_libraries(pyG4processes PRIVATE G4processes pyG4Boost) +target_link_libraries(pyG4processes PRIVATE G4processes) install(TARGETS pyG4processes DESTINATION "${CMAKE_INSTALL_PYTHONDIR}/Geant4") diff --git a/environments/g4py/source/processes/pyG4ProcVector.cc b/environments/g4py/source/processes/pyG4ProcVector.cc index 33a0a67bce..7cd8507337 100644 --- a/environments/g4py/source/processes/pyG4ProcVector.cc +++ b/environments/g4py/source/processes/pyG4ProcVector.cc @@ -29,7 +29,7 @@ // 2005 Q // ==================================================================== #include -#include "pyG4indexing.hh" +#include #include "G4VProcess.hh" using namespace boost::python; diff --git a/environments/g4py/tests/CMakeLists.txt b/environments/g4py/tests/CMakeLists.txt index cac49a9d53..172298ade7 100644 --- a/environments/g4py/tests/CMakeLists.txt +++ b/environments/g4py/tests/CMakeLists.txt @@ -7,3 +7,4 @@ add_subdirectory(gtest04) add_subdirectory(gtest05) add_subdirectory(gtest06) add_subdirectory(gtest07) +add_subdirectory(gtest08) diff --git a/environments/g4py/tests/gtest08/CMakeLists.txt b/environments/g4py/tests/gtest08/CMakeLists.txt new file mode 100644 index 0000000000..aa44ddeaa5 --- /dev/null +++ b/environments/g4py/tests/gtest08/CMakeLists.txt @@ -0,0 +1,3 @@ +configure_file(test.py test.py) +add_test(NAME geant4py-test08 COMMAND ${PYTHON_EXECUTABLE} test.py) +set_tests_properties(geant4py-test08 PROPERTIES ENVIRONMENT "PYTHONPATH=${GEANT4_PYTHON_OUTPUT_DIR};${GEANT4_TEST_ENVIRONMENT}") \ No newline at end of file diff --git a/environments/g4py/tests/gtest08/test.py b/environments/g4py/tests/gtest08/test.py new file mode 100755 index 0000000000..5b03e6a769 --- /dev/null +++ b/environments/g4py/tests/gtest08/test.py @@ -0,0 +1,74 @@ +#!/usr/bin/python3 +# ================================================================== +# python script for Geant4Py test +# +# gtest09 +# - test for checking use of G4PhysListFactory +# ================================================================== + +from Geant4 import * + +# ================================================================== +# user actions in python +# ================================================================== +class MyDetectorConstruction(G4VUserDetectorConstruction): + "My Detector Construction" + + def __init__(self): + G4VUserDetectorConstruction.__init__(self) + + # ----------------------------------------------------------------- + def Construct(self): + # Python has automatic garbage collection system. + # Geometry objects must be defined as GLOBAL not to be deleted. + air= gNistManager.FindOrBuildMaterial("G4_AIR") + + # world volume + global sld_world, lv_world, pv_world + sld_world= G4Box("world", 1.*m, 1.*m, 1.*m) + lv_world= G4LogicalVolume(sld_world, air, "world") + pv_world= G4PVPlacement(G4Transform3D(), lv_world, "world", + None, False, 0) + + return pv_world + +class MyPrimaryGeneratorAction(G4VUserPrimaryGeneratorAction): + "My Primary Generator Action" + + def __init__(self): + G4VUserPrimaryGeneratorAction.__init__(self) + self.particleGun= G4ParticleGun(1) + + def GeneratePrimaries(self, event): + dx=0. + self.particleGun.SetParticleMomentumDirection(G4ThreeVector(dx, 0., 1.)) + self.particleGun.GeneratePrimaryVertex(event) + +# ================================================================== +# main +# ================================================================== +# set geometry +myDC = MyDetectorConstruction() +gRunManager.SetUserInitialization(myDC) + +# Create physics list +factory = G4PhysListFactory() +myPhysList = factory.GetReferencePhysList("FTFP_BERT") + +if myPhysList is None: + raise RuntimeError("No physics list named FTFP_BERT found") + +gRunManager.SetUserInitialization(myPhysList) + +# Event generator +myGenAction = MyPrimaryGeneratorAction() +myGenAction.particleGun.SetParticleByName("e-") +myGenAction.particleGun.SetParticleEnergy(200.*MeV) +myGenAction.particleGun.SetParticlePosition(G4ThreeVector(0.,0.,-14.9)*cm) + +gRunManager.SetUserAction(myGenAction) + +# Init, run terminate +gRunManager.Initialize() +gRunManager.BeamOn(10) +gTerminate() diff --git a/environments/zmq/pyclient/g4zmq.py b/environments/zmq/pyclient/g4zmq.py index 6aef5dc9e7..3da2b79e8e 100755 --- a/environments/zmq/pyclient/g4zmq.py +++ b/environments/zmq/pyclient/g4zmq.py @@ -1,4 +1,4 @@ -#/usr/bin/env python +#!/usr/bin/env python # ================================================================== # python client for zmq-geant4 # diff --git a/examples/.doxygen/Doxyfile b/examples/.doxygen/Doxyfile index 351755d776..73a3e0f971 100644 --- a/examples/.doxygen/Doxyfile +++ b/examples/.doxygen/Doxyfile @@ -152,7 +152,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = /Users/ivana/work/packages/geant4/geant4_ref/examples/ +STRIP_FROM_PATH = /Users/ivana/work/packages/geant4/geant4-dev/examples/ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -837,6 +837,7 @@ INPUT = Doxymain.h \ ../extended/exoticphysics/monopole/.README.txt \ ../extended/exoticphysics/phonon \ ../extended/exoticphysics/ucn \ + ../extended/exoticphysics/saxs \ ../extended/field \ ../extended/g3tog4 \ ../extended/geometry/.README.txt \ @@ -850,6 +851,7 @@ INPUT = Doxymain.h \ ../extended/hadronic/Hadr06/.README.txt \ ../extended/hadronic/Hadr07/.README.txt \ ../extended/hadronic/Hadr08/.README.txt \ + ../extended/hadronic/Hadr09/.README.txt \ ../extended/hadronic/FissionFragment \ ../extended/hadronic/NeutronSource/.README.txt \ ../extended/medical/.README.txt \ @@ -866,6 +868,7 @@ INPUT = Doxymain.h \ ../extended/medical/dna/chem3/.README.txt \ ../extended/medical/dna/chem4/.README.txt \ ../extended/medical/dna/chem5/.README.txt \ + ../extended/medical/dna/chem6/.README.txt \ ../extended/medical/dna/clustering/.README.txt \ ../extended/medical/dna/dnadamage1/.README.txt \ ../extended/medical/dna/dnaphysics/.README.txt \ diff --git a/examples/.doxygen/Doxyfile_standalone b/examples/.doxygen/Doxyfile_standalone index cd55935d8a..05dd637ee9 100644 --- a/examples/.doxygen/Doxyfile_standalone +++ b/examples/.doxygen/Doxyfile_standalone @@ -152,7 +152,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = /Users/ivana/work/packages/geant4/geant4_ref/examples/ +STRIP_FROM_PATH = /Users/ivana/work/packages/geant4/geant4-dev/examples/ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which diff --git a/examples/.doxygen/Doxyfile_test b/examples/.doxygen/Doxyfile_test index a1a03cb2ec..92e61813fd 100644 --- a/examples/.doxygen/Doxyfile_test +++ b/examples/.doxygen/Doxyfile_test @@ -125,7 +125,7 @@ FULL_PATH_NAMES = YES # If left blank the directory from which doxygen is run is used as the # path to strip. -STRIP_FROM_PATH = /home/work/packages/geant4/geant4_ref/examples/ +STRIP_FROM_PATH = /home/work/packages/geant4/geant4-dev/examples/ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells diff --git a/examples/.doxygen/Doxymodules_exoticphysics.h b/examples/.doxygen/Doxymodules_exoticphysics.h index 0070f71ef1..aba08f0aa9 100644 --- a/examples/.doxygen/Doxymodules_exoticphysics.h +++ b/examples/.doxygen/Doxymodules_exoticphysics.h @@ -36,21 +36,6 @@ /** @} */ -/** @defgroup extended_exoticphysics_ucn ucn - * Exotic physics example ucn - * @ingroup extended_exoticphysics - * @{ - */ - - class ExUCNActionInitialization {}; - class ExUCNDetectorConstruction {}; - class ExUCNExtraPhysics {}; - class ExUCNPhysicsList {}; - class ExUCNPrimaryGeneratorAction {}; - class ExUCNRunAction {}; - -/** @} */ - /** @defgroup extended_exoticphysics_phonon phonon * Exotic physics example phonon * @ingroup extended_exoticphysics @@ -67,4 +52,43 @@ /** @} */ +/** @defgroup extended_exoticphysics_saxs saxs + * Exotic physics example saxs + * @ingroup extended_exoticphysics + * @{ + */ + + class G4EmPenelopePhysicsMI {}; + class SAXSActionInitialization {}; + class SAXSAnalysis {}; + class SAXSDetectorConstruction {}; + class SAXSDetectorConstructionMessenger {}; + class SAXSEventAction {}; + class SAXSPhysicsList {}; + class SAXSPhysicsListMessenger {}; + class SAXSPrimaryGeneratorAction {}; + class SAXSRunAction {}; + class SAXSRunActionMessenger {}; + class SAXSSensitiveDetector {}; + class SAXSSensitiveDetectorHit {}; + class SAXSSensitiveDetectorMessenger {}; + class SAXSSteppingAction {}; + +/** @} */ + +/** @defgroup extended_exoticphysics_ucn ucn + * Exotic physics example ucn + * @ingroup extended_exoticphysics + * @{ + */ + + class ExUCNActionInitialization {}; + class ExUCNDetectorConstruction {}; + class ExUCNExtraPhysics {}; + class ExUCNPhysicsList {}; + class ExUCNPrimaryGeneratorAction {}; + class ExUCNRunAction {}; + +/** @} */ + /** @} */ diff --git a/examples/.doxygen/Doxymodules_hadronic.h b/examples/.doxygen/Doxymodules_hadronic.h index 3645ccf609..05f3ef04d7 100644 --- a/examples/.doxygen/Doxymodules_hadronic.h +++ b/examples/.doxygen/Doxymodules_hadronic.h @@ -81,6 +81,17 @@ /** @} */ +/** @} */ + +/** @defgroup extended_hadronic_Hadr09 Hadr09 + * The Hadr09 hadronic classes have their + * standalone documentation + * @ingroup extended_hadronic + * @{ + */ + +/** @} */ + /** @defgroup extended_hadronic_FissionFragment FissionFragment * Hadronic example FissionFragment * @ingroup extended_hadronic diff --git a/examples/.doxygen/Doxymodules_medical.h b/examples/.doxygen/Doxymodules_medical.h index b19d528a56..e598155150 100644 --- a/examples/.doxygen/Doxymodules_medical.h +++ b/examples/.doxygen/Doxymodules_medical.h @@ -167,6 +167,15 @@ /** @} */ +/** @defgroup extended_medical_dna_chem6 chem6 + * Medical dna chem6 example has its + * standalone documentation + * @ingroup extended_medical_dna + * @{ + */ + +/** @} */ + /** @defgroup extended_medical_dna_clustering clustering * Medical dna clustering example has its * standalone documentation diff --git a/examples/.doxygen/Doxymodules_parameterisations.h b/examples/.doxygen/Doxymodules_parameterisations.h index 91be472f54..21d2a78106 100644 --- a/examples/.doxygen/Doxymodules_parameterisations.h +++ b/examples/.doxygen/Doxymodules_parameterisations.h @@ -51,6 +51,24 @@ class Par02TrackingAction {}; /** @} */ +/** @defgroup extended_parameterisations_Par03 Par03 + * parameterisations example Par03 + * @{ + */ + +class Par03ActionInitialisation {}; +class Par03DetectorConstruction {}; +class Par03DetectorMessenger {}; +class Par03EMShowerMessenger {}; +class Par03EMShowerModel {}; +class Par03EventAction {}; +class Par03Hit {}; +class Par03PrimaryGeneratorAction {}; +class Par03RunAction {}; +class Par03SensitiveDetector {}; + +/** @} */ + /** @defgroup extended_parameterisations_gflash gflash * Extended examples parameterisations gflash classes * @{ diff --git a/examples/.doxygen/History b/examples/.doxygen/History index c8cb26f55f..cc345cf968 100644 --- a/examples/.doxygen/History +++ b/examples/.doxygen/History @@ -17,6 +17,23 @@ track of all tags. * Reverse chronological order (last date on top), please * ---------------------------------------------------------- +9/11/20 I.Hrivnacova (doxygen-V10-06-03) +- Added new extended example Hadr09 in documentation + +6/11/20 I.Hrivnacova (doxygen-V10-06-02) +- Added new extended examples in documentation: + - exoticphysics/saxs + - medical/dna/chem6 + - parameterisation/Par03 + +6/8/20 I.Hrivnacova (doxygen-V10-06-01) +- More fixes in header/footer.html links (thanks to Gunter) + +3/8/20 I.Hrivnacova (doxygen-V10-06-00) +- Updated obsolete links to Geant4 pages in header/footer.html +- Removed not working links to search in Geant4 and web master +- Updated logo and color style + 28/11/19 I.Hrivnacova (doxygen-V10-05-03) - Updated for reorganization of gflash examples, added new GB07 in modules diff --git a/examples/.doxygen/extra_stylesheet.css b/examples/.doxygen/extra_stylesheet.css index 53d9c9109a..7fee8f57bc 100644 --- a/examples/.doxygen/extra_stylesheet.css +++ b/examples/.doxygen/extra_stylesheet.css @@ -4,8 +4,8 @@ /* header style */ #g4header { color: black; - background-color: #CCCC99; - border: 1px solid #999966; + background-color: #cfd6ed; + border: 1px solid #9ca3ba; /* border: 10px solid white; */ padding-top: .5em; padding-right: 1em; @@ -16,14 +16,14 @@ #g4header img { padding-left: 1em; - background: #cccc99; + background: #cfd6ed; } #breadcrumb { color: #003366; - background-color: #9999FF; + background-color: #cfd6ed; border: 0; - border-right: 1em solid white; +/* border-right: 1em solid white; */ font-weight: bold; text-align: left; font-size: 90%; diff --git a/examples/.doxygen/footer.html b/examples/.doxygen/footer.html index dee7adfb3c..6856ad1557 100644 --- a/examples/.doxygen/footer.html +++ b/examples/.doxygen/footer.html @@ -19,21 +19,9 @@ $generatedby  
    -
    Applications | -User Support | -Results & Publications | -Collaboration | -Site Map
    -

    - -

    +Applications | + User Support | + Publications | +Collaboration
    diff --git a/examples/.doxygen/generate_standalone.sh b/examples/.doxygen/generate_standalone.sh index d76f457f57..b4e49c9757 100755 --- a/examples/.doxygen/generate_standalone.sh +++ b/examples/.doxygen/generate_standalone.sh @@ -47,12 +47,12 @@ generate() { } # process examples in second level directory in extended -for DIR in analysis/shared analysis/AnaEx01 analysis/AnaEx02 analysis/AnaEx03 electromagnetic/TestEm0 electromagnetic/TestEm1 electromagnetic/TestEm2 electromagnetic/TestEm3 electromagnetic/TestEm4 electromagnetic/TestEm5 electromagnetic/TestEm6 electromagnetic/TestEm7 electromagnetic/TestEm8 electromagnetic/TestEm9 electromagnetic/TestEm10 electromagnetic/TestEm11 electromagnetic/TestEm12 electromagnetic/TestEm13 electromagnetic/TestEm14 electromagnetic/TestEm15 electromagnetic/TestEm16 electromagnetic/TestEm17 electromagnetic/TestEm18 eventgenerator/particleGun eventgenerator/exgps eventgenerator/userPrimaryGenerator exoticphysics/channeling exoticphysics/dmparticle exoticphysics/monopole geometry/transforms hadronic/Hadr00 hadronic/Hadr01 hadronic/Hadr02 hadronic/Hadr03 hadronic/Hadr04 hadronic/Hadr06 hadronic/Hadr07 hadronic/Hadr08 hadronic/NeutronSource medical/electronScattering medical/electronScattering2 medical/fanoCavity medical/fanoCavity2 medical/GammaTherapy optical/OpNovice2 physicslists/extensibleFactory physicslists/factory physicslists/genericPL polarisation/Pol01 radioactivedecay/Activation radioactivedecay/rdecay01 radioactivedecay/rdecay02; do +for DIR in analysis/shared analysis/AnaEx01 analysis/AnaEx02 analysis/AnaEx03 electromagnetic/TestEm0 electromagnetic/TestEm1 electromagnetic/TestEm2 electromagnetic/TestEm3 electromagnetic/TestEm4 electromagnetic/TestEm5 electromagnetic/TestEm6 electromagnetic/TestEm7 electromagnetic/TestEm8 electromagnetic/TestEm9 electromagnetic/TestEm10 electromagnetic/TestEm11 electromagnetic/TestEm12 electromagnetic/TestEm13 electromagnetic/TestEm14 electromagnetic/TestEm15 electromagnetic/TestEm16 electromagnetic/TestEm17 electromagnetic/TestEm18 eventgenerator/particleGun eventgenerator/exgps eventgenerator/userPrimaryGenerator exoticphysics/channeling exoticphysics/dmparticle exoticphysics/monopole geometry/transforms hadronic/Hadr00 hadronic/Hadr01 hadronic/Hadr02 hadronic/Hadr03 hadronic/Hadr04 hadronic/Hadr06 hadronic/Hadr07 hadronic/Hadr08 hadronic/Hadr09 hadronic/NeutronSource medical/electronScattering medical/electronScattering2 medical/fanoCavity medical/fanoCavity2 medical/GammaTherapy optical/OpNovice2 physicslists/extensibleFactory physicslists/factory physicslists/genericPL polarisation/Pol01 radioactivedecay/Activation radioactivedecay/rdecay01 radioactivedecay/rdecay02; do generate ${DIR} ${BACK_PATH2} done # process examples in third level directory in extended -for DIR in eventgenerator/HepMC/MCTruth medical/dna/chem1 medical/dna/chem2 medical/dna/chem3 medical/dna/chem4 medical/dna/chem5 medical/dna/clustering medical/dna/dnadamage1 medical/dna/dnaphysics medical/dna/icsd medical/dna/mfp medical/dna/microdosimetry medical/dna/microprox medical/dna/microyz medical/dna/neuron medical/dna/pdb4dna medical/dna/range medical/dna/slowing medical/dna/splitting medical/dna/spower medical/dna/svalue medical/dna/wholeNuclearDNA medical/dna/wvalue parameterisations/gflash/gflasha parallel/TopC/ParN02 parallel/TopC/ParN04; do +for DIR in eventgenerator/HepMC/MCTruth medical/dna/chem1 medical/dna/chem2 medical/dna/chem3 medical/dna/chem4 medical/dna/chem5 medical/dna/chem6 medical/dna/clustering medical/dna/dnadamage1 medical/dna/dnaphysics medical/dna/icsd medical/dna/mfp medical/dna/microdosimetry medical/dna/microprox medical/dna/microyz medical/dna/neuron medical/dna/pdb4dna medical/dna/range medical/dna/slowing medical/dna/splitting medical/dna/spower medical/dna/svalue medical/dna/wholeNuclearDNA medical/dna/wvalue parameterisations/gflash/gflasha parallel/TopC/ParN02 parallel/TopC/ParN04; do generate ${DIR} ${BACK_PATH3} done diff --git a/examples/.doxygen/header.html b/examples/.doxygen/header.html index e68f81183c..cd6eacae1f 100644 --- a/examples/.doxygen/header.html +++ b/examples/.doxygen/header.html @@ -26,42 +26,29 @@ $extrastylesheet
    - Geant4 Home + Geant4 Home - Download - | User - Forum | - Gallery
    - - Contact Us
    -
    - - - - - - - - -
    + Download | + User Forum
    | + Contact Us | + Bug Reports
    + -
    + + - - diff --git a/examples/.doxygen/images/geanttiny.gif b/examples/.doxygen/images/geanttiny.gif index bc6bf5b216..c53ede797f 100644 Binary files a/examples/.doxygen/images/geanttiny.gif and b/examples/.doxygen/images/geanttiny.gif differ diff --git a/examples/History b/examples/History index d04dbaf55f..2198adceba 100644 --- a/examples/History +++ b/examples/History @@ -16,6 +16,60 @@ committal in the CVS repository ! * Reverse chronological order (last date on top), please * ---------------------------------------------------------- +4th December 2020 Gabriele Cosmo (examples-V10-07-00) +- Updated reference outputs according to reference tag geant4-10-07-ref-00. +- Includes tags: doxygen-V10-06-03, exadvanced-V10-06-00, air_shower-V10-06-04, + brachy-V10-06-03, fastAerosol-V10-06-02, gammaknife-V10-06-02, + gammaraytel-V10-06-03, gorad-V10-06-06, exhgcaltb-V10-06-00, + hadrontherapy-V10-06-07, human_phantom-V10-06-01, + ICRP110Phantoms-V10-06-01, microbeam-V10-06-01, DMX-V10-06-04, + microelectronics-V10-06-01, nanobeam-V10-06-01, LXe-V10-06-03, + radioprotection-V10-06-02, STCyclotron-V10-06-02, + xraytel-V10-06-01, exbasic-V10-06-03, exampleB4-V10-06-04, + exampleB5-V10-06-02, exextended-V10-06-00, exbiasing-V10-06-02, + analysisExample-V10-06-02, electromagnetic-V10-06-01, + exEventGenerator-V10-06-02, exExoticPhysics-V10-06-01, + fieldex-V10-06-01, g3tog4Tests-V10-06-01, exHadronic-V10-06-03, + exMedical-V10-06-01, pdb4dna-V10-06-01, OpNovice-V10-06-01, + OpNovice2-V10-06-07, exTopC-V10-06-00, rdecay01-V10-06-04, + WLS-V10-06-02, MPI-V10-06-00, ThreadsafeScorers-V10-06-03, + exParameterisations-V10-06-01, exPersistency-V10-06-02, + exPHysicsLists-V10-06-00, exPolarisation-V10-06-01, + exRunAndEvent-V10-06-02, exam-ext-vis-UVA-V10-06-01. + +31st October 2020 Gabriele Cosmo (examples-V10-06-10) +- Updated reference outputs according to reference tag geant4-10-06-ref-10. +- Includes tags: gorad-V10-06-02, hadrontherapy-V10-06-04, DMX-V10-06-01, + testem11-V10-06-01, testem12-V10-06-00, testem14-V10-06-01, + exhadr03-V10-06-04, exhadr04-V10-06-01, exhadr06-V10-06-03, + exhadr07-V10-06-02, NeutronSource-V10-06-02, DICOM-V10-06-00, + chem4-V10-06-00, LXe-V10-06-02, exParameterisations-V10-06-00, + OpNovice2-V10-06-06, expar03-V10-06-01, activation-V10-06-03, + rdecay01-V10-06-03. + +30th September 2020 Gabriele Cosmo (examples-V10-06-09) +- Added 'physicslists' category in the top extended examples in README + and CMake setup (I.Hrivnacova). +- Updated reference outputs according to reference tag geant4-10-06-ref-09. +- Includes tags: gorad-V10-06-01, hadrontherapy-V10-06-02, testem1-V10-06-02, + testem3-V10-06-01, testem5-V10-06-03, LXe-V10-06-00. + +31st August 2020 Gabriele Cosmo (examples-V10-06-08) +- Updated reference outputs according to reference tag geant4-10-06-ref-08. +- Includes tags: doxygen-V10-06-01, brachy-V10-06-01, iort_theraphy-V10-06-01, + testem1-V10-06-01, testem2-V10-06-00, exhadr03-V10-06-03, + testem4-V10-06-01, exExtHadFissFrag-V10-06-00, DMX-V10-06-00, + exhadr04-V10-06-00, exhadr06-V10-06-02, exhadr07-V10-06-01, + NeutronSource-V10-06-01, OpNovice-V10-06-00, WLS-V10-06-00, + OpNovice2-V10-06-05, activation-V10-06-02, rdecay01-V10-06-00, + rdecay02-V10-06-00. + +23rd July 2020 Gabriele Cosmo (examples-V10-06-07) +- Updated reference outputs according to reference tag geant4-10-06-ref-07. +- Includes tags: brachy-V10-06-00, purmag-V10-06-00, exbasic-V10-06-01, + exampleB4-V10-06-02, testem5-V10-06-01, exhadr01-V10-06-01, + OpNovice2-V10-06-04. + 26th June 2020 Gabriele Cosmo (examples-V10-06-06) - Updated reference outputs according to reference tag geant4-10-06-ref-06. - Includes tags: exampleB5-V10-06-00, exhadr03-V10-06-02, exhadr06-V10-06-01, diff --git a/examples/advanced/CMakeLists.txt b/examples/advanced/CMakeLists.txt index 49850fbb92..bd0a9479c0 100644 --- a/examples/advanced/CMakeLists.txt +++ b/examples/advanced/CMakeLists.txt @@ -1,6 +1,8 @@ -#---Adding all advanced examples subdirectories explicitly - -cmake_minimum_required(VERSION 2.6 FATAL_ERROR) +#---Adding all advanced examples subdirectories explicitly +cmake_minimum_required(VERSION 3.8...3.18) +if(${CMAKE_VERSION} VERSION_LESS 3.12) + cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) +endif() #---------------------------------------------------------------------------- # some examples require Geant4 build with optional packages @@ -15,15 +17,15 @@ add_subdirectory(brachytherapy) if(Geant4_gdml_FOUND) add_subdirectory(ChargeExchangeMC) -else() - message(STATUS "G4 Examples: GDML not installed --> ChargeExchangeMC example disabled") +else() + message(STATUS "G4 Examples: GDML not installed --> ChargeExchangeMC example disabled") endif() if(NOT Geant4_builtin_clhep_FOUND) add_subdirectory(nanobeam) else() message(STATUS "G4 Examples: CLHEP external package not found --> nanobeam disabled") -endif() +endif() add_subdirectory(composite_calorimeter) @@ -31,7 +33,7 @@ if(ROOT_FOUND) add_subdirectory(doiPET) else() message(STATUS "G4 Examples: ROOT package not found --> doiPET disabled") -endif() +endif() add_subdirectory(eRosita) add_subdirectory(gammaknife) @@ -47,4 +49,4 @@ add_subdirectory(purging_magnet) add_subdirectory(underground_physics) add_subdirectory(xray_fluorescence) add_subdirectory(STCyclotron) - +add_subdirectory(HGCal_testbeam) diff --git a/examples/advanced/ChargeExchangeMC/CMakeLists.txt b/examples/advanced/ChargeExchangeMC/CMakeLists.txt index 68010d0eaf..3d1ec69cf8 100644 --- a/examples/advanced/ChargeExchangeMC/CMakeLists.txt +++ b/examples/advanced/ChargeExchangeMC/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 2.6 FATAL_ERROR) +cmake_minimum_required(VERSION 3.8...3.18) +if(${CMAKE_VERSION} VERSION_LESS 3.12) + cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) +endif() include(CMakeDependentOption) set(name ChargeExchangeMC) @@ -15,7 +18,7 @@ endif() include(${Geant4_USE_FILE}) -# Setup of ROOT ANALYSIS : optional. +# Setup of ROOT ANALYSIS : optional. find_package(ROOT QUIET) cmake_dependent_option(CEXMC_USE_HISTOGRAMING "Build example with analysis objects" ON "ROOT_FOUND" OFF) @@ -28,7 +31,7 @@ option(CEXMC_USE_PERSISTENCY (requires Boost Serialization library)" OFF) if(CEXMC_USE_PERSISTENCY) - find_package(Boost REQUIRED serialization) + find_package(Boost REQUIRED serialization) add_definitions(-DCEXMC_USE_PERSISTENCY) list(APPEND EXTRA_LIBRARIES Boost::serialization) message(STATUS "Library Boost::serialization was added to the linkage list") @@ -79,14 +82,14 @@ option(CEXMC_DEBUG_TP if(CEXMC_DEBUG_TP) add_definitions(-DCEXMC_DEBUG_TP) endif() - + if(CEXMC_USE_HISTOGRAMING) EXECUTE_PROCESS(COMMAND root-config --cflags OUTPUT_VARIABLE ROOT_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ROOT_CXX_FLAGS}") EXECUTE_PROCESS(COMMAND root-config --libs OUTPUT_VARIABLE ROOT_LD_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) set(CMAKE_EXE_LINKER_FLAGS ${ROOT_LD_FLAGS}) -endif(CEXMC_USE_HISTOGRAMING) - +endif(CEXMC_USE_HISTOGRAMING) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${Geant4_INCLUDE_DIR}) file(GLOB sources ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cc) diff --git a/examples/advanced/ChargeExchangeMC/ChargeExchangeMC.out b/examples/advanced/ChargeExchangeMC/ChargeExchangeMC.out index ad58af2595..ccdd36df6d 100644 --- a/examples/advanced/ChargeExchangeMC/ChargeExchangeMC.out +++ b/examples/advanced/ChargeExchangeMC/ChargeExchangeMC.out @@ -4,7 +4,7 @@ ############################################ ************************************************************** - Geant4 version Name: geant4-10-06-ref-06 (26-June-2020) + Geant4 version Name: geant4-10-07-ref-00 (4-December-2020) Copyright : Geant4 Collaboration References : NIM A 506 (2003), 250-303 : IEEE-TNS 53 (2006), 270-278 @@ -43,7 +43,7 @@ Stripping off GDML names of materials, solids and volumes ... --- Cexmc --- ED Scorer of detector role 'VetoCounter' in volume 'vVetoCounter' --- Cexmc --- TP Scorer of detector role 'VetoCounter' in volume 'vVetoCounter' - FTFP_BERT : new threshold between BERT and FTFP is over the interval + hInelastic FTFP_BERT : threshold between BERT and FTFP is over the interval for pions : 3 to 6 GeV for kaons : 3 to 6 GeV for proton : 3 to 6 GeV @@ -144,10 +144,11 @@ Rayl: for gamma SubType=11 BuildTable=1 LivermoreRayleigh : Emin= 0 eV Emax= 100 TeV CullenGenerator msc: for e- SubType= 10 - RangeFactor= 0.04, stepLimType: 1, latDisp: 1 ===== EM models for the G4Region DefaultRegionForTheWorld ====== UrbanMsc : Emin= 0 eV Emax= 100 MeV Nbins=42 100 eV - 100 MeV + StepLim=UseSafety Rfact=0.04 Gfact=2.5 Sfact=0.6 DispFlag:1 Skin=1 Llimit=1 WentzelVIUni : Emin= 100 MeV Emax= 100 TeV Nbins=42 100 MeV - 100 TeV + StepLim=UseSafety Rfact=0.04 Gfact=2.5 Sfact=0.6 DispFlag:1 Skin=1 Llimit=1 eIoni: for e- SubType=2 dE/dx and range tables from 100 eV to 100 TeV in 84 bins @@ -171,10 +172,11 @@ CoulombScat: for e-, integral:1 SubType=1 BuildTable=1 eCoulombScattering : Emin= 100 MeV Emax= 100 TeV msc: for e+ SubType= 10 - RangeFactor= 0.04, stepLimType: 1, latDisp: 1 ===== EM models for the G4Region DefaultRegionForTheWorld ====== UrbanMsc : Emin= 0 eV Emax= 100 MeV Nbins=42 100 eV - 100 MeV + StepLim=UseSafety Rfact=0.04 Gfact=2.5 Sfact=0.6 DispFlag:1 Skin=1 Llimit=1 WentzelVIUni : Emin= 100 MeV Emax= 100 TeV Nbins=42 100 MeV - 100 TeV + StepLim=UseSafety Rfact=0.04 Gfact=2.5 Sfact=0.6 DispFlag:1 Skin=1 Llimit=1 eIoni: for e+ SubType=2 dE/dx and range tables from 100 eV to 100 TeV in 84 bins @@ -202,9 +204,9 @@ CoulombScat: for e+, integral:1 SubType=1 BuildTable=1 eCoulombScattering : Emin= 100 MeV Emax= 100 TeV msc: for proton SubType= 10 - RangeFactor= 0.2, stepLimType: 0, latDisp: 0 ===== EM models for the G4Region DefaultRegionForTheWorld ====== WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llimit=1 hIoni: for proton SubType=2 dE/dx and range tables from 100 eV to 100 TeV in 84 bins @@ -218,14 +220,14 @@ hBrems: for proton SubType=3 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - hBrem : Emin= 0 eV Emax= 100 TeV + hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi hPairProd: for proton 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - hPairProd : Emin= 0 eV Emax= 100 TeV + hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi CoulombScat: for proton, integral:1 SubType=1 BuildTable=1 Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 1 @@ -234,9 +236,9 @@ CoulombScat: for proton, integral:1 SubType=1 BuildTable=1 eCoulombScattering : Emin= 0 eV Emax= 100 TeV msc: for GenericIon SubType= 10 - RangeFactor= 0.2, stepLimType: 0, latDisp: 0 ===== EM models for the G4Region DefaultRegionForTheWorld ====== UrbanMsc : Emin= 0 eV Emax= 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llimit=1 ionIoni: for GenericIon SubType=2 dE/dx and range tables from 100 eV to 100 TeV in 84 bins @@ -248,9 +250,9 @@ ionIoni: for GenericIon SubType=2 BetheBloch : Emin= 2 MeV Emax= 100 TeV msc: for alpha SubType= 10 - RangeFactor= 0.2, stepLimType: 0, latDisp: 0 ===== EM models for the G4Region DefaultRegionForTheWorld ====== UrbanMsc : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llimit=1 ionIoni: for alpha SubType=2 dE/dx and range tables from 100 eV to 100 TeV in 84 bins @@ -261,9 +263,9 @@ ionIoni: for alpha SubType=2 BetheBloch : Emin=7.9452 MeV Emax= 100 TeV msc: for anti_proton SubType= 10 - RangeFactor= 0.2, stepLimType: 0, latDisp: 0 ===== EM models for the G4Region DefaultRegionForTheWorld ====== WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llimit=1 hIoni: for anti_proton SubType=2 dE/dx and range tables from 100 eV to 100 TeV in 84 bins @@ -277,14 +279,14 @@ hBrems: for anti_proton SubType=3 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - hBrem : Emin= 0 eV Emax= 100 TeV + hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi hPairProd: for anti_proton 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - hPairProd : Emin= 0 eV Emax= 100 TeV + hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi CoulombScat: for anti_proton, integral:1 SubType=1 BuildTable=1 Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 1 @@ -293,9 +295,9 @@ CoulombScat: for anti_proton, integral:1 SubType=1 BuildTable=1 eCoulombScattering : Emin= 0 eV Emax= 100 TeV msc: for kaon+ SubType= 10 - RangeFactor= 0.2, stepLimType: 0, latDisp: 0 ===== EM models for the G4Region DefaultRegionForTheWorld ====== WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llimit=1 hIoni: for kaon+ SubType=2 dE/dx and range tables from 100 eV to 100 TeV in 84 bins @@ -309,14 +311,14 @@ hBrems: for kaon+ SubType=3 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - hBrem : Emin= 0 eV Emax= 100 TeV + hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi hPairProd: for kaon+ 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - hPairProd : Emin= 0 eV Emax= 100 TeV + hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi CoulombScat: for kaon+, integral:1 SubType=1 BuildTable=1 Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 1 @@ -325,9 +327,9 @@ CoulombScat: for kaon+, integral:1 SubType=1 BuildTable=1 eCoulombScattering : Emin= 0 eV Emax= 100 TeV msc: for kaon- SubType= 10 - RangeFactor= 0.2, stepLimType: 0, latDisp: 0 ===== EM models for the G4Region DefaultRegionForTheWorld ====== WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llimit=1 hIoni: for kaon- SubType=2 dE/dx and range tables from 100 eV to 100 TeV in 84 bins @@ -341,14 +343,14 @@ hBrems: for kaon- SubType=3 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - hBrem : Emin= 0 eV Emax= 100 TeV + hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi hPairProd: for kaon- 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - hPairProd : Emin= 0 eV Emax= 100 TeV + hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi CoulombScat: for kaon-, integral:1 SubType=1 BuildTable=1 Used Lambda table of kaon+ @@ -357,9 +359,9 @@ CoulombScat: for kaon-, integral:1 SubType=1 BuildTable=1 eCoulombScattering : Emin= 0 eV Emax= 100 TeV msc: for mu+ SubType= 10 - RangeFactor= 0.2, stepLimType: 0, latDisp: 0, polarAngLim(deg)= 180 ===== EM models for the G4Region DefaultRegionForTheWorld ====== WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llimit=1 muIoni: for mu+ SubType=2 dE/dx and range tables from 100 eV to 100 TeV in 84 bins @@ -374,14 +376,14 @@ muBrems: for mu+ SubType=3 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - MuBrem : Emin= 0 eV Emax= 100 TeV + MuBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi muPairProd: for mu+ 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 1 GeV to 100 TeV ===== EM models for the G4Region DefaultRegionForTheWorld ====== - muPairProd : Emin= 0 eV Emax= 100 TeV + muPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi CoulombScat: for mu+, integral:1 SubType=1 BuildTable=1 Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 1 @@ -390,9 +392,9 @@ CoulombScat: for mu+, integral:1 SubType=1 BuildTable=1 eCoulombScattering : Emin= 0 eV Emax= 100 TeV msc: for mu- SubType= 10 - RangeFactor= 0.2, stepLimType: 0, latDisp: 0, polarAngLim(deg)= 180 ===== EM models for the G4Region DefaultRegionForTheWorld ====== WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llimit=1 muIoni: for mu- SubType=2 dE/dx and range tables from 100 eV to 100 TeV in 84 bins @@ -407,14 +409,14 @@ muBrems: for mu- SubType=3 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - MuBrem : Emin= 0 eV Emax= 100 TeV + MuBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi muPairProd: for mu- 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 1 GeV to 100 TeV ===== EM models for the G4Region DefaultRegionForTheWorld ====== - muPairProd : Emin= 0 eV Emax= 100 TeV + muPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi CoulombScat: for mu-, integral:1 SubType=1 BuildTable=1 Used Lambda table of mu+ @@ -423,9 +425,9 @@ CoulombScat: for mu-, integral:1 SubType=1 BuildTable=1 eCoulombScattering : Emin= 0 eV Emax= 100 TeV msc: for pi+ SubType= 10 - RangeFactor= 0.2, stepLimType: 0, latDisp: 0 ===== EM models for the G4Region DefaultRegionForTheWorld ====== WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llimit=1 hIoni: for pi+ SubType=2 dE/dx and range tables from 100 eV to 100 TeV in 84 bins @@ -439,14 +441,14 @@ hBrems: for pi+ SubType=3 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - hBrem : Emin= 0 eV Emax= 100 TeV + hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi hPairProd: for pi+ 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - hPairProd : Emin= 0 eV Emax= 100 TeV + hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi CoulombScat: for pi+, integral:1 SubType=1 BuildTable=1 Lambda table from threshold to 100 TeV, 7 bins/decade, spline: 1 @@ -455,9 +457,9 @@ CoulombScat: for pi+, integral:1 SubType=1 BuildTable=1 eCoulombScattering : Emin= 0 eV Emax= 100 TeV msc: for pi- SubType= 10 - RangeFactor= 0.2, stepLimType: 0, latDisp: 0 ===== EM models for the G4Region DefaultRegionForTheWorld ====== WentzelVIUni : Emin= 0 eV Emax= 100 TeV Nbins=84 100 eV - 100 TeV + StepLim=Minimal Rfact=0.2 Gfact=2.5 Sfact=0.6 DispFlag:0 Skin=1 Llimit=1 hIoni: for pi- SubType=2 dE/dx and range tables from 100 eV to 100 TeV in 84 bins @@ -471,14 +473,14 @@ hBrems: for pi- SubType=3 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - hBrem : Emin= 0 eV Emax= 100 TeV + hBrem : Emin= 0 eV Emax= 100 TeV ModifiedMephi hPairProd: for pi- 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 ===== EM models for the G4Region DefaultRegionForTheWorld ====== - hPairProd : Emin= 0 eV Emax= 100 TeV + hPairProd : Emin= 0 eV Emax= 100 TeV ModifiedMephi CoulombScat: for pi-, integral:1 SubType=1 BuildTable=1 Used Lambda table of pi+ @@ -507,6 +509,28 @@ CoulombScat: for pi-, integral:1 SubType=1 BuildTable=1 Process: nKiller +--------------------------------------------------- + Hadronic Processes for B- + + Process: hadElastic + Model: hElasticLHEP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + Process: B-Inelastic + Model: FTFP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + +--------------------------------------------------- + Hadronic Processes for D- + + Process: hadElastic + Model: hElasticLHEP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + Process: D-Inelastic + Model: FTFP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + --------------------------------------------------- Hadronic Processes for GenericIon @@ -581,6 +605,19 @@ CoulombScat: for pi-, integral:1 SubType=1 BuildTable=1 Process: hFritiofCaptureAtRest +--------------------------------------------------- + Hadronic Processes for anti_lambda + + Process: hadElastic + Model: hElasticLHEP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + Process: anti_lambdaInelastic + Model: FTFP: 0 eV ---> 100 TeV + Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV + + Process: hFritiofCaptureAtRest + --------------------------------------------------- Hadronic Processes for anti_neutron @@ -692,8 +729,8 @@ CoulombScat: for pi-, integral:1 SubType=1 BuildTable=1 Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV Process: lambdaInelastic - Model: BertiniCascade: 0 eV ---> 6 GeV Model: FTFP: 3 GeV ---> 100 TeV + Model: BertiniCascade: 0 eV ---> 6 GeV Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV --------------------------------------------------- @@ -762,8 +799,8 @@ CoulombScat: for pi-, integral:1 SubType=1 BuildTable=1 Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV Process: sigma-Inelastic - Model: BertiniCascade: 0 eV ---> 6 GeV Model: FTFP: 3 GeV ---> 100 TeV + Model: BertiniCascade: 0 eV ---> 6 GeV Cr_sctns: Glauber-Gribov: 0 eV ---> 100 TeV Process: hBertiniCaptureAtRest @@ -804,7 +841,6 @@ Store e- internal conversion data 0 Electron internal conversion ID 2 Correlated gamma emission flag 0 Max 2J for sampling of angular correlations 10 -Upload data before 1st event for Z < 9 ======================================================================= ========= Table of registered couples ============================ @@ -819,7 +855,7 @@ Index : 0 used in the geometry : Yes Index : 1 used in the geometry : Yes Material : G4_MYLAR Range cuts : gamma 700 um e- 700 um e+ 700 um proton 700 um - Energy thresholds : gamma 2.61463 keV e- 329.273 keV e+ 318.428 keV proton 70 keV + Energy thresholds : gamma 2.6231 keV e- 331.226 keV e+ 320.282 keV proton 70 keV Region(s) which use this couple : DefaultRegionForTheWorld @@ -833,35 +869,35 @@ Index : 2 used in the geometry : Yes Index : 3 used in the geometry : Yes Material : G4_Al Range cuts : gamma 700 um e- 700 um e+ 700 um proton 700 um - Energy thresholds : gamma 5.84069 keV e- 457.179 keV e+ 442.122 keV proton 70 keV + Energy thresholds : gamma 5.85564 keV e- 460.395 keV e+ 442.201 keV proton 70 keV Region(s) which use this couple : DefaultRegionForTheWorld Index : 4 used in the geometry : Yes Material : G4_lH2 Range cuts : gamma 700 um e- 700 um e+ 700 um proton 700 um - Energy thresholds : gamma 990 eV e- 88.0084 keV e+ 87.4209 keV proton 70 keV + Energy thresholds : gamma 990 eV e- 88.1421 keV e+ 87.5518 keV proton 70 keV Region(s) which use this couple : DefaultRegionForTheWorld Index : 5 used in the geometry : Yes Material : G4_Fe Range cuts : gamma 700 um e- 700 um e+ 700 um proton 700 um - Energy thresholds : gamma 17.1704 keV e- 955.109 keV e+ 905.28 keV proton 70 keV + Energy thresholds : gamma 17.2183 keV e- 951.321 keV e+ 901.528 keV proton 70 keV Region(s) which use this couple : DefaultRegionForTheWorld Index : 6 used in the geometry : Yes Material : G4_Cu Range cuts : gamma 700 um e- 700 um e+ 700 um proton 700 um - Energy thresholds : gamma 20.4366 keV e- 1.03504 MeV e+ 981.043 keV proton 70 keV + Energy thresholds : gamma 20.6438 keV e- 1.03121 MeV e+ 977.24 keV proton 70 keV Region(s) which use this couple : DefaultRegionForTheWorld Index : 7 used in the geometry : Yes Material : Scintillator Range cuts : gamma 700 um e- 700 um e+ 700 um proton 700 um - Energy thresholds : gamma 2.11022 keV e- 286.069 keV e+ 278.507 keV proton 70 keV + Energy thresholds : gamma 2.11555 keV e- 283.792 keV e+ 278.128 keV proton 70 keV Region(s) which use this couple : DefaultRegionForTheWorld @@ -875,471 +911,447 @@ Index : 8 used in the geometry : Yes Index : 9 used in the geometry : Yes Material : CsI_Crystal Range cuts : gamma 700 um e- 700 um e+ 700 um proton 700 um - Energy thresholds : gamma 30.9566 keV e- 529.761 keV e+ 502.122 keV proton 70 keV + Energy thresholds : gamma 30.6889 keV e- 526.624 keV e+ 502.425 keV proton 70 keV Region(s) which use this couple : Calorimeter ================================================================== ### Run 0 starts. -Event 36 +Event 206 --- Reconstructed data: -- entry points: - left: -5.9067 -2.29858 -15 cm - right: -0.701155 4.98009 -15 cm + left: 0.279661 -3.90536 -15 cm + right: 8.66082 -4.0998 -15 cm target: 0 0 0 fm - -- the angle: 125.101 deg - -- mass of the output particle: 162.754 MeV - -- mass of the nucleus output particle: 1.34739 GeV + -- the angle: 121.601 deg + -- mass of the output particle: 490.583 MeV + -- mass of the nucleus output particle: 997.229 MeV -- production model data: Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV - Output particle (LAB) : eta 35.9747 1.4478 89.1782 MeV -- 189.0445 MeV - (SCM) : eta 35.9747 1.4478 7.8891 MeV -- 166.8752 MeV - Nucleus output particle (LAB) : neutron -35.9747 -1.4478 640.8218 MeV -- 1.4925 GeV - (SCM) : neutron -35.9747 -1.4478 -7.8891 MeV -- 1.3479 GeV + Output particle (LAB) : eta -120.9344 -38.9507 292.5657 MeV -- 585.1570 MeV + (SCM) : eta -120.9344 -38.9507 42.7675 MeV -- 508.5697 MeV + Nucleus output particle (LAB) : neutron 120.9344 38.9507 437.4343 MeV -- 1.0963 GeV + (SCM) : neutron 120.9344 38.9507 -42.7675 MeV -- 1.0062 GeV -- triggered angular ranges: 4 [ 0.4000, 0.2000) --- Energy Deposit - monitor : 430.38 keV + monitor : 660.907 keV vc (l) : 0 eV vc (r) : 0 eV - cal (l) : 117.444 MeV + cal (l) : 211.083 MeV 0 0 0 0 0 0 - 0 0 0 1.797 0 0.4987 - 0 0 0 91.2 22.61 1.339 + 0 0 1.304 1.382 0.5148 0 + 0 6.943 114.3 62.72 0.2671 1.437 + 0 1.395 12.47 7.873 0.4574 0 + cal (r) : 374.074 MeV 0 0 0 0 0 0 - cal (r) : 71.6004 MeV - 0 0.08572 3.637 6.241 1.701 0 - 0 0.173 35.12 23.69 0.955 0 - 0 0 0 0 0 0 - 0 0 0 0 0 0 -Event 43 + 3.746 2.703 3.565 0 0 0 + 1.268 290.5 6.137 1.015 0 0 + 12.19 47.1 5.896 0 0 0 +Event 704 --- Reconstructed data: -- entry points: - left: -12.2918 1.29805 -15 cm - right: -8.3073 -3.07391 -15 cm + left: -9.28523 2.79254 -15 cm + right: -0.0320336 -1.93889 -15 cm target: 0 0 0 fm - -- the angle: 126.318 deg - -- mass of the output particle: 304.443 MeV - -- mass of the nucleus output particle: 1.21011 GeV + -- the angle: 121.278 deg + -- mass of the output particle: 265.264 MeV + -- mass of the nucleus output particle: 1.24815 GeV -- production model data: Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV - Output particle (LAB) : eta -4.4747 -4.1670 155.8620 MeV -- 342.0757 MeV - (SCM) : eta -4.4747 -4.1670 8.1635 MeV -- 304.6136 MeV - Nucleus output particle (LAB) : neutron 4.4747 4.1670 574.1380 MeV -- 1.3394 GeV - (SCM) : neutron 4.4747 4.1670 -8.1635 MeV -- 1.2102 GeV + Output particle (LAB) : eta -16.1739 1.8692 148.4346 MeV -- 304.4060 MeV + (SCM) : eta -16.1739 1.8692 18.0724 MeV -- 266.3771 MeV + Nucleus output particle (LAB) : neutron 16.1739 -1.8692 581.5654 MeV -- 1.3771 GeV + (SCM) : neutron 16.1739 -1.8692 -18.0724 MeV -- 1.2484 GeV + -- triggered angular ranges: + 2 [ 0.8000, 0.6000) + --- Energy Deposit + monitor : 393.161 keV + vc (l) : 0 eV + vc (r) : 0 eV + cal (l) : 149.543 MeV + 0 0 0.6324 2.577 2.825 4.541 + 0 0 0 0 115.2 1.316 + 0 0 0 0 20.74 1.166 + 0 0 0 0 0.5066 0 + cal (r) : 154.863 MeV + 0 0 0.7944 0.3091 0 0 + 0 1.105 5.044 8.963 0 0 + 0 1.49 32.9 99.01 1.058 0 + 0 1.188 0.6085 1.907 0.4846 0 +Event 3675 + --- Reconstructed data: + -- entry points: + left: -8.12482 -1.2043 -15 cm + right: 11.831 -1.63642 -15 cm + target: 0 0 0 fm + -- the angle: 111.089 deg + -- mass of the output particle: 575.513 MeV + -- mass of the nucleus output particle: 920.846 MeV + -- production model data: + Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV + (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV + Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV + (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV + Output particle (LAB) : eta -45.6110 -16.5957 398.0663 MeV -- 701.4470 MeV + (SCM) : eta -45.6110 -16.5957 103.8377 MeV -- 586.8163 MeV + Nucleus output particle (LAB) : neutron 45.6110 16.5957 331.9337 MeV -- 980.0476 MeV + (SCM) : neutron 45.6110 16.5957 -103.8377 MeV -- 927.9523 MeV -- triggered angular ranges: 1 [ 1.0000, 0.8000) --- Energy Deposit - monitor : 400.027 keV - vc (l) : 41.7699 keV + monitor : 521.984 keV + vc (l) : 0 eV vc (r) : 0 eV - cal (l) : 183.247 MeV - 0 0 0 0 3.008 26.07 - 0 0 0 0.543 19.87 54.79 - 0 0 0 0.6705 24.26 52.27 - 0 0 0 0.363 0 1.394 - cal (r) : 158.829 MeV + cal (l) : 315.799 MeV + 0 0 0 0 0.3902 0.4047 + 0 0 0.6473 6.487 43.26 2.059 + 0 0 0 3.733 251.9 0.7607 + 0 0 0 3.717 2.4 0 + cal (r) : 385.648 MeV + 0.05533 0 0 0 0 0 + 47.89 25.94 0 0 0 0 + 85.79 219.3 0 0 0 0 + 5.496 1.215 0 0 0 0 +Event 5689 + --- Reconstructed data: + -- entry points: + left: -4.23162 -5.22164 -15 cm + right: -10.2049 0.257857 -15 cm + target: 0 0 0 fm + -- the angle: 135.429 deg + -- mass of the output particle: 571.676 MeV + -- mass of the nucleus output particle: 916.713 MeV + -- production model data: + Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV + (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV + Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV + (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV + Output particle (LAB) : eta 130.8992 -34.3615 259.4226 MeV -- 642.2060 MeV + (SCM) : eta 130.8992 -34.3615 -21.5165 MeV -- 587.8702 MeV + Nucleus output particle (LAB) : neutron -130.8992 34.3615 470.5774 MeV -- 1.0393 GeV + (SCM) : neutron -130.8992 34.3615 21.5165 MeV -- 926.8985 MeV + -- triggered angular ranges: + 6 [ 0.0000, -0.2000) + --- Energy Deposit + monitor : 430.919 keV + vc (l) : 0 eV + vc (r) : 0 eV + cal (l) : 408.742 MeV + 0 0 0 0 0 2.727 + 0 0.5286 0 0.9527 2.837 0 + 0 0 1.191 119.8 8.794 3.554 + 0 0.4311 10.28 246.7 10.39 0.523 + cal (r) : 233.464 MeV + 0 0 0 0 3.819 1.266 + 0 0 0 0 116.9 2.896 + 0 0 0 0.9959 84.82 20.72 + 0 0 0 0 2.019 0 +Event 7948 + --- Reconstructed data: + -- entry points: + left: -6.18349 6.41759 -15 cm + right: -8.19992 2.12718 -15 cm + target: 0 0 0 fm + -- the angle: 131.295 deg + -- mass of the output particle: 500.942 MeV + -- mass of the nucleus output particle: 976.569 MeV + -- production model data: + Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV + (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV + Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV + (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV + Output particle (LAB) : eta -150.4224 35.1231 213.7638 MeV -- 566.1255 MeV + (SCM) : eta -150.4224 35.1231 -35.5360 MeV -- 525.4197 MeV + Nucleus output particle (LAB) : neutron 150.4224 -35.1231 516.2362 MeV -- 1.1154 GeV + (SCM) : neutron 150.4224 -35.1231 35.5360 MeV -- 989.3489 MeV + -- triggered angular ranges: + 7 [-0.2000, -0.4000) + --- Energy Deposit + monitor : 461.389 keV + vc (l) : 0 eV + vc (r) : 30.236 keV + cal (l) : 215.709 MeV + 0 0 0.5764 56.62 97.49 0.9733 + 0 0 0 34.44 24.72 0 + 0 0 0 0.5898 0.2999 0 0 0 0 0 0 0 - 0 0 0 0.5168 1.797 1.045 - 0 0 0 10.46 139.1 1.176 - 0 0 0 1.325 3.288 0.1559 -Event 1343 + cal (r) : 350.416 MeV + 0 0 0.7501 0.765 4.834 2.178 + 0 0 6.003 9.046 297.5 13.69 + 0 0 0.1387 3.938 3.873 4.673 + 0 0 0 0.9534 0 2.104 +Event 8031 --- Track Points - monitor : pi- [1,bp] 725.8 MeV : -0.761 1.079 -0.125 cm [0.003715, -0.01055, 0.9999] - target : pi- [1,bp] 725.3 MeV : 2.689 4.215 0.7846 cm [-0.6395, -0.7687, -0.01008] - : eta [6,op] 351.1 MeV : -1.021 -0.2441 0.7262 cm [-0.5018, -0.8065, -0.3126] - : neutron [7,np] 409.5 MeV : -1.021 -0.2441 0.7262 cm [-0.7019, -0.6663, 0.2515] - : pi0 [10,opdp] 96.91 MeV : -1.021 -0.2441 0.7262 cm [-0.9651, -0.2597, 0.03299] - : pi0 [8,opdp] 262.5 MeV : -1.021 -0.2441 0.7262 cm [0.02303, -0.7166, -0.6971] + monitor : pi- [1,bp] 727.2 MeV : 1.59 0.4321 -0.125 cm [-0.000548, -0.02195, 0.9998] + target : pi- [1,bp] 725.9 MeV : 4.241 2.649 -0.2809 cm [-0.6432, -0.7653, -0.02504] + : eta [4,op] 367.5 MeV : 2.655 0.7615 -0.3427 cm [-0.8399, -0.5427, 0.001686] + : neutron [5,np] 389.5 MeV : 2.655 0.7615 -0.3427 cm [-0.4048, -0.9131, -0.04975] + : gamma [7,opdp] 399.7 MeV : 2.655 0.7615 -0.3427 cm [-0.9927, 0.1113, -0.04573] + : gamma [6,opdp] 260 MeV : 2.655 0.7615 -0.3427 cm [0.3388, -0.9381, 0.07267] + vc (l) : gamma [6,opdp] 260 MeV : -2.522 3.924 -0.25 cm [-0.08942, 0.07267, 0.9933] + vc (r) : gamma [7,opdp] 399.7 MeV : 7.827 -3.172 -0.25 cm [0.1495, -0.04573, 0.9877] + cal (l) : gamma [6,opdp] 260 MeV : -2.635 4.015 -15 cm [-0.08942, 0.07267, 0.9933] + cal (r) : gamma [7,opdp] 399.7 MeV : 8.016 -3.23 -15 cm [0.1495, -0.04573, 0.9877] + --- + angle between the eta decay products : 116.358 deg + --- Triggered angular ranges: + 3 [ 0.6000, 0.4000) + --- Production model data: + Incident particle (LAB) : pi- -0.4505 -18.7592 724.9999 MeV -- 738.5505 MeV + (SCM) : pi- -0.2796 -11.6420 449.9370 MeV -- 471.2311 MeV + Nucleus particle (LAB) : proton 0.0000 -0.0000 0.0000 eV -- 938.2720 MeV + (SCM) : proton 0.2796 11.6420 -449.9370 MeV -- 1.0406 GeV + Output particle (LAB) : eta -108.2704 0.6198 351.2239 MeV -- 659.7226 MeV + (SCM) : eta -108.0976 7.8146 73.1616 MeV -- 563.2509 MeV + Nucleus output particle (LAB) : neutron 107.8199 -19.3790 373.7760 MeV -- 1.0171 GeV + (SCM) : neutron 108.0976 -7.8146 -73.1616 MeV -- 948.6210 MeV + --- Reconstructed data: + -- entry points: + left: -2.97529 3.53056 -15 cm + right: 8.00899 -2.46863 -15 cm + target: 0 0 0 fm + -- the angle: 119.633 deg + -- mass of the output particle: 532.749 MeV + -- mass of the nucleus output particle: 963.383 MeV + -- production model data: + Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV + (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV + Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV + (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV + Output particle (LAB) : eta -100.4563 -0.8898 321.2709 MeV -- 630.1818 MeV + (SCM) : eta -100.4563 -0.8898 52.9339 MeV -- 544.7165 MeV + Nucleus output particle (LAB) : neutron 100.4563 0.8898 408.7291 MeV -- 1.0513 GeV + (SCM) : neutron 100.4563 0.8898 -52.9339 MeV -- 970.0522 MeV + -- triggered angular ranges: + 3 [ 0.6000, 0.4000) + --- Energy Deposit + monitor : 1.1986 MeV + vc (l) : 0 eV + vc (r) : 0 eV + cal (l) : 249.343 MeV + 0 0.7986 2.866 15.93 1.235 0 + 0 0 7.789 207.1 2.949 3.408 + 0 0 4.45 2.165 0.3889 0.3022 + 0 0 0 0 0 0 + cal (r) : 380.839 MeV + 0.378 0.9575 0.03518 0 0 0 + 2.085 5.011 5.489 0.2953 0 0 + 1.29 332.2 17.73 0.4702 0.2353 0 + 9.187 4.363 0.7379 0.4034 0 0 +Event 8453 + --- Track Points + monitor : pi- [1,bp] 734.3 MeV : 1.063 0.3207 -0.125 cm [0.002178, -0.0003897, 1] + target : pi- [1,bp] 733.6 MeV : 3.992 3.011 0.3062 cm [-0.641, -0.7676, -0.0008455] + : eta [4,op] 324.4 MeV : 3.458 2.371 0.3055 cm [-0.9083, -0.4113, 0.07661] + : neutron [5,np] 464.7 MeV : 3.458 2.371 0.3055 cm [-0.3779, -0.9243, -0.05437] + : gamma [7,opdp] 237.7 MeV : 3.458 2.371 0.3055 cm [0.3973, -0.9177, 0.001144] + : gamma [6,opdp] 398.9 MeV : 3.458 2.371 0.3055 cm [-0.9752, 0.2125, 0.06161] + vc (l) : gamma [7,opdp] 237.7 MeV : 2.483 0.3734 -0.25 cm [-0.0278, 0.001144, 0.9996] + vc (r) : gamma [6,opdp] 398.9 MeV : -0.2771 4.104 -0.25 cm [0.04716, 0.06161, 0.997] + cal (l) : gamma [7,opdp] 237.7 MeV : 2.448 0.3749 -15 cm [-0.0278, 0.001144, 0.9996] + cal (r) : gamma [6,opdp] 398.9 MeV : -0.218 4.181 -15 cm [0.04716, 0.06161, 0.997] + --- + angle between the eta decay products : 125.615 deg + --- Triggered angular ranges: + 5 [ 0.2000, 0.0000) + --- Production model data: + Incident particle (LAB) : pi- 1.6296 -0.4167 733.4303 MeV -- 746.5941 MeV + (SCM) : pi- 1.0080 -0.2578 453.6735 MeV -- 474.6583 MeV + Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV + (SCM) : proton -1.0080 0.2578 -453.6735 MeV -- 1.0422 GeV + Output particle (LAB) : eta -139.9160 24.8483 291.5661 MeV -- 636.6769 MeV + (SCM) : eta -140.5283 25.0049 15.9784 MeV -- 566.3758 MeV + Nucleus output particle (LAB) : neutron 141.5456 -25.2650 441.8642 MeV -- 1.0482 GeV + (SCM) : neutron 140.5283 -25.0049 -15.9784 MeV -- 950.4798 MeV + --- Reconstructed data: + -- entry points: + left: 2.89261 1.94969 -15 cm + right: 0.0704611 3.68174 -15 cm + target: 0 0 0 fm + -- the angle: 132.412 deg + -- mass of the output particle: 541.276 MeV + -- mass of the nucleus output particle: 937.661 MeV + -- production model data: + Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV + (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV + Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV + (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV + Output particle (LAB) : eta -153.7724 31.4244 251.0538 MeV -- 616.9614 MeV + (SCM) : eta -153.7724 31.4244 -18.6406 MeV -- 563.8802 MeV + Nucleus output particle (LAB) : neutron 153.7724 -31.4244 478.9462 MeV -- 1.0645 GeV + (SCM) : neutron 153.7724 -31.4244 18.6406 MeV -- 950.8885 MeV + -- triggered angular ranges: + 6 [ 0.0000, -0.2000) + --- Energy Deposit + monitor : 555.52 keV + vc (l) : 0 eV + vc (r) : 0 eV + cal (l) : 220.874 MeV + 0.1232 0.1965 1.72 0.3388 0 0 + 0.01192 0 187.3 1.338 0 0 + 0 0.6442 28.41 0.7547 0 0 + 0 0 0 0 0 0 + cal (r) : 396.088 MeV + 0 0.8454 14.69 5.46 0.1124 1.135 + 0 0.3678 275.4 88.15 6.208 0 + 0 1.166 1.208 0.9934 0.3767 0 + 0 0 0 0 0 0 +Event 8814 + --- Track Points + monitor : pi- [1,bp] 725.1 MeV : -0.8739 1.901 -0.125 cm [0.003236, -0.00523, 1] + target : pi- [1,bp] 724.6 MeV : 2.65 4.24 1.803 cm [-0.6372, -0.7707, -0.002644] + : eta [4,op] 241.2 MeV : -1.215 -0.4384 1.789 cm [-0.6156, -0.6279, -0.4762] + : neutron [5,np] 524.4 MeV : -1.215 -0.4384 1.789 cm [-0.5941, -0.7748, 0.2161] + : pi0 [8,opdp] 39.97 MeV : -1.215 -0.4384 1.789 cm [-0.689, -0.7116, -0.1376] + : pi0 [6,opdp] 195.9 MeV : -1.215 -0.4384 1.789 cm [0.2569, -0.7748, -0.5777] vc (l) : tp is not valid vc (r) : tp is not valid cal (l) : tp is not valid cal (r) : tp is not valid --- - angle between the eta decay products : 81.9006 deg - --- Triggered angular ranges: - 3 [ 0.6000, 0.4000) - --- Production model data: - Incident particle (LAB) : pi- 2.2433 -6.7421 724.0310 MeV -- 737.3949 MeV - (SCM) : pi- 1.3929 -4.1862 449.5490 MeV -- 470.7373 MeV - Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV - (SCM) : proton -1.3929 4.1862 -449.5490 MeV -- 1.0404 GeV - Output particle (LAB) : eta 47.0459 -109.7506 330.2058 MeV -- 650.7282 MeV - (SCM) : eta 46.1917 -107.1833 54.4977 MeV -- 562.8008 MeV - Nucleus output particle (LAB) : neutron -44.8026 103.0085 393.8252 MeV -- 1.0249 GeV - (SCM) : neutron -46.1917 107.1833 -54.4977 MeV -- 948.3538 MeV - --- Reconstructed data: - -- entry points: - left: -2.31253 -2.78457 -15 cm - right: 4.35408 3.79307 -15 cm - target: 0 0 0 fm - -- the angle: 123.726 deg - -- mass of the output particle: 128.75 MeV - -- mass of the nucleus output particle: 1.37645 GeV - -- production model data: - Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV - (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV - Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV - (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV - Output particle (LAB) : eta -47.4239 4.3214 74.4305 MeV -- 156.1542 MeV - (SCM) : eta -47.4239 4.3214 7.3687 MeV -- 137.4720 MeV - Nucleus output particle (LAB) : neutron 47.4239 -4.3214 655.5695 MeV -- 1.5253 GeV - (SCM) : neutron 47.4239 -4.3214 -7.3687 MeV -- 1.3773 GeV - -- triggered angular ranges: - 5 [ 0.2000, 0.0000) - --- Energy Deposit - monitor : 393.075 keV - vc (l) : 0 eV - vc (r) : 0 eV - cal (l) : 50.387 MeV - 0 0 1.936 0 0 0 - 0 0 0.6419 0 0 0 - 0 0 0.2233 43.04 0.2638 0 - 0 0 0.1139 3.132 1.031 0 - cal (r) : 105.767 MeV - 0 5.423 1.3 0.3921 0 0 - 0 11.56 83.95 0.6492 0 0 - 0 0 2.491 0 0 0 - 0 0 0 0 0 0 -Event 3701 - --- Reconstructed data: - -- entry points: - left: -5.07566 -3.64981 -15 cm - right: 3 2.6317 -15 cm - target: 0 0 0 fm - -- the angle: 122.381 deg - -- mass of the output particle: 139.782 MeV - -- mass of the nucleus output particle: 1.37136 GeV - -- production model data: - Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV - (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV - Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV - (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV - Output particle (LAB) : eta 28.9041 -3.1737 79.1612 MeV -- 163.2515 MeV - (SCM) : eta 28.9041 -3.1737 9.1998 MeV -- 143.0706 MeV - Nucleus output particle (LAB) : neutron -28.9041 3.1737 650.8388 MeV -- 1.5182 GeV - (SCM) : neutron -28.9041 3.1737 -9.1998 MeV -- 1.3717 GeV - -- triggered angular ranges: - 4 [ 0.4000, 0.2000) - --- Energy Deposit - monitor : 377.459 keV - vc (l) : 0 eV - vc (r) : 0 eV - cal (l) : 98.9609 MeV - 0 0 0 0 0 0 - 0 0 0 0.5817 0.2417 0.1484 - 0 0 0 69.97 23.2 0.06408 - 0 0 1.133 2.695 0.9288 0 - cal (r) : 64.2906 MeV - 0 0 0 0 0 0 - 0 0 64.02 0 0 0 - 0 0 0.2738 0 0 0 - 0 0 0 0 0 0 -Event 8189 - --- Reconstructed data: - -- entry points: - left: 8.54865 4.48527 -15 cm - right: 4.97776 -1.96609 -15 cm - target: 0 0 0 fm - -- the angle: 133.38 deg - -- mass of the output particle: 136.301 MeV - -- mass of the nucleus output particle: 1.3772 GeV - -- production model data: - Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV - (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV - Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV - (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV - Output particle (LAB) : eta -17.2473 1.7136 61.8785 MeV -- 150.6898 MeV - (SCM) : eta -17.2473 1.7136 -3.9314 MeV -- 137.4551 MeV - Nucleus output particle (LAB) : neutron 17.2473 -1.7136 668.1215 MeV -- 1.5308 GeV - (SCM) : neutron 17.2473 -1.7136 3.9314 MeV -- 1.3773 GeV - -- triggered angular ranges: - 7 [-0.2000, -0.4000) - --- Energy Deposit - monitor : 399.616 keV - vc (l) : 0 eV - vc (r) : 0 eV - cal (l) : 62.3043 MeV - 0.6582 9.939 0 0 0 0 - 6.484 24.41 20.81 0 0 0 - 0 0 0 0 0 0 - 0 0 0 0 0 0 - cal (r) : 88.3855 MeV - 0 0 0.3558 0.4282 0 0 - 0 1.157 0.0885 0.7418 0 0 - 0.3999 19.46 64.46 0 0 0 - 0 0.5647 0.7307 0 0 0 -Event 10459 - --- Track Points - monitor : pi- [1,bp] 729.7 MeV : -8.841 -8.849 -1.25 mm [-0.01192, 0.00229, 0.9999] - target : pi- [1,bp] 729.2 MeV : 2.144 4.517 -0.7797 cm [-0.6524, -0.7579, 0.003233] - : eta [3,op] 230.1 MeV : -2.913 -1.357 -0.7546 cm [-0.2118, -0.9522, 0.2201] - : neutron [4,np] 542.1 MeV : -2.913 -1.357 -0.7546 cm [-0.7838, -0.6143, -0.09131] - : gamma [6,opdp] 362 MeV : -2.913 -1.357 -0.7546 cm [0.4388, -0.8917, 0.111] - : gamma [5,opdp] 232.2 MeV : -2.913 -1.357 -0.7546 cm [-0.8937, 0.4464, 0.04514] - vc (l) : gamma [6,opdp] 362 MeV : -1.983 5.808 -0.25 cm [0.0208, 0.111, 0.9936] - vc (r) : gamma [5,opdp] 232.2 MeV : -9.427 1.841 -0.25 cm [-0.1998, 0.04514, 0.9788] - cal (l) : gamma [6,opdp] 362 MeV : -1.947 6 -14.53 cm [0.0208, 0.111, 0.9936] - cal (r) : gamma [5,opdp] 232.2 MeV : -9.682 1.899 -15 cm [-0.1998, 0.04514, 0.9788] - --- - angle between the eta decay products : 141.734 deg + angle between the eta decay products : 63.0106 deg --- Triggered angular ranges: 8 [-0.4000, -0.6000) --- Production model data: - Incident particle (LAB) : pi- -7.9134 1.1626 727.3671 MeV -- 740.6799 MeV - (SCM) : pi- -4.9068 0.7209 451.0121 MeV -- 472.1401 MeV - Nucleus particle (LAB) : proton -0.0000 0.0000 0.0000 eV -- 938.2720 MeV - (SCM) : proton 4.9068 -0.7209 -451.0121 MeV -- 1.0411 GeV - Output particle (LAB) : eta 103.5084 50.6584 199.1836 MeV -- 594.2282 MeV - (SCM) : eta 106.3799 50.2365 -64.7503 MeV -- 564.0796 MeV - Nucleus output particle (LAB) : neutron -111.4218 -49.4958 528.1836 MeV -- 1.0847 GeV - (SCM) : neutron -106.3799 -50.2365 64.7503 MeV -- 949.1133 MeV + Incident particle (LAB) : pi- 6.1133 -1.5483 722.9508 MeV -- 736.3270 MeV + (SCM) : pi- 3.7974 -0.9618 449.0754 MeV -- 470.2806 MeV + Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV + (SCM) : proton -3.7974 0.9618 -449.0754 MeV -- 1.0402 GeV + Output particle (LAB) : eta -16.4024 -114.8730 211.4647 MeV -- 598.6108 MeV + (SCM) : eta -18.6307 -114.3086 -52.0576 MeV -- 562.3845 MeV + Nucleus output particle (LAB) : neutron 22.5157 113.3247 511.4861 MeV -- 1.0760 GeV + (SCM) : neutron 18.6307 114.3086 52.0576 MeV -- 948.1069 MeV --- Reconstructed data: -- entry points: - left: 0.241024 4.76172 -15 cm - right: -11.003 2.73892 -15 cm + left: 3.70738 3.0377 -15 cm + right: -0.263301 6.30713 -15 cm target: 0 0 0 fm - -- the angle: 140.016 deg - -- mass of the output particle: 538.411 MeV - -- mass of the nucleus output particle: 943.955 MeV + -- the angle: 133.003 deg + -- mass of the output particle: 213.984 MeV + -- mass of the nucleus output particle: 1.29238 GeV -- production model data: Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV - Output particle (LAB) : eta 135.6376 39.7659 213.2071 MeV -- 596.0891 MeV - (SCM) : eta 135.6376 39.7659 -50.5941 MeV -- 558.9497 MeV - Nucleus output particle (LAB) : neutron -135.6376 -39.7659 516.7929 MeV -- 1.0854 GeV - (SCM) : neutron -135.6376 -39.7659 50.5941 MeV -- 955.8190 MeV - -- triggered angular ranges: - 7 [-0.2000, -0.4000) - --- Energy Deposit - monitor : 374.608 keV - vc (l) : 0 eV - vc (r) : 0 eV - cal (l) : 380.306 MeV - 0 0.02467 25.49 274.1 0.03377 0 - 0.4774 7.223 21.86 40.51 0.1217 0 - 0.5437 4.852 1.819 0.5596 0.7458 0.9547 - 0 0.9789 0 0 0 0 - cal (r) : 215.783 MeV - 0 0 0 2.45 2.623 8.507 - 0 0 0 0.8111 108.5 79.9 - 0 0 0 0.3829 6.732 4.774 - 0 0 0 0 1.135 0 -Event 14286 - --- Track Points - monitor : pi- [1,bp] 727.9 MeV : -1.554 0.9442 -0.125 cm [0.007357, 0.003993, 1] - target : pi- [1,bp] 727.4 MeV : 2.021 4.573 1.06 cm [-0.6387, -0.7694, 0.003665] - : eta [3,op] 366.6 MeV : -3.349 -1.895 1.091 cm [-0.3844, -0.9221, -0.04409] - : neutron [4,np] 391 MeV : -3.349 -1.895 1.091 cm [-0.8266, -0.5609, 0.04568] - : gamma [6,opdp] 269.5 MeV : -3.349 -1.895 1.091 cm [-0.9918, 0.1134, -0.05952] - : gamma [5,opdp] 389.7 MeV : -3.349 -1.895 1.091 cm [0.3243, -0.946, -0.0003141] - vc (l) : gamma [5,opdp] 389.7 MeV : -10.06 1.073 -0.25 cm [-0.1059, -0.0003141, 0.9944] - vc (r) : gamma [6,opdp] 269.5 MeV : 11.04 -2.285 -0.25 cm [0.1471, -0.05952, 0.9873] - cal (l) : gamma [5,opdp] 389.7 MeV : -10.19 1.072 -15 cm [-0.1059, -0.0003141, 0.9944] - cal (r) : gamma [6,opdp] 269.5 MeV : 11.23 -2.361 -15 cm [0.1471, -0.05952, 0.9873] - --- - angle between the eta decay products : 115.396 deg - --- Triggered angular ranges: - 3 [ 0.6000, 0.4000) - --- Production model data: - Incident particle (LAB) : pi- 2.7157 1.6918 725.2936 MeV -- 738.6073 MeV - (SCM) : pi- 1.6854 1.0499 450.1087 MeV -- 471.2554 MeV - Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV - (SCM) : proton -1.6854 -1.0499 -450.1087 MeV -- 1.0407 GeV - Output particle (LAB) : eta 109.3320 -16.1657 349.5698 MeV -- 659.2167 MeV - (SCM) : eta 108.2908 -16.8143 71.5130 MeV -- 563.2730 MeV - Nucleus output particle (LAB) : neutron -106.6162 17.8575 375.7237 MeV -- 1.0177 GeV - (SCM) : neutron -108.2908 16.8143 -71.5130 MeV -- 948.6342 MeV - --- Reconstructed data: - -- entry points: - left: -10.1577 2.86703 -15 cm - right: 12.7865 -3.73716 -15 cm - target: 0 0 0 fm - -- the angle: 108.478 deg - -- mass of the output particle: 488.91 MeV - -- mass of the nucleus output particle: 1.00148 GeV - -- production model data: - Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV - (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV - Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV - (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV - Output particle (LAB) : eta 79.0924 0.5719 354.2643 MeV -- 608.9266 MeV - (SCM) : eta 79.0924 0.5719 99.8020 MeV -- 505.2217 MeV - Nucleus output particle (LAB) : neutron -79.0924 -0.5719 375.7357 MeV -- 1.0726 GeV - (SCM) : neutron -79.0924 -0.5719 -99.8020 MeV -- 1.0095 GeV - -- triggered angular ranges: - 2 [ 0.8000, 0.6000) - --- Energy Deposit - monitor : 393.067 keV - vc (l) : 0 eV - vc (r) : 0 eV - cal (l) : 348.559 MeV - 0 0 0 0.9714 12.01 2.263 - 0 0 0 2.212 268.3 48.84 - 0 0 0 1.558 7.847 4.467 - 0 0 0 0 0 0.09546 - cal (r) : 260.367 MeV - 0 0 0 0 0 0 - 1.654 0.7717 0 0 0 0 - 177.1 62.63 0 0 0 0 - 14.35 3.822 0 0 0 0 -Event 14640 - --- Reconstructed data: - -- entry points: - left: 8.08415 -0.21177 -15 cm - right: -9.35195 0.743755 -15 cm - target: 0 0 0 fm - -- the angle: 146.53 deg - -- mass of the output particle: 223.409 MeV - -- mass of the nucleus output particle: 1.28056 GeV - -- production model data: - Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV - (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV - Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV - (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV - Output particle (LAB) : eta 52.0746 0.6147 69.5590 MeV -- 239.7128 MeV - (SCM) : eta 52.0746 0.6147 -38.3077 MeV -- 232.5753 MeV - Nucleus output particle (LAB) : neutron -52.0746 -0.6147 660.4410 MeV -- 1.4418 GeV - (SCM) : neutron -52.0746 -0.6147 38.3077 MeV -- 1.2822 GeV - -- triggered angular ranges: - 8 [-0.4000, -0.6000) - --- Energy Deposit - monitor : 398.251 keV - vc (l) : 0 eV - vc (r) : 0 eV - cal (l) : 147.416 MeV - 0 1.265 0 0 0 0 - 3.656 16.16 1.603 0.8852 0 0 - 0 119.1 4.737 0 0 0 - 0 0 0 0 0 0 - cal (r) : 92.2965 MeV - 0 0 0 0 0.2606 0 - 0 0 0 0.1823 84.62 0.7125 - 0 0 0 0.4276 4.34 0 - 0 0 0 0 0.4331 1.316 -Event 15894 - --- Reconstructed data: - -- entry points: - left: -8.44995 1.94401 -15 cm - right: -1.65893 -0.0051734 -15 cm - target: 0 0 0 fm - -- the angle: 123.548 deg - -- mass of the output particle: 529.923 MeV - -- mass of the nucleus output particle: 958.145 MeV - -- production model data: - Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV - (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV - Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV - (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV - Output particle (LAB) : eta 129.1505 12.8400 308.0124 MeV -- 626.5256 MeV - (SCM) : eta 129.1505 12.8400 39.9780 MeV -- 547.0475 MeV - Nucleus output particle (LAB) : neutron -129.1505 -12.8400 421.9876 MeV -- 1.0550 GeV - (SCM) : neutron -129.1505 -12.8400 -39.9780 MeV -- 967.7212 MeV - -- triggered angular ranges: - 4 [ 0.4000, 0.2000) - --- Energy Deposit - monitor : 384.529 keV - vc (l) : 0 eV - vc (r) : 0 eV - cal (l) : 401.018 MeV - 0 0 0 0.1682 0.5164 2.564 - 0 1.05 3.136 2.604 297 77.57 - 0 1.021 4.281 0.7735 3.653 5.719 - 0 0 0 0 0.9337 0 - cal (r) : 225.508 MeV - 0 0 0 0.3533 0.1934 0 - 0 0.4607 47.03 61.21 0.1372 0 - 0 0 3.327 110.4 0.12 0.4018 - 0 0 0.4771 0 1.364 0 -Event 17966 - --- Track Points - monitor : pi- [1,bp] 732.7 MeV : 4.217 8.887 -1.25 mm [0.001636, -0.003584, 1] - target : pi- [1,bp] 732.1 MeV : 3.566 3.505 0.809 cm [-0.6419, -0.7667, -0.003101] - : eta [4,op] 260.8 MeV : -2.18 -3.358 0.7807 cm [-0.9395, -0.34, 0.04194] - : neutron [5,np] 521.1 MeV : -2.18 -3.358 0.7807 cm [-0.4298, -0.9025, -0.0271] - : gamma [7,opdp] 372.1 MeV : -2.18 -3.358 0.7807 cm [-0.9472, 0.3201, -0.02046] - : gamma [6,opdp] 234.6 MeV : -2.18 -3.358 0.7807 cm [0.458, -0.8854, 0.07905] - vc (l) : gamma [6,opdp] 234.6 MeV : -1.072 5.275 -0.25 cm [0.04086, 0.07905, 0.996] - vc (r) : gamma [7,opdp] 372.1 MeV : 1.184 -3.984 -2.5 mm [-0.064, -0.02046, 0.9977] - cal (l) : gamma [6,opdp] 234.6 MeV : -1.02 5.374 -15 cm [0.04086, 0.07905, 0.996] - cal (r) : gamma [7,opdp] 372.1 MeV : 0.03821 -0.424 -15 cm [-0.064, -0.02046, 0.9977] - --- - angle between the eta decay products : 135.955 deg - --- Triggered angular ranges: - 7 [-0.2000, -0.4000) - --- Production model data: - Incident particle (LAB) : pi- 0.0444 -3.1869 729.6558 MeV -- 742.8914 MeV - (SCM) : pi- 0.0275 -1.9743 452.0217 MeV -- 473.0828 MeV - Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV - (SCM) : proton -0.0275 1.9743 -452.0217 MeV -- 1.0415 GeV - Output particle (LAB) : eta -130.6850 10.9376 225.4060 MeV -- 606.7609 MeV - (SCM) : eta -130.7013 12.1061 -42.1193 MeV -- 564.9391 MeV - Nucleus output particle (LAB) : neutron 130.7294 -14.1245 504.2498 MeV -- 1.0744 GeV - (SCM) : neutron 130.7013 -12.1061 42.1193 MeV -- 949.6244 MeV - --- Reconstructed data: - -- entry points: - left: -2.02331 5.60821 -15 cm - right: -1.92436 -0.434827 -15 cm - target: 0 0 0 fm - -- the angle: 129.747 deg - -- mass of the output particle: 524.85 MeV - -- mass of the nucleus output particle: 957.576 MeV - -- production model data: - Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV - (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV - Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV - (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV - Output particle (LAB) : eta -147.5307 18.0510 248.6759 MeV -- 599.4982 MeV - (SCM) : eta -147.5307 18.0510 -12.8643 MeV -- 545.6408 MeV - Nucleus output particle (LAB) : neutron 147.5307 -18.0510 481.3241 MeV -- 1.0820 GeV - (SCM) : neutron 147.5307 -18.0510 12.8643 MeV -- 969.1279 MeV + Output particle (LAB) : eta -51.2188 20.2650 95.6243 MeV -- 240.7637 MeV + (SCM) : eta -51.2188 20.2650 -9.8799 MeV -- 221.1804 MeV + Nucleus output particle (LAB) : neutron 51.2188 -20.2650 634.3757 MeV -- 1.4407 GeV + (SCM) : neutron 51.2188 -20.2650 9.8799 MeV -- 1.2936 GeV -- triggered angular ranges: 6 [ 0.0000, -0.2000) --- Energy Deposit - monitor : 418.518 keV + monitor : 411.97 keV vc (l) : 0 eV vc (r) : 0 eV - cal (l) : 223.363 MeV - 0 0.4055 5.822 118.6 0.1613 0 - 0 0 2.844 93.79 0.3101 0 - 0 0 0.6971 0.3144 0.4114 0 + cal (l) : 90.7073 MeV + 0.449 0.5764 0.5669 1.041 0 0 + 3.519 0.973 61.89 19.29 0 0 + 0.4262 0.5326 0.5577 0.8809 0 0 0 0 0 0 0 0 - cal (r) : 376.136 MeV - 0 0 0 0.6373 0.06954 0.3219 - 0 0.4277 18 30.89 9.964 0 - 0 0.825 28.51 285.3 1.163 0 + cal (r) : 150.056 MeV + 0.6575 1.975 11.35 82.03 0.3321 0 + 0 0.6641 4.814 47.44 0 0 + 0 0 0 0.786 0 0 + 0 0 0 0 0 0 +Event 9834 + --- Reconstructed data: + -- entry points: + left: -2.40254 5.40549 -15 cm + right: 9.8561 2.4964 -15 cm + target: 0 0 0 fm + -- the angle: 117.989 deg + -- mass of the output particle: 217.764 MeV + -- mass of the nucleus output particle: 1.29479 GeV + -- production model data: + Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV + (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV + Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV + (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV + Output particle (LAB) : eta -7.6121 16.2076 130.8642 MeV -- 254.6902 MeV + (SCM) : eta -7.6121 16.2076 22.5272 MeV -- 219.6569 MeV + Nucleus output particle (LAB) : neutron 7.6121 -16.2076 599.1358 MeV -- 1.4268 GeV + (SCM) : neutron 7.6121 -16.2076 -22.5272 MeV -- 1.2951 GeV + -- triggered angular ranges: + 2 [ 0.8000, 0.6000) + --- Energy Deposit + monitor : 556.783 keV + vc (l) : 0 eV + vc (r) : 0 eV + cal (l) : 118.429 MeV + 0 0 1.436 45.51 1.198 0 + 0 0 5.263 63.68 0.9284 0 + 0 0 0.4215 0 0 0 + 0 0 0 0 0 0 + cal (r) : 136.262 MeV + 1.732 9.715 0 0 0 0 + 4.061 110.7 0.8083 0 0 0 + 4.589 2.627 1.47 0 0 0 + 0 0.5151 0 0 0 0 +Event 9952 + --- Reconstructed data: + -- entry points: + left: 9.33026 -3.06906 -15 cm + right: 2.60776 6.36359 -15 cm + target: 0 0 0 fm + -- the angle: 136.381 deg + -- mass of the output particle: 458.847 MeV + -- mass of the nucleus output particle: 1.05006 GeV + -- production model data: + Incident particle (LAB) : pi- 0.0000 0.0000 730.0000 MeV -- 743.2226 MeV + (SCM) : pi- 0.0000 0.0000 452.1737 MeV -- 473.2239 MeV + Nucleus particle (LAB) : proton 0.0000 0.0000 0.0000 eV -- 938.2720 MeV + (SCM) : proton 0.0000 0.0000 -452.1737 MeV -- 1.0415 GeV + Output particle (LAB) : eta -50.3787 19.6171 191.0855 MeV -- 499.9774 MeV + (SCM) : eta -50.3787 19.6171 -28.8324 MeV -- 462.9201 MeV + Nucleus output particle (LAB) : neutron 50.3787 -19.6171 538.9145 MeV -- 1.1815 GeV + (SCM) : neutron 50.3787 -19.6171 28.8324 MeV -- 1.0518 GeV + -- triggered angular ranges: + 8 [-0.4000, -0.6000) + --- Energy Deposit + monitor : 634.172 keV + vc (l) : 0 eV + vc (r) : 0 eV + cal (l) : 212.164 MeV + 0 0 0 0 0 0 + 0.2423 3.486 1.298 0 0 0 + 7.724 191.7 0.687 0 0 0 + 0.4591 6.182 0.3836 0 0 0 + cal (r) : 287.814 MeV + 0 1.098 230.6 12.33 0 0 + 3.567 1.297 15.82 22.16 0 0 + 0 0.5338 0 0.3863 0 0 0 0 0 0 0 0 Run terminated. Run Summary - Number of events processed : 17967, effectively: 10 - User=34.300000s Real=34.930461s Sys=0.040000s + Number of events processed : 9953, effectively: 10 + User=8.210000s Real=8.820152s Sys=0.000000s --- Setup acceptances (range | real (trg / mon) | rec (trg / mon / all)): - 1 [ 1.0000, 0.8000) | 0.00000000 ( 0 / 511 ) | 0.00000000 ( 0 / 511 / 636 ) - 2 [ 0.8000, 0.6000) | 0.00000000 ( 0 / 492 ) | 0.00203252 ( 1 / 492 / 608 ) - 3 [ 0.6000, 0.4000) | 0.00393701 ( 2 / 508 ) | 0.00000000 ( 0 / 508 / 630 ) - 4 [ 0.4000, 0.2000) | 0.00000000 ( 0 / 513 ) | 0.00000000 ( 0 / 513 / 626 ) - 5 [ 0.2000, 0.0000) | 0.00000000 ( 0 / 525 ) | 0.00190476 ( 1 / 525 / 644 ) - 6 [ 0.0000, -0.2000) | 0.00000000 ( 0 / 517 ) | 0.00193424 ( 1 / 517 / 645 ) - 7 [-0.2000, -0.4000) | 0.00204082 ( 1 / 490 ) | 0.00204082 ( 1 / 490 / 605 ) - 8 [-0.4000, -0.6000) | 0.00197628 ( 1 / 506 ) | 0.00000000 ( 0 / 506 / 614 ) - 9 [-0.6000, -0.8000) | 0.00000000 ( 0 / 499 ) | 0.00000000 ( 0 / 499 / 620 ) - 10 [-0.8000, -1.0000) | 0.00000000 ( 0 / 515 ) | 0.00000000 ( 0 / 515 / 629 ) + 1 [ 1.0000, 0.8000) | 0.00000000 ( 0 / 274 ) | 0.00000000 ( 0 / 274 / 344 ) + 2 [ 0.8000, 0.6000) | 0.00000000 ( 0 / 315 ) | 0.00000000 ( 0 / 315 / 383 ) + 3 [ 0.6000, 0.4000) | 0.00349650 ( 1 / 286 ) | 0.00349650 ( 1 / 286 / 359 ) + 4 [ 0.4000, 0.2000) | 0.00000000 ( 0 / 264 ) | 0.00000000 ( 0 / 264 / 336 ) + 5 [ 0.2000, 0.0000) | 0.00364964 ( 1 / 274 ) | 0.00000000 ( 0 / 274 / 348 ) + 6 [ 0.0000, -0.2000) | 0.00000000 ( 0 / 276 ) | 0.00724638 ( 2 / 276 / 344 ) + 7 [-0.2000, -0.4000) | 0.00000000 ( 0 / 283 ) | 0.00000000 ( 0 / 283 / 335 ) + 8 [-0.4000, -0.6000) | 0.00361011 ( 1 / 277 ) | 0.00000000 ( 0 / 277 / 337 ) + 9 [-0.6000, -0.8000) | 0.00000000 ( 0 / 279 ) | 0.00000000 ( 0 / 279 / 360 ) + 10 [-0.8000, -1.0000) | 0.00000000 ( 0 / 321 ) | 0.00000000 ( 0 / 321 / 384 ) --- - False hits (edt | rec): 6 | 6 + False hits (edt | rec): 7 | 7 G4 kernel has come to Quit state. ================== Deleting memory pools =================== Number of memory pools allocated: 16; of which, static: 3 -Dynamic pools deleted: 13 / Total memory freed: 1.1 MB +Dynamic pools deleted: 13 / Total memory freed: 0.85 MB ============================================================ RunManagerKernel is deleted. Good bye :) diff --git a/examples/advanced/ChargeExchangeMC/History b/examples/advanced/ChargeExchangeMC/History index 9c2fa94aed..2ddadb610e 100644 --- a/examples/advanced/ChargeExchangeMC/History +++ b/examples/advanced/ChargeExchangeMC/History @@ -7,8 +7,11 @@ cirrone@lns.infn.it History file of the ChargeExchangeMC application ==================================================== +02.11.2020 - B.Morgan, Tag ChargeExchangeMC-V10-06-01 + Support same CMake version range as core Geant4 + 08.04.2020 - S. Guatelli, Tag ChargeExchangeMC-V10-06-00 - Error removed from the main. CMakeList.txt updated. + Error removed from the main. CMakeList.txt updated. Dependence to Qt Libraries when using ROOT demoved as obsolete. 02.09.2019 - S. Guatelli, Tag ChargeExchangeMC-V10-05-02 @@ -31,18 +34,18 @@ cirrone@lns.infn.it Replace ROOT_INCLUDE_DIR with ROOT_INCLUDE_DIRS 31.10.2017 - L. Pandola, Tag ChargeExchangeMC-V10-03-06 - Clean up preinit.mac, to avoid a cerr when + Clean up preinit.mac, to avoid a cerr when ROOT is not available 26.10.2017 - L. Pandola, Tag ChargeExchangeMC-V10-03-05 - Edit CMakeLists.txt such to copy mac/gmdl in the + Edit CMakeLists.txt such to copy mac/gmdl in the build directory 25.10.2017 - L. Pandola, Tag ChargeExchangeMC-V10-03-04 Fix residual shadowing on gcc 4.9 23.10.2017 - A. Radkov, Tag ChargeExchangeMC-V10-03-03 - Fix shadowed variabiles (and removed flag from + Fix shadowed variabiles (and removed flag from CMakeLists.txt) 12.10.2017 - L. Pandola, Tag ChargeExchangeMC-V10-03-02 @@ -60,16 +63,16 @@ cirrone@lns.infn.it Remove icons.mac. Automatically include since interfaces-V10-02-07 09.12.2014 - A. Radkov, Tag ChargeExchangeMC-V10-01-00 - CERN ROOT histograming binding. Bug fix for online histogram - redrawing and easy online histogram showing from a dedicated + CERN ROOT histograming binding. Bug fix for online histogram + redrawing and easy online histogram showing from a dedicated menu bar (in graphical mode). 06.10.2014 - L.Pandola, Tag: ChargeExchangeMC-V10-00-01 Edited CMakeLists.txt file to allow for the integration - in the CDash testing + in the CDash testing -12.12.2013 - A. Radkov & L. Pandola, Tag: ChargeExchangeMC-V10-00-00 - Fix a few compiler warnings (shadowed variables, system of +12.12.2013 - A. Radkov & L. Pandola, Tag: ChargeExchangeMC-V10-00-00 + Fix a few compiler warnings (shadowed variables, system of units). FTFP_BERT replaces deprecated QGSP_BERT 22.11.2012 - L.Garnier Tag: ChargeExchangeMC-V09-05-05 @@ -86,7 +89,7 @@ cirrone@lns.infn.it 17.10.2012, L.Pandola & A.Radkov, Tag: ChargeExchangeMC-V09-05-01 - Fix to compile the code against Geant4 9.6 - - Edit GNUmakefile such that the default version does not + - Edit GNUmakefile such that the default version does not depend on boost 11.10.2012, G.Cosmo, Tag: ChargeExchangeMC-V09-05-00 diff --git a/examples/advanced/HGCal_testbeam/CMakeLists.txt b/examples/advanced/HGCal_testbeam/CMakeLists.txt new file mode 100644 index 0000000000..e1840bbc36 --- /dev/null +++ b/examples/advanced/HGCal_testbeam/CMakeLists.txt @@ -0,0 +1,88 @@ +#---------------------------------------------------------------------------- +# Setup the project +cmake_minimum_required(VERSION 3.8...3.18 FATAL_ERROR) +if(${CMAKE_VERSION} VERSION_LESS 3.12) + cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) +endif() + +project(HGCal_testbeam) + +#---------------------------------------------------------------------------- +# Find Geant4 package, activating all available UI and Vis drivers by default +# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui +# to build a batch mode only executable +# +option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON) +if(WITH_GEANT4_UIVIS) + find_package(Geant4 REQUIRED ui_all vis_all) +else() + find_package(Geant4 REQUIRED) +endif() + +#---------------------------------------------------------------------------- +# Find ROOT (required package only for reading input particles from file) +# +find_package(ROOT QUIET NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH) +if (ROOT_FOUND) + message(STATUS "Found ROOT: ${ROOT_DIR}. Particles read from file can be used as generator.") + add_definitions(-DWITHROOT) + include_directories(${ROOT_INCLUDE_DIRS}) +endif() + + +#---------------------------------------------------------------------------- +# Setup Geant4 include directories and compile definitions +# +include(${Geant4_USE_FILE}) + +#---------------------------------------------------------------------------- +# Locate sources and headers for this project +# +include_directories(${PROJECT_SOURCE_DIR}/include + ${Geant4_INCLUDE_DIR}) +file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc) +file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh) + +#---------------------------------------------------------------------------- +# Add the executable, and link it to the Geant4 libraries +# +add_executable(HGCal_testbeam hgcal_testbeam.cc ${sources} ${headers}) +target_link_libraries(HGCal_testbeam ${Geant4_LIBRARIES}) +if (ROOT_FOUND) + target_link_libraries(HGCal_testbeam ${ROOT_LIBRARIES}) + set_target_properties(HGCal_testbeam PROPERTIES CXX_STANDARD 17) +endif() + +#---------------------------------------------------------------------------- +# Copy all scripts to the build directory, i.e. the directory in which we +# build HGCal)testbeam. This is so that we can run the executable directly because it +# relies on these scripts being in the current working directory. +# +set(HGCAL_SCRIPTS + init_vis.mac + run.mac + vis.mac + ) + +foreach(_script ${HGCAL_SCRIPTS}) + configure_file( + ${PROJECT_SOURCE_DIR}/${_script} + ${PROJECT_BINARY_DIR}/${_script} + COPYONLY + ) +endforeach() + +if (ROOT_FOUND) + configure_file( + ${PROJECT_SOURCE_DIR}/readFromFile.mac + ${PROJECT_BINARY_DIR}/readFromFile.mac + COPYONLY + ) +endif() + +#---------------------------------------------------------------------------- +# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX +# +install(TARGETS HGCal_testbeam DESTINATION bin) + + diff --git a/examples/advanced/HGCal_testbeam/GNUmakefile b/examples/advanced/HGCal_testbeam/GNUmakefile new file mode 100644 index 0000000000..bada066b2f --- /dev/null +++ b/examples/advanced/HGCal_testbeam/GNUmakefile @@ -0,0 +1,16 @@ +# -------------------------------- +# GNUmakefile for examples module. +# -------------------------------- + +name := HGCal_testbeam +G4TARGET := $(name) +G4EXLIB := true + +ifndef G4INSTALL + G4INSTALL = ../.. +endif + +.PHONY: all +all: lib bin + +include $(G4INSTALL)/config/binmake.gmk diff --git a/examples/advanced/HGCal_testbeam/History b/examples/advanced/HGCal_testbeam/History new file mode 100644 index 0000000000..a197b00efc --- /dev/null +++ b/examples/advanced/HGCal_testbeam/History @@ -0,0 +1,18 @@ +------------------------------------------------------------------- + + ========================================================= + Geant4 - an Object-Oriented Toolkit for Simulation in HEP + ========================================================= + + Example HGCal_testbeam History file + --------------------------- +This file should be used by the G4 example coordinator to briefly +summarize all major modifications introduced in the code and keep +track of all tags. + + ---------------------------------------------------------- + * Reverse chronological order (last date on top), please * + ---------------------------------------------------------- + +02-Nov-20 A. Zaborowska (exhgcaltb-V10-06-00) +- Create HGCal_testbeam example based on Thorben Quast application \ No newline at end of file diff --git a/examples/advanced/HGCal_testbeam/README b/examples/advanced/HGCal_testbeam/README new file mode 100644 index 0000000000..93092d98eb --- /dev/null +++ b/examples/advanced/HGCal_testbeam/README @@ -0,0 +1,227 @@ +------------------------------------------------------------------- + + ========================================================= + Geant4 - an Object-Oriented Toolkit for Simulation in HEP + ========================================================= + + Example HGCal_testbeam + ---------------------- + + This example is based on the Geant4 standalone application developed + by Thorben Quast for the CMS HGCal studies: + https://github.com/ThorbenQuast/HGCal_TB_Geant4. + + The goal of this example is to demonstrate a test beam setup used + in HEP experiments, and as a base for the validation studies and + comparison with experiment data. + + It presents a test beam setup used in the HGCal studies in October + 2018. It can be easily extended to other configurations. + + Details on the High Granularity Calorimeter (HGCal) can be found + i.a. in the Technical Design Report: + https://cds.cern.ch/record/2293646/files/CMS-TDR-019.pdf + + 1. Detector description + ----------------------- + + Detector construction in this example assumes that the setup is + constructed with different elements placed one behind another along + z axis (beam axis). + There are 3 configurations user can choose from, and could be set + with UI command: + + /HGCalTestbeam/setup/configuration + + where by default is equal to 0, which means the HGCal testbeam + setup used in October 2018. + 1 builds the same calorimeter setup, but places in front of it + several beamline elements. + 2 builds a very simplistic test configuration. + + Whenever a silicon wafer or SiPM is placed in the detector, a sensitive + volume is attached to it, and will be used to collect signal. + + Silicon wafer is divided into cells (pixels), and each individual pixel + can collect signal. + + In order to change the maximum step size allowed in silicon pixels: + + /HGCalTestbeam/setup/stepSilicon + + where is value of the max step size in micrometres. By default + is equal to 30 um. + + 2. Signal + --------- + + Energy deposited within silicon pixels and SiPMs is registered in the + sensitive detectors. Each deposit is added individually to the vector + of hits, in order to allow the digitisation. + + Digitisation is performed at the end of the event. It accumulates the + energy deposits within pixels, taking into account the time cut on the + arrival of signal (global time of energy deposit). By default no time + cut is applied which means all the deposits are counted. It can be set + using UI command: + + /HGCalTestbeam/hits/timeCut