ATLAS Offline Software
G4AtlasMTRunManager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef G4ATLASALG_G4ATLASMTRUNMANAGER_H
6 #define G4ATLASALG_G4ATLASMTRUNMANAGER_H
7 
8 // Hide multi-threading classes from builds without G4MT
9 #include "G4Types.hh"
10 #ifdef G4MULTITHREADED
11 
12 // Geant4 includes
13 #include "G4MTRunManager.hh"
14 
15 // Framework includes
16 #include "GaudiKernel/ToolHandle.h"
17 #include "GaudiKernel/ServiceHandle.h"
20 
21 // G4Atlas includes
25 
26 
37 class G4AtlasMTRunManager: public G4MTRunManager, public AthMessaging {
38 
39 public:
40 
42  static G4AtlasMTRunManager* GetG4AtlasMTRunManager ATLAS_NOT_THREAD_SAFE ();
43 
45  void RunTermination() override final;
46 
50  void Initialize() override final;
51 
54  virtual void ThisWorkerReady() override final {};
55  virtual void ThisWorkerEndEventLoop() override final {};
56 
58  void SetDetGeoSvc(const std::string& typeAndName) {
59  m_detGeoSvc.setTypeAndName(typeAndName);
60  }
61 
63  void SetFastSimMasterTool(const std::string& typeAndName) {
64  m_fastSimTool.setTypeAndName(typeAndName);
65  }
66 
68  void SetPhysListSvc(const std::string& typeAndName) {
69  m_physListSvc.setTypeAndName(typeAndName);
70  }
71 
73  void SetQuietMode(bool quietMode) {
74  m_quietMode = quietMode;
75  }
77 
78  protected:
79 
81  void InitializeGeometry() override final;
82 
83  // Initialize the physics list on the master
84  void InitializePhysics() override final;
85 
88  virtual void WaitForReadyWorkers() override final {};
89  virtual void WaitForEndEventLoopWorkers() override final {};
90 
91 private:
92 
94  G4AtlasMTRunManager();
95 
96 private:
100 
103  ServiceHandle<IPhysicsListSvc> m_physListSvc;
104 
107  ToolHandle<IFastSimulationMasterTool> m_fastSimTool;
108 
110  bool m_quietMode{true};
111 
112 }; // class G4AtlasMTRunManager
113 
114 #endif // G4MULTITHREADED
115 
116 #endif
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
IFastSimulationMasterTool.h
IDetectorGeometrySvc.h
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
jobOptions.Initialize
Initialize
Definition: jobOptions.pA.py:28
AthMessaging.h
IPhysicsListSvc.h
checker_macros.h
Define macros for attributes used to control the static checker.
ServiceHandle< IDetectorGeometrySvc >