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  void checkVoxels();
84 
85  void setupVoxels();
86 
87  G4MTRunManagerKernel* m_kernel;
88 
90  std::unique_ptr<PhysicsList> m_physicsList;
94  G4Run* m_currentRun;
95  G4StateManager* m_stateManager;
96 
97  std::unique_ptr<SimRunInterface> m_runInterface;
98 
102  bool m_check;
106  std::vector<std::string> m_G4Commands;
108 
109  std::unique_ptr<DDDWorld> m_world;
112 };
113 
114 #endif
void Connect(RunAction *)
const std::string m_PhysicsTablesDir
Definition: RunManagerMT.h:99
bool m_managerInitialized
Definition: RunManagerMT.h:91
G4MTRunManagerKernel * m_kernel
Definition: RunManagerMT.h:87
SensitiveDetectorCatalog m_catalog
Definition: RunManagerMT.h:111
edm::ParameterSet m_pRunAction
Definition: RunManagerMT.h:104
HepPDT::ParticleDataTable ParticleDataTable
void terminateRun()
RunManagerMT(edm::ParameterSet const &)
Definition: RunManagerMT.cc:67
void setupVoxels()
bool m_runTerminated
Definition: RunManagerMT.h:92
G4StateManager * m_stateManager
Definition: RunManagerMT.h:95
std::vector< std::string > m_G4Commands
Definition: RunManagerMT.h:106
G4Run * m_currentRun
Definition: RunManagerMT.h:94
void initializeUserActions()
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
void checkVoxels()
const SensitiveDetectorCatalog & catalog() const
Definition: RunManagerMT.h:72
edm::ParameterSet m_p
Definition: RunManagerMT.h:107
Namespace of DDCMS conversion namespace.
bool m_StorePhysicsTables
Definition: RunManagerMT.h:100
const DDDWorld & world() const
Definition: RunManagerMT.h:70
std::unique_ptr< PhysicsList > m_physicsList
Definition: RunManagerMT.h:90
std::unique_ptr< DDDWorld > m_world
Definition: RunManagerMT.h:109
edm::ParameterSet m_pPhysics
Definition: RunManagerMT.h:103
bool m_RestorePhysicsTables
Definition: RunManagerMT.h:101
void initG4(const DDCompactView *, const cms::DDCompactView *, const HepPDT::ParticleDataTable *)
Definition: RunManagerMT.cc:97
const std::vector< std::string > & G4Commands() const
Definition: RunManagerMT.h:74
std::unique_ptr< SimRunInterface > m_runInterface
Definition: RunManagerMT.h:97
edm::ParameterSet m_g4overlap
Definition: RunManagerMT.h:105
RunAction * m_userRunAction
Definition: RunManagerMT.h:93
CustomUIsession * m_UIsession
Definition: RunManagerMT.h:89
PhysicsList * physicsListForWorker() const
Definition: RunManagerMT.h:78
SimActivityRegistry m_registry
Definition: RunManagerMT.h:110