|
gphysics
|
Builds and exposes a Geant4 modular physics list based on runtime options. More...
#include <gphysics.h>
Public Member Functions | |
| GPhysics (const std::shared_ptr< GOptions > &gopts) | |
| Constructs the physics list builder and (unless requested otherwise) instantiates the physics list. | |
| G4VModularPhysicsList * | getPhysList () const |
| Returns the instantiated Geant4 modular physics list. | |
| Public Member Functions inherited from GBase< GPhysics > | |
| GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="") | |
| virtual | ~GBase () |
| GBase & | operator= (const GBase &)=default |
Additional Inherited Members | |
| Protected Attributes inherited from GBase< GPhysics > | |
| std::shared_ptr< GLogger > | log |
GPhysics is a thin integration layer between GEMC options and the Geant4 extensible physics list factory. It is not derived from G4VModularPhysicsList; instead, it creates a physics list instance and exposes it through a runtime modular list returned by getPhysList().
The physics list selection is driven by options defined in gphysics::defineOptions(), most notably:
phys_list : the reference physics list string (with optional extensions).showPhysics : a switch that prints the available physics lists and constructors and exits early.Ownership note: The run manager owns the returned runtime list. That list retains its factory lists and constructors until shutdown, preserving Geant4's global particle and EM-cache lifetimes. This builder owns neither.
Definition at line 27 of file gphysics.h.
| GPhysics::GPhysics | ( | const std::shared_ptr< GOptions > & | gopts | ) |
The constructor reads the relevant options from the provided GOptions instance:
showPhysics switch is enabled, the constructor prints the available Geant4 lists/constructors and returns without creating a physics list.phys_list option and registers additional constructors required by the module defaults.| gopts | Shared options container used to retrieve phys_list and showPhysics. |
Definition at line 32 of file gphysics.cc.
|
inlinenodiscard |
G4VModularPhysicsList created by this module, or nullptr if the list could not be created or if showPhysics was requested. Definition at line 48 of file gphysics.h.