33#include <unordered_map>
36#include "G4NistManager.hh"
64 G4World(
const GWorld* gworld,
const std::shared_ptr<GOptions>& gopts);
89 bool forceToAllDaughters);
95 [[nodiscard]]
bool is_empty() const noexcept {
return g4volumesMap.empty(); }
113 auto it = g4systemFactory.find(factoryName);
114 if (it != g4systemFactory.end())
return it->second;
117 "G4World: factory <", factoryName,
"> not found.");
144 std::string g4FactoryNameFromSystemFactory(
const std::string& factory)
const;
156 bool createG4Material(
const std::shared_ptr<GMaterial>& gmaterial);
165 void buildDefaultMaterialsElementsAndIsotopes();
171 void buildMaterials(
SystemMap* system_map);
185 void createG4SystemFactory(
const std::shared_ptr<GOptions>& gopts,
187 const std::string& backup_material,
201 G4Element* Deuterium =
nullptr;
202 G4Element* Helium3 =
nullptr;
203 G4Element* Tritium =
nullptr;
208 std::unordered_map<std::string, G4ObjectsFactory*> g4systemFactory;
211 std::unordered_map<std::string, G4Volume*> g4volumesMap;
220 std::unordered_map<std::string, G4Material*> g4materialsMap;
Base class orchestrating the conversion of a GVolume into a Geant4 representation.
Convenience container holding a Geant4 solid, logical, and physical volume.
Builds a full Geant4 geometry "world" from a GEMC GWorld description.
std::unordered_map< std::string, G4Volume * > get_g4volumes_map() const
Return a copy of the current volume map (name → wrapper pointer).
G4World(const GWorld *gworld, const std::shared_ptr< GOptions > &gopts)
Construct and build the Geant4 world from a GEMC world.
std::size_t number_of_volumes() const noexcept
Number of volumes stored so far.
void setFieldManagerForVolume(const std::string &volumeName, G4FieldManager *fm, bool forceToAllDaughters)
Attach a G4FieldManager to the logical volume of a named volume.
bool is_empty() const noexcept
Check whether the world currently has no cached volumes.
G4ObjectsFactory * get_factory(const std::string &factoryName)
Retrieve a registered factory by name.
const G4Volume * getG4Volume(const std::string &volumeName) const
Return the G4Volume wrapper for a volume name.
std::shared_ptr< GLogger > log
void error(int exit_code, Args &&... args) const
Abstract factory that converts a GEMC DB GVolume into Geant4 objects.
Conventions, labels, and error codes used by the g4system geometry/material layer.
#define ERR_G4SYSTEMFACTORYNOTFOUND
A required Geant4 system factory was not found/mapped.
Thin wrapper that stores the Geant4 solid/logical/physical triple for one GEMC volume.
std::map< std::string, SystemPtr > SystemMap