ATLAS Offline Software
G4AtlasRunManager.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_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 */ }
63 
64  void SetVolumeSmartlessLevel(const std::map<std::string,double>& nameAndValue){
65  m_volumeSmartlessLevel = nameAndValue;
66  }
67 
68 protected:
69 
72  void Initialize() override final;
73  void InitializeGeometry() override final;
74  void InitializePhysics() override final;
76 
77 private:
78 
81 
82  void EndEvent();
83 
85 
88 
90 
92 
93  std::unique_ptr<IFluxRecorder> m_fluxRecorder;
94 
95  //Property to allow an arbitrary volume (named by string) to have its
96  //"smartless" value set
97  std::map<std::string, double> m_volumeSmartlessLevel;
98 
99 };
100 
101 #endif // G4ATLASALG_G4AtlasRunManager_h
G4AtlasRunManager::Initialize
void Initialize() override final
Definition: G4AtlasRunManager.cxx:41
IFluxRecorder.h
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
G4AtlasRunManager::~G4AtlasRunManager
virtual ~G4AtlasRunManager()
Definition: G4AtlasRunManager.h:34
ISensitiveDetectorMasterTool.h
IFluxRecorder
Definition: IFluxRecorder.h:10
G4AtlasRunManager::RunTermination
void RunTermination() override final
G4 function called at end of run.
Definition: G4AtlasRunManager.cxx:141
G4AtlasRunManager::SetLogLevel
void SetLogLevel(int)
Definition: G4AtlasRunManager.h:61
G4AtlasRunManager::m_physListSvc
ServiceHandle< IPhysicsListSvc > m_physListSvc
Definition: G4AtlasRunManager.h:87
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
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:93
IDetectorGeometrySvc.h
G4AtlasRunManager::m_volumeSmartlessLevel
std::map< std::string, double > m_volumeSmartlessLevel
Definition: G4AtlasRunManager.h:97
IFastSimulationMasterTool
Definition: IFastSimulationMasterTool.h:18
G4AtlasRunManager::ProcessEvent
bool ProcessEvent(G4Event *event)
Does the work of simulating an ATLAS event.
Definition: G4AtlasRunManager.cxx:117
G4AtlasRunManager::m_recordFlux
bool m_recordFlux
Definition: G4AtlasRunManager.h:84
G4AtlasRunManager::m_detGeoSvc
ServiceHandle< IDetectorGeometrySvc > m_detGeoSvc
Definition: G4AtlasRunManager.h:89
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
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:64
AthMessaging.h
G4AtlasRunManager::InitializePhysics
void InitializePhysics() override final
Definition: G4AtlasRunManager.cxx:79
G4AtlasRunManager::m_fastSimTool
ToolHandle< IFastSimulationMasterTool > m_fastSimTool
Definition: G4AtlasRunManager.h:86
IPhysicsListSvc.h
checker_macros.h
Define macros for attributes used to control the static checker.
G4AtlasRunManager::InitializeGeometry
void InitializeGeometry() override final
Definition: G4AtlasRunManager.cxx:50
G4AtlasRunManager::EndEvent
void EndEvent()
Definition: G4AtlasRunManager.cxx:73
ServiceHandle
Definition: ClusterMakerTool.h:37