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/ServiceHandle.h"
17 #include <GaudiKernel/ToolHandle.h>
20 
21 // G4Atlas includes
24 
25 
36 class G4AtlasMTRunManager: public G4MTRunManager, public AthMessaging {
37 
38 public:
39 
41  static G4AtlasMTRunManager* GetG4AtlasMTRunManager ATLAS_NOT_THREAD_SAFE ();
42 
44  void RunTermination() override final;
45 
49  void Initialize() override final;
50 
53  virtual void ThisWorkerReady() override final {};
54  virtual void ThisWorkerEndEventLoop() override final {};
55 
57  void SetDetConstructionTool(IDetectorConstructionTool* detConstruction) {
58  m_detConstruction = detConstruction;
59  }
60 
62  void SetPhysListSvc(const std::string& typeAndName) {
63  m_physListSvc.setTypeAndName(typeAndName);
64  }
65 
67  void SetQuietMode(bool quietMode) {
68  m_quietMode = quietMode;
69  }
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:
93  IDetectorConstructionTool* m_detConstruction{nullptr};
94 
97  ServiceHandle<IPhysicsListSvc> m_physListSvc;
98 
100  bool m_quietMode{true};
101 
102 }; // class G4AtlasMTRunManager
103 
104 #endif // G4MULTITHREADED
105 
106 #endif
IDetectorConstructionTool
Definition: IDetectorConstructionTool.h:25
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
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
columnar::final
CM final
Definition: ColumnAccessor.h:106
jobOptions.Initialize
Initialize
Definition: jobOptions.pA.py:28
IDetectorConstructionTool.h
AthMessaging.h
IPhysicsListSvc.h
checker_macros.h
Define macros for attributes used to control the static checker.
ServiceHandle< IPhysicsListSvc >