Newer
Older
Pere Mato
committed
#include "DDG4/Geant4DetectorConstruction.h"
#include "DDG4/Geant4HierarchyDump.h"
Pere Mato
committed
#include "DDG4/Geant4Converter.h"
#include "DD4hep/LCDD.h"
#include "TGeoManager.h"
#include "G4PVPlacement.hh"
Pere Mato
committed
#ifdef GEANT4_HAS_GDML
#include "G4GDMLParser.hh"
#endif
using namespace std;
using namespace DD4hep;
using namespace DD4hep::Geometry;
DD4hep::Simulation::Geant4DetectorConstruction::Geant4DetectorConstruction(Geometry::LCDD& lcdd)
Pere Mato
committed
}
G4VPhysicalVolume* DD4hep::Simulation::Geant4DetectorConstruction::Construct() {
typedef Simulation::Geant4Converter Geant4Converter;
Geant4Mapping& g4map = Geant4Mapping::instance();
DetElement world = m_lcdd.world();
Markus Frank
committed
Geant4Converter conv(m_lcdd);
Geant4GeometryInfo* info = conv.create(world).detach();
Markus Frank
committed
g4map.attach(info);
m_world = info->world();
m_lcdd.apply("DD4hepVolumeManager", 0, 0);
//Geant4HierarchyDump dmp(m_lcdd);
//dmp.dump("",m_world);