17 #include "HepPDT/ParticleDataTable.hh"
20 #include "G4PhysicalVolumeStore.hh"
23 : m_pGeoFromDD4hep(iConfig.getParameter<
bool>(
"g4GeometryDD4hepSource")),
28 m_masterCanProceed(
false),
29 m_mainCanProceed(
false),
35 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: creating master thread";
41 std::unique_ptr<CustomUIsession> uiSession;
46 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: initializing RunManagerMT";
49 uiSession = std::make_unique<CustomUIsession>();
56 bool isG4Alive =
false;
60 edm::LogVerbatim(
"OscarMTMasterThread") <<
"Master thread: State loop, notify main thread";
65 edm::LogVerbatim(
"OscarMTMasterThread") <<
"Master thread: State loop, starting wait";
73 edm::LogVerbatim(
"OscarMTMasterThread") <<
"Master thread: Initializing Geant4";
82 edm::LogVerbatim(
"OscarMTMasterThread") <<
"Master thread: Breaking out of state loop";
85 <<
"Geant4 is still alive, master thread state must be set to EndRun before Destruct";
89 <<
"OscarMTMasterThread: Illegal master thread state " << static_cast<int>(
m_masterThreadState);
95 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: start RunManagerMT destruction";
99 G4PhysicalVolumeStore::Clean();
101 edm::LogVerbatim(
"OscarMTMasterThread") <<
"Master thread: Reseted shared_ptr";
103 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: Master thread is finished";
109 LogDebug(
"OscarMTMasterThread") <<
"Main thread: Signal master for initialization";
113 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: Master thread is constructed";
133 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: Signal master for BeginRun";
138 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: finish BeginRun";
148 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: Signal master for EndRun";
152 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: finish EndRun";
159 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread::stopTread: stop main thread";
166 LogDebug(
"OscarMTMasterThread") <<
"Main thread: reseted shared_ptr";
170 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread::stopTread: notify";
174 LogDebug(
"OscarMTMasterThread") <<
"Main thread: joining master thread";
176 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread::stopTread: main thread finished";
184 <<
"[SimG4Core OscarMTMasterThread]\n"
185 <<
"The Geometry configuration is changed during the job execution\n"
186 <<
"this is not allowed, the geometry must stay unchanged";