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 G4StateManager;
36 class RunAction;
37 
38 class SimRunInterface;
39 
40 namespace HepPDT {
41  class ParticleDataTable;
42 }
43 
49 class RunManagerMTWorker;
50 
51 class RunManagerMT {
52  friend class RunManagerMTWorker;
53 
54 public:
55  explicit RunManagerMT(edm::ParameterSet const&);
56  ~RunManagerMT();
57 
59 
60  void initializeUserActions();
61 
62  void stopG4();
63 
64  void Connect(RunAction*);
65 
66  // Keep this to keep ExceptionHandler to compile, probably removed
67  // later (or functionality moved to RunManagerMTWorker).
68  // inline void abortRun(bool softAbort = false) {}
69 
70  inline const DDDWorld& world() const { return *m_world; }
71 
72  inline const SensitiveDetectorCatalog& catalog() const { return m_catalog; }
73 
74  inline const std::vector<std::string>& G4Commands() const { return m_G4Commands; }
75 
76  // In order to share the physics list with the worker threads, we
77  // need a non-const pointer. Thread-safety is handled inside Geant4.
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  G4StateManager* m_stateManager;
92 
93  std::unique_ptr<SimRunInterface> m_runInterface;
94 
98  bool m_check;
102  std::vector<std::string> m_G4Commands;
104 
105  std::unique_ptr<DDDWorld> m_world;
108 };
109 
110 #endif
void Connect(RunAction *)
const std::string m_PhysicsTablesDir
Definition: RunManagerMT.h:95
bool m_managerInitialized
Definition: RunManagerMT.h:87
G4MTRunManagerKernel * m_kernel
Definition: RunManagerMT.h:83
SensitiveDetectorCatalog m_catalog
Definition: RunManagerMT.h:107
edm::ParameterSet m_pRunAction
Definition: RunManagerMT.h:100
HepPDT::ParticleDataTable ParticleDataTable
void terminateRun()
RunManagerMT(edm::ParameterSet const &)
Definition: RunManagerMT.cc:68
bool m_runTerminated
Definition: RunManagerMT.h:88
G4StateManager * m_stateManager
Definition: RunManagerMT.h:91
std::vector< std::string > m_G4Commands
Definition: RunManagerMT.h:102
G4Run * m_currentRun
Definition: RunManagerMT.h:90
void initializeUserActions()
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
const SensitiveDetectorCatalog & catalog() const
Definition: RunManagerMT.h:72
edm::ParameterSet m_p
Definition: RunManagerMT.h:103
Namespace of DDCMS conversion namespace.
bool m_StorePhysicsTables
Definition: RunManagerMT.h:96
const DDDWorld & world() const
Definition: RunManagerMT.h:70
std::unique_ptr< PhysicsList > m_physicsList
Definition: RunManagerMT.h:86
std::unique_ptr< DDDWorld > m_world
Definition: RunManagerMT.h:105
edm::ParameterSet m_pPhysics
Definition: RunManagerMT.h:99
bool m_RestorePhysicsTables
Definition: RunManagerMT.h:97
void initG4(const DDCompactView *, const cms::DDCompactView *, const HepPDT::ParticleDataTable *)
Definition: RunManagerMT.cc:98
const std::vector< std::string > & G4Commands() const
Definition: RunManagerMT.h:74
std::unique_ptr< SimRunInterface > m_runInterface
Definition: RunManagerMT.h:93
edm::ParameterSet m_g4overlap
Definition: RunManagerMT.h:101
RunAction * m_userRunAction
Definition: RunManagerMT.h:89
CustomUIsession * m_UIsession
Definition: RunManagerMT.h:85
PhysicsList * physicsListForWorker() const
Definition: RunManagerMT.h:78
SimActivityRegistry m_registry
Definition: RunManagerMT.h:106