Implements solid creation for Geant4 CSG primitives and validates constructor parameter counts.
More...
#include <g4NativeObjectsFactory.h>
|
| G4VSolid * | buildSolid (const GVolume *s, std::unordered_map< std::string, G4Volume * > *g4s) override |
| | Create (or reuse) a native Geant4 solid based on the GVolume "type".
|
| |
| std::vector< double > | checkAndReturnParameters (const GVolume *s) |
| | Validate the number of parameters for the given primitive and return them as numeric values.
|
| |
| 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.
|
| |
| G4Volume * | getOrCreateG4Volume (const std::string &volume_name, std::unordered_map< std::string, G4Volume * > *g4s) |
| | Get or create a G4Volume wrapper entry in the map.
|
| |
| G4VisAttributes | createVisualAttributes (const GVolume *s) |
| | Build visualization attributes from the volume definition.
|
| |
| bool | checkSolidDependencies (const GVolume *s, std::unordered_map< std::string, G4Volume * > *g4s) |
| | Check whether all prerequisites to build a solid are satisfied.
|
| |
| 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.
|
| |
| static G4VPhysicalVolume * | getPhysicalFromMap (const std::string &volume_name, std::unordered_map< std::string, G4Volume * > *g4s) |
| | Lookup physical volume in the g4s map.
|
| |
| static bool | checkLogicalDependencies (const GVolume *s, std::unordered_map< std::string, G4Volume * > *g4s) |
| | Logical dependency check placeholder.
|
| |
| static G4RotationMatrix * | getRotation (const GVolume *s) |
| | Parse rotation string and build a Geant4 rotation matrix.
|
| |
| static G4ThreeVector | getPosition (const GVolume *s) |
| | Parse position and optional shift strings to compute placement translation.
|
| |
| int | checkOverlaps {0} |
| |
| std::string | backupMaterial |
| | Backup material name used if the requested material is absent.
|
| |
| std::shared_ptr< GLogger > | log |
| |
The method buildSolid() dispatches on s->getType() and creates the corresponding Geant4 solid. The helper checkAndReturnParameters() validates and parses the parameter list.
Definition at line 38 of file g4NativeObjectsFactory.h.
◆ buildSolid()
| G4VSolid * G4NativeSystemFactory::buildSolid |
( |
const GVolume * | s, |
|
|
std::unordered_map< std::string, G4Volume * > * | g4s ) |
|
overrideprotectedvirtual |
- Parameters
-
| s | GEMC volume definition containing the type and parameters. |
| g4s | Map holding cached G4Volume wrappers. |
- Returns
- Pointer to the created/reused solid, or
nullptr if dependencies are missing or type unsupported.
The method performs:
- dependency checks (copy/boolean operations)
- wrapper retrieval/creation
- parameter parsing and validation
- dispatch to the proper Geant4 constructor
Implements G4ObjectsFactory.
Definition at line 24 of file buildSolid.cc.
◆ checkAndReturnParameters()
| std::vector< double > G4NativeSystemFactory::checkAndReturnParameters |
( |
const GVolume * | s | ) |
|
|
protected |
- Parameters
-
| s | Pointer to the GEMC volume record whose getParameters() string is to be parsed. |
- Returns
- A
std::vector<double> holding the converted values in the order expected by the constructor.
Some primitives have fixed parameter counts, while others have special rules:
- polycones accept multiple constructor layouts, validated via modular arithmetic
- polyhedra accept multiple constructor layouts, validated similarly
When validation fails, an error is emitted through the logger.
Definition at line 13 of file checkAndReturnParameters.cc.
◆ className()
| std::string_view G4NativeSystemFactory::className |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ G4ObjectsFactory()
| G4ObjectsFactory::G4ObjectsFactory |
( |
const std::shared_ptr< GOptions > & | g | ) |
|
|
inlineexplicit |
- Parameters
-
| g | Shared option set used to initialize the logging base and other behaviors. |
Definition at line 62 of file g4objectsFactory.h.
The documentation for this class was generated from the following files: