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 
9 
10 #include <memory>
11 
12 class PrimaryTransformer;
13 class Generator;
14 class PhysicsList;
15 class CustomUIsession;
16 
17 class SimWatcher;
18 class SimProducer;
19 class G4SimEvent;
20 
21 class RunAction;
22 
23 class DDCompactView;
24 
25 namespace cms {
26  class DDCompactView;
27 }
28 
29 class DDDWorld;
30 
31 class G4MTRunManagerKernel;
32 class G4Run;
33 class G4Event;
34 class G4StateManager;
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  inline PhysicsList* physicsListForWorker() const { return m_physicsList.get(); }
78 
79  inline bool isPhase2() const { return m_isPhase2; }
80 
81 private:
82  void terminateRun();
83 
84  void checkVoxels();
85 
86  void setupVoxels();
87 
88  void runForPhase2();
89 
90  G4MTRunManagerKernel* m_kernel;
91 
93  std::unique_ptr<PhysicsList> m_physicsList;
94  bool m_managerInitialized{false};
95  bool m_runTerminated{false};
97  G4Run* m_currentRun{nullptr};
98  G4StateManager* m_stateManager;
99 
100  std::unique_ptr<SimRunInterface> m_runInterface;
101 
105  bool m_check;
107  bool m_score;
108  bool m_isPhase2{false};
115  std::vector<std::string> m_G4Commands;
116 
117  std::unique_ptr<DDDWorld> m_world;
120 };
121 
122 #endif
void Connect(RunAction *)
const std::string m_PhysicsTablesDir
Definition: RunManagerMT.h:102
bool m_managerInitialized
Definition: RunManagerMT.h:94
G4MTRunManagerKernel * m_kernel
Definition: RunManagerMT.h:90
std::string m_regionFile
Definition: RunManagerMT.h:110
SensitiveDetectorCatalog m_catalog
Definition: RunManagerMT.h:119
edm::ParameterSet m_pRunAction
Definition: RunManagerMT.h:112
HepPDT::ParticleDataTable ParticleDataTable
void runForPhase2()
void terminateRun()
RunManagerMT(edm::ParameterSet const &)
Definition: RunManagerMT.cc:60
void setupVoxels()
bool m_runTerminated
Definition: RunManagerMT.h:95
G4StateManager * m_stateManager
Definition: RunManagerMT.h:98
std::vector< std::string > m_G4Commands
Definition: RunManagerMT.h:115
G4Run * m_currentRun
Definition: RunManagerMT.h:97
void initializeUserActions()
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
void checkVoxels()
edm::ParameterSet m_Init
Definition: RunManagerMT.h:114
const SensitiveDetectorCatalog & catalog() const
Definition: RunManagerMT.h:71
bool isPhase2() const
Definition: RunManagerMT.h:79
Namespace of DDCMS conversion namespace.
bool m_StorePhysicsTables
Definition: RunManagerMT.h:103
const DDDWorld & world() const
Definition: RunManagerMT.h:69
std::unique_ptr< PhysicsList > m_physicsList
Definition: RunManagerMT.h:93
std::unique_ptr< DDDWorld > m_world
Definition: RunManagerMT.h:117
edm::ParameterSet m_pPhysics
Definition: RunManagerMT.h:111
bool m_RestorePhysicsTables
Definition: RunManagerMT.h:104
bool m_geoFromDD4hep
Definition: RunManagerMT.h:106
void initG4(const DDCompactView *, const cms::DDCompactView *, const HepPDT::ParticleDataTable *)
Definition: RunManagerMT.cc:92
const std::vector< std::string > & G4Commands() const
Definition: RunManagerMT.h:73
edm::ParameterSet m_CheckOverlap
Definition: RunManagerMT.h:113
std::unique_ptr< SimRunInterface > m_runInterface
Definition: RunManagerMT.h:100
RunAction * m_userRunAction
Definition: RunManagerMT.h:96
CustomUIsession * m_UIsession
Definition: RunManagerMT.h:92
PhysicsList * physicsListForWorker() const
Definition: RunManagerMT.h:77
SimActivityRegistry m_registry
Definition: RunManagerMT.h:118