ATLAS Offline Software
G4AtlasMTRunManager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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 
72  protected:
73 
75  void InitializeGeometry() override final;
76 
77  // Initialize the physics list on the master
78  void InitializePhysics() override final;
79 
82  virtual void WaitForReadyWorkers() override final {};
83  virtual void WaitForEndEventLoopWorkers() override final {};
84 
85 private:
86 
88  G4AtlasMTRunManager();
89 
90 private:
94 
97  ServiceHandle<IPhysicsListSvc> m_physListSvc;
98 
101  ToolHandle<IFastSimulationMasterTool> m_fastSimTool;
102 
103 }; // class G4AtlasMTRunManager
104 
105 #endif // G4MULTITHREADED
106 
107 #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 >