CMS 3D CMS Logo

RunManagerMT.h
Go to the documentation of this file.
1 #ifndef SimG4Core_RunManagerMT_H
2 #define SimG4Core_RunManagerMT_H
3 
6 
8 
10 
11 #include <memory>
12 
13 class PrimaryTransformer;
14 class Generator;
15 class PhysicsList;
16 class CustomUIsession;
17 
18 class SimWatcher;
19 class SimProducer;
20 class G4SimEvent;
21 
22 class RunAction;
23 
24 class DDCompactView;
25 
26 namespace cms {
27  class DDCompactView;
28 }
29 
30 class DDDWorld;
31 
32 class G4MTRunManagerKernel;
33 class G4Run;
34 class G4Event;
35 class RunAction;
36 
37 class SimRunInterface;
38 
39 namespace HepPDT {
40  class ParticleDataTable;
41 }
42 
48 class RunManagerMTWorker;
49 
50 class RunManagerMT {
51  friend class RunManagerMTWorker;
52 
53 public:
54  explicit RunManagerMT(edm::ParameterSet const&);
55  ~RunManagerMT();
56 
58 
59  void initializeUserActions();
60 
61  void stopG4();
62 
63  void Connect(RunAction*);
64 
65  // Keep this to keep ExceptionHandler to compile, probably removed
66  // later (or functionality moved to RunManagerMTWorker)
67  inline void abortRun(bool softAbort = false) {}
68 
69  inline const DDDWorld& world() const { return *m_world; }
70 
71  inline const SensitiveDetectorCatalog& catalog() const { return m_catalog; }
72 
73  inline const std::vector<std::string>& G4Commands() const { return m_G4Commands; }
74 
75  // In order to share the physics list with the worker threads, we
76  // need a non-const pointer. Thread-safety is handled inside Geant4
77  // with TLS.
78  inline PhysicsList* physicsListForWorker() const { return m_physicsList.get(); }
79 
80 private:
81  void terminateRun();
82 
83  G4MTRunManagerKernel* m_kernel;
84 
86  std::unique_ptr<PhysicsList> m_physicsList;
90  G4Run* m_currentRun;
91 
92  std::unique_ptr<SimRunInterface> m_runInterface;
93 
97  bool m_check;
101  std::vector<std::string> m_G4Commands;
103 
104  std::unique_ptr<DDDWorld> m_world;
107 };
108 
109 #endif
RunManagerMT::m_runInterface
std::unique_ptr< SimRunInterface > m_runInterface
Definition: RunManagerMT.h:92
RunManagerMT::m_g4overlap
edm::ParameterSet m_g4overlap
Definition: RunManagerMT.h:100
RunManagerMT::m_G4Commands
std::vector< std::string > m_G4Commands
Definition: RunManagerMT.h:101
RunManagerMT::m_runTerminated
bool m_runTerminated
Definition: RunManagerMT.h:88
G4SimEvent
Definition: G4SimEvent.h:14
RunManagerMT::initializeUserActions
void initializeUserActions()
Definition: RunManagerMT.cc:255
DDDWorld
Definition: DDDWorld.h:14
RunManagerMT::m_UIsession
CustomUIsession * m_UIsession
Definition: RunManagerMT.h:85
RunManagerMT::m_registry
SimActivityRegistry m_registry
Definition: RunManagerMT.h:105
RunManagerMT::m_check
bool m_check
Definition: RunManagerMT.h:97
SimActivityRegistry.h
RunManagerMT::terminateRun
void terminateRun()
Definition: RunManagerMT.cc:274
RunManagerMT::catalog
const SensitiveDetectorCatalog & catalog() const
Definition: RunManagerMT.h:71
RunManagerMT::m_p
edm::ParameterSet m_p
Definition: RunManagerMT.h:102
PrimaryTransformer
Definition: PrimaryTransformer.h:6
RunManagerMT::RunManagerMT
RunManagerMT(edm::ParameterSet const &)
Definition: RunManagerMT.cc:67
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
RunManagerMT::m_currentRun
G4Run * m_currentRun
Definition: RunManagerMT.h:90
RunManagerMT::world
const DDDWorld & world() const
Definition: RunManagerMT.h:69
SensitiveDetectorCatalog
Definition: SensitiveDetectorCatalog.h:10
PhysicsList
Definition: PhysicsList.h:7
RunManagerMT::m_pPhysics
edm::ParameterSet m_pPhysics
Definition: RunManagerMT.h:98
RunManagerMT::m_physicsList
std::unique_ptr< PhysicsList > m_physicsList
Definition: RunManagerMT.h:86
RunManagerMT
Definition: RunManagerMT.h:50
RunAction
Definition: RunAction.h:15
edm::ParameterSet
Definition: ParameterSet.h:47
RunManagerMT::~RunManagerMT
~RunManagerMT()
Definition: RunManagerMT.cc:93
RunManagerMT::initG4
void initG4(const DDCompactView *, const cms::DDCompactView *, const HepPDT::ParticleDataTable *)
Definition: RunManagerMT.cc:95
Event.h
HepPDT
Definition: ParticleManager.h:17
SimProducer
Definition: SimProducer.h:64
SensitiveDetectorCatalog.h
RunManagerMT::G4Commands
const std::vector< std::string > & G4Commands() const
Definition: RunManagerMT.h:73
SimWatcher
Definition: SimWatcher.h:27
RunManagerMT::m_userRunAction
RunAction * m_userRunAction
Definition: RunManagerMT.h:89
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RunManagerMTWorker
Definition: RunManagerMTWorker.h:48
Generator
Definition: Generator.h:19
SimActivityRegistry
Definition: SimActivityRegistry.h:39
RunManagerMT::physicsListForWorker
PhysicsList * physicsListForWorker() const
Definition: RunManagerMT.h:78
CustomUIsession
Definition: CustomUIsession.h:13
cms::DDCompactView
Definition: DDCompactView.h:31
RunManagerMT::m_managerInitialized
bool m_managerInitialized
Definition: RunManagerMT.h:87
RunManagerMT::m_StorePhysicsTables
bool m_StorePhysicsTables
Definition: RunManagerMT.h:95
RunManagerMT::Connect
void Connect(RunAction *)
Definition: RunManagerMT.cc:261
RunManagerMT::m_PhysicsTablesDir
const std::string m_PhysicsTablesDir
Definition: RunManagerMT.h:94
RunManagerMT::m_world
std::unique_ptr< DDDWorld > m_world
Definition: RunManagerMT.h:104
RunManagerMT::m_RestorePhysicsTables
bool m_RestorePhysicsTables
Definition: RunManagerMT.h:96
RunManagerMT::stopG4
void stopG4()
Definition: RunManagerMT.cc:266
ParameterSet.h
RunManagerMT::m_pRunAction
edm::ParameterSet m_pRunAction
Definition: RunManagerMT.h:99
RunManagerMT::m_kernel
G4MTRunManagerKernel * m_kernel
Definition: RunManagerMT.h:83
ParticleDataTable
HepPDT::ParticleDataTable ParticleDataTable
Definition: ParticleDataTable.h:8
RunManagerMT::m_catalog
SensitiveDetectorCatalog m_catalog
Definition: RunManagerMT.h:106
RunManagerMT::abortRun
void abortRun(bool softAbort=false)
Definition: RunManagerMT.h:67
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21
SimRunInterface
Definition: SimRunInterface.h:17