SimG4Core
Application
src
SimRunInterface.cc
Go to the documentation of this file.
1
#include "
SimG4Core/Application/interface/SimRunInterface.h
"
2
#include "
SimG4Core/Application/interface/RunManager.h
"
3
#include "
SimG4Core/Application/interface/RunManagerMT.h
"
4
#include "
SimG4Core/Application/interface/RunManagerMTWorker.h
"
5
#include "
SimG4Core/Application/interface/RunAction.h
"
6
#include "
SimG4Core/Application/interface/EventAction.h
"
7
#include "
SimG4Core/Application/interface/TrackingAction.h
"
8
#include "
SimG4Core/Application/interface/SteppingAction.h
"
9
#include "
SimG4Core/Notification/interface/G4SimEvent.h
"
10
11
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
12
13
SimRunInterface::SimRunInterface
(
RunManager
* runm,
bool
master
)
14
: m_runManager(runm),
15
m_runManagerMT(nullptr),
16
m_runManagerMTWorker(nullptr),
17
m_SimTrackManager(nullptr),
18
m_isMaster(
master
) {
19
if
(
m_runManager
) {
20
m_SimTrackManager
=
m_runManager
->
GetSimTrackManager
();
21
}
22
}
23
24
SimRunInterface::SimRunInterface
(
RunManagerMT
* runm,
bool
master
)
25
: m_runManager(nullptr),
26
m_runManagerMT(runm),
27
m_runManagerMTWorker(nullptr),
28
m_SimTrackManager(nullptr),
29
m_isMaster(
master
) {}
30
31
SimRunInterface::SimRunInterface
(
RunManagerMTWorker
* runm,
bool
master
)
32
: m_runManager(nullptr),
33
m_runManagerMT(nullptr),
34
m_runManagerMTWorker(runm),
35
m_SimTrackManager(nullptr),
36
m_isMaster(
master
) {
37
if
(
m_runManagerMTWorker
) {
38
m_SimTrackManager
=
m_runManagerMTWorker
->
GetSimTrackManager
();
39
}
40
}
41
42
SimRunInterface::~SimRunInterface
() {}
43
44
void
SimRunInterface::setRunManagerMTWorker
(
RunManagerMTWorker
*
run
) {
m_runManagerMTWorker
=
run
; }
45
46
void
SimRunInterface::Connect
(
RunAction
* runAction) {
47
if
(
m_runManager
) {
48
m_runManager
->
Connect
(runAction);
49
}
else
if
(
m_runManagerMT
) {
50
m_runManagerMT
->
Connect
(runAction);
51
}
else
if
(
m_runManagerMTWorker
) {
52
m_runManagerMTWorker
->
Connect
(runAction);
53
}
54
}
55
56
void
SimRunInterface::Connect
(
EventAction
* eventAction) {
57
if
(
m_runManager
) {
58
m_runManager
->
Connect
(eventAction);
59
}
else
if
(
m_runManagerMTWorker
) {
60
m_runManagerMTWorker
->
Connect
(eventAction);
61
}
62
}
63
64
void
SimRunInterface::Connect
(
TrackingAction
* trackAction) {
65
if
(
m_runManager
) {
66
m_runManager
->
Connect
(trackAction);
67
}
else
if
(
m_runManagerMTWorker
) {
68
m_runManagerMTWorker
->
Connect
(trackAction);
69
}
70
}
71
72
void
SimRunInterface::Connect
(
SteppingAction
* stepAction) {
73
if
(
m_runManager
) {
74
m_runManager
->
Connect
(stepAction);
75
}
else
if
(
m_runManagerMTWorker
) {
76
m_runManagerMTWorker
->
Connect
(stepAction);
77
}
78
}
79
80
SimTrackManager
*
SimRunInterface::GetSimTrackManager
() {
return
m_SimTrackManager
; }
81
82
void
SimRunInterface::abortEvent
() {
83
if
(
m_runManager
) {
84
m_runManager
->
abortEvent
();
85
}
else
if
(
m_runManagerMTWorker
) {
86
m_runManagerMTWorker
->
abortEvent
();
87
}
88
}
89
90
void
SimRunInterface::abortRun
(
bool
softAbort) {
91
if
(
m_runManager
) {
92
m_runManager
->
abortRun
(softAbort);
93
}
else
if
(
m_runManagerMTWorker
) {
94
m_runManagerMTWorker
->
abortRun
(softAbort);
95
}
96
}
97
98
G4SimEvent
*
SimRunInterface::simEvent
() {
99
G4SimEvent
* ptr =
nullptr
;
100
if
(
m_runManager
) {
101
ptr =
m_runManager
->
simEvent
();
102
}
else
if
(
m_runManagerMTWorker
) {
103
ptr =
m_runManagerMTWorker
->
simEvent
();
104
}
105
return
ptr;
106
}
107
108
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SimTrackManager
Definition:
SimTrackManager.h:35
RunAction.h
TrackingAction.h
RunManagerMTWorker::abortRun
void abortRun(bool softAbort=false)
Definition:
RunManagerMTWorker.cc:560
SteppingAction.h
EventAction
Definition:
EventAction.h:23
G4SimEvent
Definition:
G4SimEvent.h:14
SimRunInterface::abortRun
void abortRun(bool softAbort)
Definition:
SimRunInterface.cc:90
RunManagerMTWorker.h
RunManagerMTWorker::abortEvent
void abortEvent()
Definition:
RunManagerMTWorker.cc:543
EventAction.h
SimRunInterface::setRunManagerMTWorker
void setRunManagerMTWorker(RunManagerMTWorker *run)
Definition:
SimRunInterface.cc:44
SteppingAction
Definition:
SteppingAction.h:31
RunManagerMTWorker::simEvent
G4SimEvent * simEvent()
Definition:
RunManagerMTWorker.h:55
RunManagerMTWorker::Connect
void Connect(RunAction *)
Definition:
RunManagerMTWorker.cc:398
RunManagerMTWorker::GetSimTrackManager
SimTrackManager * GetSimTrackManager()
Definition:
RunManagerMTWorker.cc:417
RunManager.h
SimRunInterface::m_SimTrackManager
SimTrackManager * m_SimTrackManager
Definition:
SimRunInterface.h:53
TrackingAction
Definition:
TrackingAction.h:16
RunManager::Connect
void Connect(RunAction *)
Definition:
RunManager.cc:568
SimRunInterface::SimRunInterface
SimRunInterface(RunManager *run, bool master)
Definition:
SimRunInterface.cc:13
SimRunInterface::Connect
void Connect(RunAction *)
Definition:
SimRunInterface.cc:46
RunManager
Definition:
RunManager.h:54
RunManagerMT
Definition:
RunManagerMT.h:55
SimRunInterface::GetSimTrackManager
SimTrackManager * GetSimTrackManager()
Definition:
SimRunInterface.cc:80
RunAction
Definition:
RunAction.h:15
SimRunInterface::~SimRunInterface
~SimRunInterface()
Definition:
SimRunInterface.cc:42
RunManagerMT.h
G4SimEvent.h
SimRunInterface::m_runManager
RunManager * m_runManager
Definition:
SimRunInterface.h:49
RunManager::GetSimTrackManager
SimTrackManager * GetSimTrackManager()
Definition:
RunManager.cc:566
SimRunInterface::abortEvent
void abortEvent()
Definition:
SimRunInterface.cc:82
RunManagerMTWorker
Definition:
RunManagerMTWorker.h:41
writedatasetfile.run
run
Definition:
writedatasetfile.py:27
SimRunInterface::m_runManagerMT
RunManagerMT * m_runManagerMT
Definition:
SimRunInterface.h:50
SimRunInterface.h
SimRunInterface::simEvent
G4SimEvent * simEvent()
Definition:
SimRunInterface.cc:98
RunManagerMT::Connect
void Connect(RunAction *)
Definition:
RunManagerMT.cc:249
SimRunInterface::m_runManagerMTWorker
RunManagerMTWorker * m_runManagerMTWorker
Definition:
SimRunInterface.h:51
volumeBasedMagneticField_160812_cfi.master
master
Definition:
volumeBasedMagneticField_160812_cfi.py:60
RunManager::abortRun
void abortRun(bool softAbort=false)
Definition:
RunManager.cc:543
RunManager::simEvent
G4SimEvent * simEvent()
Definition:
RunManager.h:71
RunManager::abortEvent
void abortEvent()
Definition:
RunManager.cc:457
Generated for CMSSW Reference Manual by
1.8.16