test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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
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
const
RunManagerMT
&
runManagerMaster
()
const
{
return
*
m_runManagerMaster
; }
38
const
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
OscarMTMasterThread::stopThread
void stopThread()
Definition:
OscarMTMasterThread.cc:175
OscarMTMasterThread::m_protectMutex
std::mutex m_protectMutex
Definition:
OscarMTMasterThread.h:59
OscarMTMasterThread::ThreadState::NotExist
ESWatcher.h
mutex
static boost::mutex mutex
Definition:
LHEProxy.cc:11
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:17
OscarMTMasterThread::endRun
void endRun() const
Definition:
OscarMTMasterThread.cc:159
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
type of data representation of DDCompactView
Definition:
DDCompactView.h:77
OscarMTMasterThread::runManagerMaster
const RunManagerMT & runManagerMaster() const
Definition:
OscarMTMasterThread.h:37
OscarMTMasterThread::ThreadState::Destruct
OscarMTMasterThread::runManagerMasterPtr
const RunManagerMT * runManagerMasterPtr() const
Definition:
OscarMTMasterThread.h:38
OscarMTMasterThread::m_masterThreadState
ThreadState m_masterThreadState
Definition:
OscarMTMasterThread.h:64
OscarMTMasterThread::ThreadState::EndRun
OscarMTMasterThread::ThreadState
ThreadState
Definition:
OscarMTMasterThread.h:43
ParameterSet.h
OscarMTMasterThread::beginRun
void beginRun(const edm::EventSetup &iSetup) const
Definition:
OscarMTMasterThread.cc:138
EventSetup
OscarMTMasterThread::~OscarMTMasterThread
~OscarMTMasterThread()
Definition:
OscarMTMasterThread.cc:132
OscarMTMasterThread
Definition:
OscarMTMasterThread.h:28
edm::EventSetup
Definition:
EventSetup.h:45
OscarMTMasterThread::m_notifyMasterCv
std::condition_variable m_notifyMasterCv
Definition:
OscarMTMasterThread.h:61
edm::ESWatcher< IdealGeometryRecord >
OscarMTMasterThread::m_stopped
bool m_stopped
Definition:
OscarMTMasterThread.h:69
OscarMTMasterThread::readES
void readES(const edm::EventSetup &iSetup) const
Definition:
OscarMTMasterThread.cc:203
RunManagerMT
Definition:
RunManagerMT.h:60
OscarMTMasterThread::m_threadMutex
std::mutex m_threadMutex
Definition:
OscarMTMasterThread.h:60
OscarMTMasterThread::m_pDD
const DDCompactView * m_pDD
Definition:
OscarMTMasterThread.h:55
OscarMTMasterThread::OscarMTMasterThread
OscarMTMasterThread(const edm::ParameterSet &iConfig)
Definition:
OscarMTMasterThread.cc:22
IdealGeometryRecord.h
OscarMTMasterThread::idealMagRcdWatcher_
edm::ESWatcher< IdealMagneticFieldRecord > idealMagRcdWatcher_
Definition:
OscarMTMasterThread.h:54
edm::ParameterSet
Definition:
ParameterSet.h:36
OscarMTMasterThread::ThreadState::BeginRun
OscarMTMasterThread::m_pMF
const MagneticField * m_pMF
Definition:
OscarMTMasterThread.h:56
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.5