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
23 
29 
30 class G4AtlasRunManager: public G4RunManager, public AthMessaging {
31 
32 public:
33 
34  virtual ~G4AtlasRunManager() {}
35 
37  static G4AtlasRunManager* GetG4AtlasRunManager ATLAS_NOT_THREAD_SAFE ();
38 
40  bool ProcessEvent(G4Event* event);
41 
43  void RunTermination() override final;
44 
46  void SetDetGeoSvc(const std::string& typeAndName) {
47  m_detGeoSvc.setTypeAndName(typeAndName);
48  }
49 
51  void SetFastSimMasterTool(const std::string& typeAndName) {
52  m_fastSimTool.setTypeAndName(typeAndName);
53  }
54 
56  void SetPhysListSvc(const std::string& typeAndName) {
57  m_physListSvc.setTypeAndName(typeAndName);
58  }
59 
60  void SetRecordFlux(bool b, std::unique_ptr<IFluxRecorder> f) { m_recordFlux = b; m_fluxRecorder=std::move(f);}
61  void SetLogLevel(int) { /* Not implemented */ }
62 
63  void SetVolumeSmartlessLevel(const std::map<std::string,double>& nameAndValue){
64  m_volumeSmartlessLevel = nameAndValue;
65  }
66 
68  void SetQuietMode(bool quietMode) {
69  m_quietMode = quietMode;
70  }
71 
72 protected:
73 
76  void Initialize() override final;
77  void InitializeGeometry() override final;
78  void InitializePhysics() override final;
80 
81 private:
82 
85 
86  void EndEvent();
87 
89 
92 
94 
96 
97  std::unique_ptr<IFluxRecorder> m_fluxRecorder;
98 
99  //Property to allow an arbitrary volume (named by string) to have its
100  //"smartless" value set
101  std::map<std::string, double> m_volumeSmartlessLevel;
102 
104  bool m_quietMode{true};
105 
106 };
107 
108 #endif // G4ATLASALG_G4AtlasRunManager_h
G4AtlasRunManager::Initialize
void Initialize() override final
Definition: G4AtlasRunManager.cxx:41
IFluxRecorder.h
G4AtlasRunManager::~G4AtlasRunManager
virtual ~G4AtlasRunManager()
Definition: G4AtlasRunManager.h:34
G4AtlasRunManager::SetQuietMode
void SetQuietMode(bool quietMode)
Configure the QuietMode option.
Definition: G4AtlasRunManager.h:68
ISensitiveDetectorMasterTool.h
IFluxRecorder
Definition: IFluxRecorder.h:10
G4AtlasRunManager::RunTermination
void RunTermination() override final
G4 function called at end of run.
Definition: G4AtlasRunManager.cxx:142
G4AtlasRunManager::m_quietMode
bool m_quietMode
Quiet Mode for production.
Definition: G4AtlasRunManager.h:104
G4AtlasRunManager::SetLogLevel
void SetLogLevel(int)
Definition: G4AtlasRunManager.h:61
G4AtlasRunManager::m_physListSvc
ServiceHandle< IPhysicsListSvc > m_physListSvc
Definition: G4AtlasRunManager.h:91
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
G4AtlasRunManager
ATLAS custom singleton run manager.
Definition: G4AtlasRunManager.h:30
IFastSimulationMasterTool.h
G4AtlasRunManager::SetPhysListSvc
void SetPhysListSvc(const std::string &typeAndName)
Configure the Physics List Tool handle.
Definition: G4AtlasRunManager.h:56
G4AtlasRunManager::ATLAS_NOT_THREAD_SAFE
static G4AtlasRunManager *GetG4AtlasRunManager ATLAS_NOT_THREAD_SAFE()
Retrieve the singleton instance.
IDetectorGeometrySvc
Definition: IDetectorGeometrySvc.h:23
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
G4AtlasRunManager::SetRecordFlux
void SetRecordFlux(bool b, std::unique_ptr< IFluxRecorder > f)
Definition: G4AtlasRunManager.h:60
G4AtlasRunManager::m_fluxRecorder
std::unique_ptr< IFluxRecorder > m_fluxRecorder
Interface to flux recording.
Definition: G4AtlasRunManager.h:97
IDetectorGeometrySvc.h
G4AtlasRunManager::m_volumeSmartlessLevel
std::map< std::string, double > m_volumeSmartlessLevel
Definition: G4AtlasRunManager.h:101
IFastSimulationMasterTool
Definition: IFastSimulationMasterTool.h:18
G4AtlasRunManager::ProcessEvent
bool ProcessEvent(G4Event *event)
Does the work of simulating an ATLAS event.
Definition: G4AtlasRunManager.cxx:118
G4AtlasRunManager::m_recordFlux
bool m_recordFlux
Definition: G4AtlasRunManager.h:88
G4AtlasRunManager::m_detGeoSvc
ServiceHandle< IDetectorGeometrySvc > m_detGeoSvc
Definition: G4AtlasRunManager.h:93
G4AtlasRunManager::SetFastSimMasterTool
void SetFastSimMasterTool(const std::string &typeAndName)
Configure the Fast Simulation Master Tool handle.
Definition: G4AtlasRunManager.h:51
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
hist_file_dump.f
f
Definition: hist_file_dump.py:135
G4AtlasRunManager::SetDetGeoSvc
void SetDetGeoSvc(const std::string &typeAndName)
Configure the detector geometry service handle.
Definition: G4AtlasRunManager.h:46
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
IPhysicsListSvc
Definition: IPhysicsListSvc.h:21
G4AtlasRunManager::SetVolumeSmartlessLevel
void SetVolumeSmartlessLevel(const std::map< std::string, double > &nameAndValue)
Definition: G4AtlasRunManager.h:63
AthMessaging.h
G4AtlasRunManager::InitializePhysics
void InitializePhysics() override final
Definition: G4AtlasRunManager.cxx:80
G4AtlasRunManager::m_fastSimTool
ToolHandle< IFastSimulationMasterTool > m_fastSimTool
Definition: G4AtlasRunManager.h:90
IPhysicsListSvc.h
checker_macros.h
Define macros for attributes used to control the static checker.
G4AtlasRunManager::InitializeGeometry
void InitializeGeometry() override final
Definition: G4AtlasRunManager.cxx:51
G4AtlasRunManager::EndEvent
void EndEvent()
Definition: G4AtlasRunManager.cxx:74
ServiceHandle
Definition: ClusterMakerTool.h:37