diff --git a/DDG4/plugins/Geant4DetectorGeometryConstruction.cpp b/DDG4/plugins/Geant4DetectorGeometryConstruction.cpp index 5d7c0d3949c11cf496c231fb564ef01c20ed2f85..360d176d85ae09325715dc30727ee412d95601d7 100644 --- a/DDG4/plugins/Geant4DetectorGeometryConstruction.cpp +++ b/DDG4/plugins/Geant4DetectorGeometryConstruction.cpp @@ -1,3 +1,4 @@ +//========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN) @@ -92,10 +93,6 @@ void Geant4DetectorGeometryConstruction::constructGeo(Geant4DetectorConstruction g4map.attach(ctxt->geometry); G4VPhysicalVolume* w = ctxt->geometry->world(); // Create Geant4 volume manager only if not yet available - if ( not g4map.volumeManager().isValid() ) { - ctxt->lcdd.apply("DD4hepVolumeManager", 0, 0); - } - // Create Geant4 volume manager g4map.volumeManager(); if ( m_dumpHierarchy ) { Geant4HierarchyDump dmp(ctxt->lcdd); diff --git a/DDG4/src/Geant4Mapping.cpp b/DDG4/src/Geant4Mapping.cpp index 77ec145a18ae6817a67261edd3302c1ec6aac6c4..cabd35ca679936a8bc04ab014811fe3181f6992d 100644 --- a/DDG4/src/Geant4Mapping.cpp +++ b/DDG4/src/Geant4Mapping.cpp @@ -1,4 +1,3 @@ -// $Id: $ //========================================================================== // AIDA Detector description implementation for LCD //-------------------------------------------------------------------------- @@ -13,8 +12,10 @@ //========================================================================== // Framework include files -#include "DD4hep/Printout.h" #include "DDG4/Geant4Mapping.h" + +#include "DD4hep/Printout.h" +#include "DD4hep/VolumeManager.h" #include "G4PVPlacement.hh" #include <stdexcept> @@ -70,8 +71,9 @@ void Geant4Mapping::attach(Geant4GeometryInfo* data_ptr) { /// Access the volume manager Geant4VolumeManager Geant4Mapping::volumeManager() const { - if (m_dataPtr) { - if (m_dataPtr->g4Paths.empty()) { + if ( m_dataPtr ) { + if ( m_dataPtr->g4Paths.empty() ) { + VolumeManager::getVolumeManager(m_lcdd); return Geant4VolumeManager(m_lcdd, m_dataPtr); } return Geant4VolumeManager(Geometry::Handle < Geant4GeometryInfo > (m_dataPtr));