|
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="") | |
| GBase (const std::shared_ptr< GLogger > &logger) | |
| GBase (const GBase &)=default | |
| GBase (GBase &&) noexcept=default | |
| virtual | ~GBase () |
| GBase & | operator= (const GBase &)=default |
| GBase & | operator= (GBase &&) noexcept=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 returns a pointer to it via 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 returned G4VModularPhysicsList pointer is expected to be managed by the Geant4 application lifecycle (typically by the run manager). This class does not delete the physics list.
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 33 of file gphysics.cc.
|
inline |
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.