21#include <unordered_map>
32#include "G4LogicalVolume.hh"
33#include "G4PVPlacement.hh"
34#include "G4RotationMatrix.hh"
35#include "G4ThreeVector.hh"
36#include "G4VisAttributes.hh"
94 std::unordered_map<std::string,
101 [[nodiscard]]
virtual std::string_view
className()
const = 0;
117 std::unordered_map<std::string, G4Volume*>* g4s) = 0;
134 std::unordered_map<std::string, G4Volume*>* g4s);
150 std::unordered_map<std::string, G4Volume*>* g4s);
153 static G4VSolid*
getSolidFromMap(
const std::string& volume_name, std::unordered_map<std::string, G4Volume*>* g4s);
157 std::unordered_map<std::string, G4Volume*>* g4s);
161 std::unordered_map<std::string, G4Volume*>* g4s);
174 if (
auto it = g4s->find(volume_name); it != g4s->end()) {
return it->second; }
176 (*g4s)[volume_name] =
new G4Volume();
177 return (*g4s)[volume_name];
202 std::unordered_map<std::string, G4Volume*>* g4s);
215 std::unordered_map<std::string, G4Volume*>* g4s);
231 std::unordered_map<std::string, G4Volume*>* g4s);
Base class orchestrating the conversion of a GVolume into a Geant4 representation.
G4Volume * getOrCreateG4Volume(const std::string &volume_name, std::unordered_map< std::string, G4Volume * > *g4s)
Get or create a G4Volume wrapper entry in the map.
bool checkSolidDependencies(const GVolume *s, std::unordered_map< std::string, G4Volume * > *g4s)
Check whether all prerequisites to build a solid are satisfied.
~G4ObjectsFactory() override=default
virtual G4LogicalVolume * buildLogical(const GVolume *s, std::unordered_map< std::string, G4Volume * > *g4s)
Build or retrieve the G4LogicalVolume for a volume.
virtual G4VPhysicalVolume * buildPhysical(const GVolume *s, std::unordered_map< std::string, G4Volume * > *g4s)
Build or retrieve the G4VPhysicalVolume for a volume.
static G4VPhysicalVolume * getPhysicalFromMap(const std::string &volume_name, std::unordered_map< std::string, G4Volume * > *g4s)
Lookup physical volume in the g4s map.
bool build_g4volume(const GVolume *s, std::unordered_map< std::string, G4Volume * > *g4s)
Build (or retrieve) solid, logical, and physical volumes for a given GVolume.
static G4RotationMatrix * getRotation(const GVolume *s)
Parse rotation string and build a Geant4 rotation matrix.
G4ObjectsFactory(const std::shared_ptr< GOptions > &g)
Construct a factory using the global option set.
virtual std::string_view className() const =0
Short, human-readable factory name for logging.
static bool checkLogicalDependencies(const GVolume *s, std::unordered_map< std::string, G4Volume * > *g4s)
Logical dependency check placeholder.
virtual G4VSolid * buildSolid(const GVolume *s, std::unordered_map< std::string, G4Volume * > *g4s)=0
Build the G4VSolid for a volume.
bool checkPhysicalDependencies(const GVolume *s, std::unordered_map< std::string, G4Volume * > *g4s)
Verify prerequisites to build a physical placement.
static G4VSolid * getSolidFromMap(const std::string &volume_name, std::unordered_map< std::string, G4Volume * > *g4s)
Lookup solid in the g4s map.
static G4LogicalVolume * getLogicalFromMap(const std::string &volume_name, std::unordered_map< std::string, G4Volume * > *g4s)
Lookup logical volume in the g4s map.
void initialize_context(int checkOverlaps, const std::string &backupMaterial)
Configure overlap checking and backup material behavior for this factory.
static G4ThreeVector getPosition(const GVolume *s)
Parse position and optional shift strings to compute placement translation.
G4VisAttributes createVisualAttributes(const GVolume *s)
Build visualization attributes from the volume definition.
std::string backupMaterial
Backup material name used if the requested material is absent.
Convenience container holding a Geant4 solid, logical, and physical volume.
Option definitions for the g4system module (geometry/material construction layer).
constexpr const char * G4SFACTORY_LOGGER
Logger name used by object factories (e.g. G4ObjectsFactory derived classes).
Thin wrapper that stores the Geant4 solid/logical/physical triple for one GEMC volume.