File indexing completed on 2025-07-15 08:15:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include <DDG4/Geant4GeometryInfo.h>
0016 #include <DDG4/Geant4AssemblyVolume.h>
0017 #include <DD4hep/Printout.h>
0018
0019
0020 #include <G4VPhysicalVolume.hh>
0021
0022 using namespace dd4hep::sim;
0023
0024
0025 Geant4GeometryInfo::Geant4GeometryInfo()
0026 : TNamed("Geant4GeometryInfo", "Geant4GeometryInfo"), m_world(0), printLevel(DEBUG), valid(false) {
0027 }
0028
0029
0030 Geant4GeometryInfo::~Geant4GeometryInfo() {
0031 for( auto& a : g4AssemblyVolumes )
0032 delete a.second;
0033 g4AssemblyVolumes.clear();
0034 }
0035
0036
0037 G4VPhysicalVolume* Geant4GeometryInfo::world() const {
0038 if ( m_world ) return m_world;
0039 except("Geant4GeometryInfo", "Attempt to access invalid world placement");
0040 return m_world;
0041 }
0042
0043
0044 void Geant4GeometryInfo::setWorld(const TGeoNode* node) {
0045 Geant4GeometryMaps::PlacementMap::const_iterator g4it = g4Placements.find(node);
0046 G4VPhysicalVolume* g4 = (g4it == g4Placements.end()) ? 0 : (*g4it).second;
0047 if (!g4) {
0048 except("Geant4GeometryInfo", "Attempt to SET invalid world placement");
0049 }
0050 m_world = g4;
0051 }