Builds the “world” as a collection of systems, volumes, and post-load modifiers.
More...
#include <gworld.h>
GWorld is responsible for the assembly phase of detector geometry:
- It creates a map of detector systems (GSystem) from configuration (GOptions).
- It instantiates the appropriate system factories (derived from GSystemFactory).
- It asks each factory to load volumes/materials into each GSystem.
- It loads modifiers (GModifier) and applies them to the already-loaded volumes.
- It performs a final bookkeeping step assigning fully-qualified Geant4 names to volumes.
Ownership model:
- The world owns the system map container (gsystemsMap).
- Each GSystem owns its internal volume/material containers.
- Modifiers are stored separately in gmodifiersMap and applied once during construction.
- Note
- This class uses the logger provided by GBase. See module mainpage for verbosity levels.
Definition at line 36 of file gworld.h.
◆ GWorld() [1/2]
| GWorld::GWorld |
( |
const std::shared_ptr< GOptions > & | gopts | ) |
|
|
explicit |
Construction performs the full pipeline:
- load system descriptors via
gsystem::getSystems();
- create internal system map;
- load systems (factories → volumes/materials);
- load and apply modifiers;
- assign final Geant4 names.
- Parameters
-
| gopts | Shared configuration/options instance. |
Definition at line 18 of file gworld.cc.
◆ GWorld() [2/2]
This overload is useful when systems are created elsewhere (e.g. by a GUI) and then passed into the world assembly stage.
- Parameters
-
| gopts | Shared configuration/options instance. |
| systems | List of systems to adopt into the world map. |
Definition at line 35 of file gworld.cc.
◆ get_number_of_volumes()
| int GWorld::get_number_of_volumes |
( |
| ) |
const |
|
inline |
Historically this was referred to as “number of volumes”, but this method effectively returns the number of top-level systems in gsystemsMap.
Definition at line 78 of file gworld.h.
◆ getSensitiveDetectorsList()
| std::vector< std::string > GWorld::getSensitiveDetectorsList |
( |
| ) |
|
This walks every system and volume and extracts the digitization string. A non-empty digitization string indicates that the volume contributes to a sensitive detector collection.
- Returns
- A de-duplicated list of digitization identifiers.
Definition at line 132 of file gworld.cc.
◆ getSystemsMap()
- Returns
- Pointer to the internal SystemMap container.
- Warning
- The returned pointer is non-owning; callers must not delete it.
Definition at line 70 of file gworld.h.
The documentation for this class was generated from the following files: