4 #include "DDG4/Geant4Converter.h" 5 #include "DDG4/Geant4GeometryInfo.h" 6 #include "DDG4/Geant4Mapping.h" 7 #include "DD4hep/Detector.h" 8 #include "DD4hep/Printout.h" 10 #include "G4RunManagerKernel.hh" 11 #include "G4PVPlacement.hh" 12 #include "G4TransportationManager.hh" 20 LogVerbatim(
"SimG4CoreApplication") <<
"DD4hep_DDDWorld: initialization of DDDWorld...";
23 printout(
INFO,
"SimDD4CMS",
"+++ DDDWorld::DDDWorld start... %s", world.name());
26 Geant4GeometryInfo*
geometry = g4Geo.create(world).detach();
30 LogVerbatim(
"Geometry") <<
"The world is " << it->first.name();
34 for (
auto iter =
map.begin(); iter !=
map.end(); ++iter) {
35 log << iter->first.name() <<
" = ";
37 log << iter->second->GetName() <<
"; ";
39 log <<
"***none***; ";
47 printout(
INFO,
"SimDD4CMS",
"+++ DDDWorld::DDDWorld done!");
49 LogVerbatim(
"SimG4CoreApplication") <<
"DD4hep_DDDWorld: initialization of DDDWorld done.";
54 void DDDWorld::setAsWorld(G4VPhysicalVolume*
pv) {
55 G4RunManagerKernel* kernel = G4RunManagerKernel::GetRunManagerKernel();
58 kernel->DefineWorldVolume(
pv);
60 edm::LogError(
"SimG4CoreGeometry") <<
"cms::DDDWorld::setAsWorld: No G4RunManagerKernel?";
62 edm::LogInfo(
"SimG4CoreGeometry") <<
" World volume defined ";
65 void DDDWorld::workerSetAsWorld(G4VPhysicalVolume*
pv) {
66 G4RunManagerKernel* kernel = G4RunManagerKernel::GetRunManagerKernel();
68 kernel->WorkerDefineWorldVolume(
pv);
71 G4TransportationManager* transM = G4TransportationManager::GetTransportationManager();
72 transM->SetWorldForTracking(
pv);
74 edm::LogError(
"SimG4CoreGeometry") <<
"cms::DDDWorld::workerSetAsWorld: No G4RunManagerKernel?";
76 edm::LogInfo(
"SimG4CoreGeometry") <<
" World volume defined (for worker) ";
Log< level::Info, true > LogVerbatim
dd4hep::Detector const * description() const
Log< level::Error, false > LogError
DDDWorld(const DDCompactView *pDD, const cms::DDCompactView *pDD4hep, SensitiveDetectorCatalog &, int verb, bool cuts, bool pcut)
Namespace of DDCMS conversion namespace.
Log< level::Info, false > LogInfo