ATLAS Offline Software
G4AtlasRunManager.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_G4AtlasRunManager_h
6 #define G4ATLASALG_G4AtlasRunManager_h
7 
8 // Base class header
9 #include "G4RunManager.hh"
10 
11 // Gaudi headers
12 #include "GaudiKernel/ServiceHandle.h"
13 #include "GaudiKernel/ToolHandle.h"
14 
15 // Athena headers
21 
27 
28 class G4AtlasRunManager: public G4RunManager, public AthMessaging {
29 
30 public:
31 
32  virtual ~G4AtlasRunManager() {}
33 
35  static G4AtlasRunManager* GetG4AtlasRunManager ATLAS_NOT_THREAD_SAFE ();
36 
38  bool ProcessEvent(G4Event* event);
39 
41  void RunTermination() override final;
42 
45  m_detConstruction = detConstruction;
46  }
47 
49  void SetPhysListSvc(const std::string& typeAndName) {
50  m_physListSvc.setTypeAndName(typeAndName);
51  }
52 
53  void SetRecordFlux(bool b, std::unique_ptr<IFluxRecorder> f) { m_recordFlux = b; m_fluxRecorder=std::move(f);}
54  void SetLogLevel(int) { /* Not implemented */ }
55 
56  void SetVolumeSmartlessLevel(const std::map<std::string,double>& nameAndValue){
57  m_volumeSmartlessLevel = nameAndValue;
58  }
59 
61  void SetQuietMode(bool quietMode) {
62  m_quietMode = quietMode;
63  }
64 
65 protected:
66 
69  void Initialize() override final;
70  void InitializeGeometry() override final;
71  void InitializePhysics() override final;
73 
74 private:
75 
78 
79  void EndEvent();
80 
82 
84 
86 
88 
89  std::unique_ptr<IFluxRecorder> m_fluxRecorder;
90 
91  //Property to allow an arbitrary volume (named by string) to have its
92  //"smartless" value set
93  std::map<std::string, double> m_volumeSmartlessLevel;
94 
96  bool m_quietMode{true};
97 
98 };
99 
100 #endif // G4ATLASALG_G4AtlasRunManager_h
G4AtlasRunManager::Initialize
void Initialize() override final
Definition: G4AtlasRunManager.cxx:39
IFluxRecorder.h
IDetectorConstructionTool
Definition: IDetectorConstructionTool.h:25
G4AtlasRunManager::~G4AtlasRunManager
virtual ~G4AtlasRunManager()
Definition: G4AtlasRunManager.h:32
G4AtlasRunManager::SetQuietMode
void SetQuietMode(bool quietMode)
Configure the QuietMode option.
Definition: G4AtlasRunManager.h:61
G4AtlasRunManager::RunTermination
void RunTermination() override final
G4 function called at end of run.
Definition: G4AtlasRunManager.cxx:118
G4AtlasRunManager::m_quietMode
bool m_quietMode
Quiet Mode for production.
Definition: G4AtlasRunManager.h:96
G4AtlasRunManager::SetLogLevel
void SetLogLevel(int)
Definition: G4AtlasRunManager.h:54
G4AtlasRunManager::m_physListSvc
ServiceHandle< IPhysicsListSvc > m_physListSvc
Definition: G4AtlasRunManager.h:83
G4AtlasRunManager
ATLAS custom singleton run manager.
Definition: G4AtlasRunManager.h:28
G4AtlasRunManager::m_detConstruction
IDetectorConstructionTool * m_detConstruction
Definition: G4AtlasRunManager.h:85
G4AtlasRunManager::SetPhysListSvc
void SetPhysListSvc(const std::string &typeAndName)
Configure the Physics List Tool handle.
Definition: G4AtlasRunManager.h:49
G4AtlasRunManager::ATLAS_NOT_THREAD_SAFE
static G4AtlasRunManager *GetG4AtlasRunManager ATLAS_NOT_THREAD_SAFE()
Retrieve the singleton instance.
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
G4AtlasRunManager::SetRecordFlux
void SetRecordFlux(bool b, std::unique_ptr< IFluxRecorder > f)
Definition: G4AtlasRunManager.h:53
G4AtlasRunManager::m_fluxRecorder
std::unique_ptr< IFluxRecorder > m_fluxRecorder
Interface to flux recording.
Definition: G4AtlasRunManager.h:89
G4AtlasRunManager::m_volumeSmartlessLevel
std::map< std::string, double > m_volumeSmartlessLevel
Definition: G4AtlasRunManager.h:93
G4AtlasRunManager::ProcessEvent
bool ProcessEvent(G4Event *event)
Does the work of simulating an ATLAS event.
Definition: G4AtlasRunManager.cxx:94
G4AtlasRunManager::m_recordFlux
bool m_recordFlux
Definition: G4AtlasRunManager.h:81
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
hist_file_dump.f
f
Definition: hist_file_dump.py:140
columnar::final
CM final
Definition: ColumnAccessor.h:106
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
IPhysicsListSvc
Definition: IPhysicsListSvc.h:21
IDetectorConstructionTool.h
G4AtlasRunManager::SetVolumeSmartlessLevel
void SetVolumeSmartlessLevel(const std::map< std::string, double > &nameAndValue)
Definition: G4AtlasRunManager.h:56
AthMessaging.h
G4AtlasRunManager::InitializePhysics
void InitializePhysics() override final
Definition: G4AtlasRunManager.cxx:71
IPhysicsListSvc.h
private
#define private
Definition: xAODTruthCnvAlg.h:20
G4AtlasRunManager::SetDetConstructionTool
void SetDetConstructionTool(IDetectorConstructionTool *detConstruction)
Configure the detector construction tool.
Definition: G4AtlasRunManager.h:44
checker_macros.h
Define macros for attributes used to control the static checker.
G4AtlasRunManager::InitializeGeometry
void InitializeGeometry() override final
Definition: G4AtlasRunManager.cxx:48
G4AtlasRunManager::EndEvent
void EndEvent()
Definition: G4AtlasRunManager.cxx:65
ServiceHandle
Definition: ClusterMakerTool.h:37