Builds a full Geant4 geometry "world" from a GEMC GWorld description.
More...
#include <g4world.h>
Public helpers let clients:
- query a G4Volume by name
- attach a
G4FieldManager to a volume subtree (logical volume + daughters)
- query whether any volumes were produced
Definition at line 49 of file g4world.h.
◆ G4World()
| G4World::G4World |
( |
const GWorld * | gworld, |
|
|
const std::shared_ptr< GOptions > & | gopts ) |
- Parameters
-
| gworld | Pointer to the GEMC world object (volume/material definitions). |
| gopts | Global options used by builders and factories (verbosity, overlap checks, backup material). |
The constructor performs the full build:
- initializes factories based on each system factory label
- builds materials and default elements/isotopes
- iteratively builds volumes until all resolvable dependencies are satisfied
Definition at line 32 of file g4world.cc.
◆ get_factory()
- Parameters
-
| factoryName | Factory label used as key in the internal factory map. |
- Returns
- Pointer to the factory instance.
If the factory is missing, an error is emitted through the logger.
Definition at line 112 of file g4world.h.
◆ get_g4volumes_map()
| std::unordered_map< std::string, G4Volume * > G4World::get_g4volumes_map |
( |
| ) |
const |
|
inline |
- Returns
- Copy of the internal map.
- Note
- This returns a copy intentionally; callers cannot mutate internal state through it.
Definition at line 127 of file g4world.h.
◆ getG4Volume()
| const G4Volume * G4World::getG4Volume |
( |
const std::string & | volumeName | ) |
const |
- Parameters
-
| volumeName | Key used in the internal volume map. |
- Returns
- Pointer to the cached G4Volume wrapper, or
nullptr if not found.
Definition at line 126 of file g4world.cc.
◆ is_empty()
| bool G4World::is_empty |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
true if no volumes were built or cached, otherwise false.
Definition at line 95 of file g4world.h.
◆ number_of_volumes()
| std::size_t G4World::number_of_volumes |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- Size of the internal volume map.
Definition at line 101 of file g4world.h.
◆ setFieldManagerForVolume()
| void G4World::setFieldManagerForVolume |
( |
const std::string & | volumeName, |
|
|
G4FieldManager * | fm, |
|
|
bool | forceToAllDaughters ) |
- Parameters
-
| volumeName | Name of the volume in the internal map. |
| fm | Field manager pointer to attach. |
| forceToAllDaughters | If true, propagate to daughter logical volumes. |
If the volume is not found, the method does nothing. If found but the logical volume is not yet available, the underlying wrapper ignores the request.
Definition at line 131 of file g4world.cc.
The documentation for this class was generated from the following files: