13#include <G4Exception.hh>
22 const std::string& detectorName,
23 const std::vector<std::pair<std::string, G4VSensitiveDetector*>>& assignments) {
26 G4Exception(
"G4OCCTAssemblySDSetup::Apply",
"G4OCCT_ASDSD000", JustWarning,
27 (
"Assembly '" + detectorName +
28 "' not found in G4OCCTAssemblyRegistry. "
29 "Ensure G4OCCT_STEPAssembly was used to import this detector.")
35 for (
const auto& [pattern, sd] : assignments) {
36 sdMap.
Add(G4String(pattern), sd);
Declaration of G4OCCTAssemblyRegistry.
Declaration of G4OCCTAssemblyVolume.
Declaration of G4OCCTSensitiveDetectorMap.
DD4hep sim action helper for G4OCCT STEP assembly sensitive detectors.
G4OCCTAssemblyVolume * Get(const std::string &name) const
static G4OCCTAssemblyRegistry & Instance()
Return the singleton instance.
static std::size_t Apply(const std::string &detectorName, const std::vector< std::pair< std::string, G4VSensitiveDetector * > > &assignments)
Extends Geant4's G4AssemblyVolume with an OCCT XDE label reference.
std::size_t ApplySDMap(const G4OCCTSensitiveDetectorMap &sdMap)
Maps volume name patterns to Geant4 G4VSensitiveDetector objects.
void Add(const G4String &pattern, G4VSensitiveDetector *sd)