Main Page
Namespaces
Classes
Package Documentation
SimG4Core
Application
interface
OscarMTMasterThread.h
Go to the documentation of this file.
1
#ifndef SimG4Core_OscarMTMasterThread_H
2
#define SimG4Core_OscarMTMasterThread_H
3
4
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
5
#include "
FWCore/Framework/interface/ESWatcher.h
"
6
7
#include "
MagneticField/Records/interface/IdealMagneticFieldRecord.h
"
8
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
9
10
#include <memory>
11
#include <thread>
12
#include <mutex>
13
#include <condition_variable>
14
15
namespace
edm
{
16
class
EventSetup
;
17
}
18
19
class
RunManagerMT
;
20
21
class
DDCompactView
;
22
class
MagneticField
;
23
24
namespace
HepPDT
{
25
class
ParticleDataTable
;
26
}
27
28
class
OscarMTMasterThread
{
29
public
:
30
explicit
OscarMTMasterThread
(
const
edm::ParameterSet
& iConfig);
31
~
OscarMTMasterThread
();
32
33
void
beginRun(
const
edm::EventSetup
& iSetup)
const
;
34
void
endRun
()
const
;
35
void
stopThread();
36
37
inline
RunManagerMT
&
runManagerMaster
()
const
{
return
*m_runManagerMaster; }
38
inline
RunManagerMT
*
runManagerMasterPtr
()
const
{
return
m_runManagerMaster.get(); }
39
40
private
:
41
void
readES(
const
edm::EventSetup
& iSetup)
const
;
42
43
enum class
ThreadState
{
44
NotExist=0,
BeginRun
=1,
EndRun
=2, Destruct=3
45
};
46
47
const
bool
m_pUseMagneticField
;
48
49
std::shared_ptr<RunManagerMT>
m_runManagerMaster
;
50
std::thread
m_masterThread
;
51
52
// ES products needed for Geant4 initialization
53
mutable
edm::ESWatcher<IdealGeometryRecord>
idealGeomRcdWatcher_
;
54
mutable
edm::ESWatcher<IdealMagneticFieldRecord>
idealMagRcdWatcher_
;
55
mutable
const
DDCompactView
*
m_pDD
;
56
mutable
const
MagneticField
*
m_pMF
;
57
mutable
const
HepPDT::ParticleDataTable
*
m_pTable
;
58
59
mutable
std::mutex
m_protectMutex
;
60
mutable
std::mutex
m_threadMutex
;
61
mutable
std::condition_variable
m_notifyMasterCv
;
62
mutable
std::condition_variable
m_notifyMainCv
;
63
64
mutable
ThreadState
m_masterThreadState
;
65
66
mutable
bool
m_masterCanProceed
;
67
mutable
bool
m_mainCanProceed
;
68
mutable
bool
m_firstRun
;
69
mutable
bool
m_stopped
;
70
};
71
72
73
#endif
mutex
static boost::mutex mutex
Definition:
Proxy.cc:11
edm::Transition::EndRun
OscarMTMasterThread::m_protectMutex
std::mutex m_protectMutex
Definition:
OscarMTMasterThread.h:59
ESWatcher.h
ParticleDataTable
HepPDT::ParticleDataTable ParticleDataTable
Definition:
ParticleDataTable.h:8
OscarMTMasterThread::m_runManagerMaster
std::shared_ptr< RunManagerMT > m_runManagerMaster
Definition:
OscarMTMasterThread.h:49
OscarMTMasterThread::m_mainCanProceed
bool m_mainCanProceed
Definition:
OscarMTMasterThread.h:67
OscarMTMasterThread::m_firstRun
bool m_firstRun
Definition:
OscarMTMasterThread.h:68
MagneticField
Definition:
MagneticField.h:19
OscarMTMasterThread::m_masterThread
std::thread m_masterThread
Definition:
OscarMTMasterThread.h:50
OscarMTMasterThread::m_masterCanProceed
bool m_masterCanProceed
Definition:
OscarMTMasterThread.h:66
OscarMTMasterThread::idealGeomRcdWatcher_
edm::ESWatcher< IdealGeometryRecord > idealGeomRcdWatcher_
Definition:
OscarMTMasterThread.h:53
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition:
DDCompactView.h:80
OscarMTMasterThread::m_masterThreadState
ThreadState m_masterThreadState
Definition:
OscarMTMasterThread.h:64
OscarMTMasterThread::ThreadState
ThreadState
Definition:
OscarMTMasterThread.h:43
ParameterSet.h
EventSetup
HepPDT
Definition:
ParticleManager.h:19
OscarMTMasterThread
Definition:
OscarMTMasterThread.h:28
edm::EventSetup
Definition:
EventSetup.h:51
OscarMTMasterThread::runManagerMaster
RunManagerMT & runManagerMaster() const
Definition:
OscarMTMasterThread.h:37
OscarMTMasterThread::m_notifyMasterCv
std::condition_variable m_notifyMasterCv
Definition:
OscarMTMasterThread.h:61
edm::ESWatcher< IdealGeometryRecord >
OscarMTMasterThread::runManagerMasterPtr
RunManagerMT * runManagerMasterPtr() const
Definition:
OscarMTMasterThread.h:38
edm::Transition::BeginRun
OscarMTMasterThread::m_stopped
bool m_stopped
Definition:
OscarMTMasterThread.h:69
RunManagerMT
Definition:
RunManagerMT.h:55
OscarMTMasterThread::m_threadMutex
std::mutex m_threadMutex
Definition:
OscarMTMasterThread.h:60
OscarMTMasterThread::m_pDD
const DDCompactView * m_pDD
Definition:
OscarMTMasterThread.h:55
IdealGeometryRecord.h
edm
HLT enums.
Definition:
AlignableModifier.h:17
OscarMTMasterThread::idealMagRcdWatcher_
edm::ESWatcher< IdealMagneticFieldRecord > idealMagRcdWatcher_
Definition:
OscarMTMasterThread.h:54
edm::ParameterSet
Definition:
ParameterSet.h:36
OscarMTMasterThread::m_pMF
const MagneticField * m_pMF
Definition:
OscarMTMasterThread.h:56
Ecal2004TBTDCRanges_v1_cff.endRun
endRun
Definition:
Ecal2004TBTDCRanges_v1_cff.py:4
OscarMTMasterThread::m_pTable
const HepPDT::ParticleDataTable * m_pTable
Definition:
OscarMTMasterThread.h:57
OscarMTMasterThread::m_notifyMainCv
std::condition_variable m_notifyMainCv
Definition:
OscarMTMasterThread.h:62
IdealMagneticFieldRecord.h
OscarMTMasterThread::m_pUseMagneticField
const bool m_pUseMagneticField
Definition:
OscarMTMasterThread.h:47
Generated for CMSSW Reference Manual by
1.8.11