|
|
Go to the documentation of this file.
15 #include "HepPDT/ParticleDataTable.hh"
18 #include "G4PhysicalVolumeStore.hh"
21 : m_pGeoFromDD4hep(iConfig.getParameter<
bool>(
"g4GeometryDD4hepSource")),
26 m_masterCanProceed(
false),
27 m_mainCanProceed(
false),
33 edm::LogInfo(
"SimG4CoreApplication") <<
"OscarMTMasterThread: creating master thread";
41 std::unique_ptr<CustomUIsession> uiSession;
46 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: initializing RunManagerMT";
55 LogDebug(
"SimG4CoreApplication") <<
"OscarMTMasterThread: initialization of RunManagerMT finished";
59 bool isG4Alive =
false;
63 edm::LogVerbatim(
"OscarMTMasterThread") <<
"Master thread: State loop, notify main thread";
68 edm::LogVerbatim(
"OscarMTMasterThread") <<
"Master thread: State loop, starting wait";
76 edm::LogInfo(
"OscarMTMasterThread") <<
"Master thread: Initializing Geant4";
81 LogDebug(
"OscarMTMasterThread") <<
"Master thread: Stopping Geant4";
85 LogDebug(
"OscarMTMasterThread") <<
"Master thread: Breaking out of state loop";
88 <<
"Geant4 is still alive, master thread state must be set to EndRun before Destruct";
92 <<
"OscarMTMasterThread: Illegal master thread state " << static_cast<int>(
m_masterThreadState);
98 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: start RunManagerMT destruction";
99 LogDebug(
"OscarMTMasterThread") <<
"Master thread: Am I unique owner of runManagerMaster? "
104 G4PhysicalVolumeStore::Clean();
106 LogDebug(
"OscarMTMasterThread") <<
"Master thread: Reseted shared_ptr";
108 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: Master thread is finished";
114 LogDebug(
"OscarMTMasterThread") <<
"Main thread: Signal master for initialization";
118 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: Master thread is constructed";
138 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: Signal master for BeginRun";
143 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: finish BeginRun";
153 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: Signal master for EndRun";
157 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: finish EndRun";
164 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread::stopTread: stop main thread";
171 LogDebug(
"OscarMTMasterThread") <<
"Main thread: reseted shared_ptr";
175 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread::stopTread: notify";
179 LogDebug(
"OscarMTMasterThread") <<
"Main thread: joining master thread";
181 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread::stopTread: main thread finished";
189 <<
"[SimG4Core OscarMTMasterThread]\n"
190 <<
"The Geometry configuration is changed during the job execution\n"
191 <<
"this is not allowed, the geometry must stay unchanged";
bool check(const edm::EventSetup &iSetup)
T const * product() const
std::condition_variable m_notifyMasterCv
std::thread m_masterThread
T const * product() const
OscarMTMasterThread(const edm::ParameterSet &iConfig)
ThreadState m_masterThreadState
std::shared_ptr< RunManagerMT > m_runManagerMaster
RunManagerMT & runManagerMaster() const
void initG4(const DDCompactView *, const cms::DDCompactView *, const HepPDT::ParticleDataTable *)
std::mutex m_protectMutex
const DDCompactView * m_pDD
const bool m_pGeoFromDD4hep
const cms::DDCompactView * m_pDD4hep
void beginRun(const edm::EventSetup &iSetup) const
const HepPDT::ParticleDataTable * m_pTable
void readES(const edm::EventSetup &iSetup) const
edm::ESWatcher< IdealGeometryRecord > idealGeomRcdWatcher_
std::condition_variable m_notifyMainCv