Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.6 KB

geant4.rst

File metadata and controls

48 lines (35 loc) · 1.6 KB

Minimal Geant4 integration

These small examples demonstrate how to offload tracks to Celeritas in a serial or multithreaded environment using:

  1. A concrete G4UserTrackingAction user action class
  2. A concrete G4VFastSimulationModel

The :ref:`accel` library is the only part of Celeritas that needs to be understood. The key components are global SetupOptions and SharedParams, coupled to thread-local SimpleOffload and LocalTransporter. The SimpleOffload provides all of the core methods needed to integrate into a Geant4 application's UserActions or other user classes.

CMake infrastructure

.. literalinclude:: ../../../example/accel/CMakeLists.txt
   :language: cmake
   :start-at: project(
   :end-before: END EXAMPLE CODE

Main Executables

The executables are less robust (and minimally documented) versions of the :ref:`celer-g4` app. The use of global variables rather than shared pointers is easier to implement but may be more problematic with experiment frameworks or other apps that use a task-based runner.

Offload using a concrete G4UserTrackingAction

.. literalinclude:: ../../../example/accel/simple-offload.cc
   :start-at: #include

Offload using a concrete G4VFastSimulationModel

.. literalinclude:: ../../../example/accel/fastsim-offload.cc
   :start-at: #include