21 std::unordered_map<std::string,
31 if (copyOf) { message =
", copyOf: " + *copyOf; }
32 else if (solidsOpr) { message =
", solidsOpr: " + *solidsOpr; }
40 auto volume_copy =
gsystem +
"/" + *copyOf;
42 log->info(2,
"<%1> is a copy of <%2>, which already exists", s->
getName(), volume_copy);
46 2,
"<%1> is a copy of <%2>, which already exists, which does not exist yet", s->
getName(),
54 std::vector<std::string> solidOperations =
59 if (!solidOperations.empty() && solidOperations[0] ==
"@") {
60 solidOperations.erase(solidOperations.begin());
63 if (solidOperations.size() == 3) {
65 if (solidOperations[1] ==
"+" || solidOperations[1] ==
"-" || solidOperations[1] ==
"*") {
72 if (left !=
nullptr && right !=
nullptr)
85 [[maybe_unused]] std::unordered_map<std::string,
94 std::unordered_map<std::string,
100 if (g4s->find(vname) == g4s->end()) {
101 log->info(2,
"dependencies: %1 not found in gvolume map yet.", vname);
111 auto volume_copy =
gsystem +
"/" + *copyOf;
113 log->info(2,
"dependencies: copy %1 logical volume not found yet.", volume_copy);
118 log->info(2,
"dependencies: %1 logical volume not found yet.", vname);
125 log->info(2,
"dependencies: %1 mother <%2> logical volume not found yet.", vname, motherName);
133 "dependencies: <%1> and mother <%2> logical volumes are found. Ready to build or get physical "
134 "volume.", vname, motherName);
138 2,
"dependencies: <%1> logical volume is found. Ready to build or get physical volume.", vname);
bool checkSolidDependencies(const GVolume *s, std::unordered_map< std::string, G4Volume * > *g4s)
Check whether all prerequisites to build a solid are satisfied.
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.
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.
Convenience container holding a Geant4 solid, logical, and physical volume.
std::shared_ptr< GLogger > log
const std::string & getG4Name() const
const std::optional< std::string > & getSolidsOpr() const
const std::optional< std::string > & getCopyOf() const
std::string getName() const
std::string getSystem() const
const std::string & getG4MotherName() const
Abstract factory that converts a GEMC DB GVolume into Geant4 objects.
constexpr char MOTHEROFUSALL[]
vector< std::string > getStringVectorFromString(const std::string &input)