|
|
Go to the documentation of this file.
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";
43 std::unique_ptr<CustomUIsession> uiSession;
48 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: initializing RunManagerMT";
51 uiSession = std::make_unique<CustomUIsession>();
57 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: initialization of RunManagerMT finished";
61 bool isG4Alive =
false;
65 edm::LogVerbatim(
"OscarMTMasterThread") <<
"Master thread: State loop, notify main thread";
70 edm::LogVerbatim(
"OscarMTMasterThread") <<
"Master thread: State loop, starting wait";
78 edm::LogVerbatim(
"OscarMTMasterThread") <<
"Master thread: Initializing Geant4";
87 edm::LogVerbatim(
"OscarMTMasterThread") <<
"Master thread: Breaking out of state loop";
90 <<
"Geant4 is still alive, master thread state must be set to EndRun before Destruct";
94 <<
"OscarMTMasterThread: Illegal master thread state " << static_cast<int>(
m_masterThreadState);
100 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: start RunManagerMT destruction";
101 LogDebug(
"OscarMTMasterThread") <<
"Master thread: Am I unique owner of runManagerMaster? "
106 G4PhysicalVolumeStore::Clean();
108 edm::LogVerbatim(
"OscarMTMasterThread") <<
"Master thread: Reseted shared_ptr";
110 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: Master thread is finished";
116 LogDebug(
"OscarMTMasterThread") <<
"Main thread: Signal master for initialization";
120 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: Master thread is constructed";
140 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: Signal master for BeginRun";
145 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: finish BeginRun";
155 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: Signal master for EndRun";
159 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread: finish EndRun";
166 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread::stopTread: stop main thread";
173 LogDebug(
"OscarMTMasterThread") <<
"Main thread: reseted shared_ptr";
177 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread::stopTread: notify";
181 LogDebug(
"OscarMTMasterThread") <<
"Main thread: joining master thread";
183 edm::LogVerbatim(
"SimG4CoreApplication") <<
"OscarMTMasterThread::stopTread: main thread finished";
191 <<
"[SimG4Core OscarMTMasterThread]\n"
192 <<
"The Geometry configuration is changed during the job execution\n"
193 <<
"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
Log< level::Info, true > LogVerbatim
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