ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Atlas
G4AtlasAlg
G4AtlasAlg
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
16
#include "
AthenaBaseComps/AthMessaging.h
"
17
#include "
CxxUtils/checker_macros.h
"
18
#include "
G4AtlasInterfaces/IDetectorConstructionTool.h
"
19
#include "
G4AtlasInterfaces/IPhysicsListSvc.h
"
20
#include "
G4AtlasInterfaces/IFluxRecorder.h
"
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
44
void
SetDetConstructionTool
(
IDetectorConstructionTool
* detConstruction) {
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
77
G4AtlasRunManager
();
78
79
void
EndEvent
();
80
81
bool
m_recordFlux
;
82
83
ServiceHandle
<
IPhysicsListSvc
>
m_physListSvc
;
84
85
IDetectorConstructionTool
*
m_detConstruction
{
nullptr
};
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
AthMessaging.h
IDetectorConstructionTool.h
IFluxRecorder.h
IPhysicsListSvc.h
checker_macros.h
Define macros for attributes used to control the static checker.
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
G4AtlasRunManager
ATLAS custom singleton run manager.
Definition
G4AtlasRunManager.h:28
G4AtlasRunManager::InitializeGeometry
void InitializeGeometry() override final
Definition
G4AtlasRunManager.cxx:48
G4AtlasRunManager::EndEvent
void EndEvent()
Definition
G4AtlasRunManager.cxx:65
G4AtlasRunManager::ProcessEvent
bool ProcessEvent(G4Event *event)
Does the work of simulating an ATLAS event.
Definition
G4AtlasRunManager.cxx:94
G4AtlasRunManager::m_physListSvc
ServiceHandle< IPhysicsListSvc > m_physListSvc
Definition
G4AtlasRunManager.h:83
G4AtlasRunManager::m_volumeSmartlessLevel
std::map< std::string, double > m_volumeSmartlessLevel
Definition
G4AtlasRunManager.h:93
G4AtlasRunManager::SetRecordFlux
void SetRecordFlux(bool b, std::unique_ptr< IFluxRecorder > f)
Definition
G4AtlasRunManager.h:53
G4AtlasRunManager::SetQuietMode
void SetQuietMode(bool quietMode)
Configure the QuietMode option.
Definition
G4AtlasRunManager.h:61
G4AtlasRunManager::m_detConstruction
IDetectorConstructionTool * m_detConstruction
Definition
G4AtlasRunManager.h:85
G4AtlasRunManager::ATLAS_NOT_THREAD_SAFE
static G4AtlasRunManager *GetG4AtlasRunManager ATLAS_NOT_THREAD_SAFE()
Retrieve the singleton instance.
G4AtlasRunManager::RunTermination
void RunTermination() override final
G4 function called at end of run.
Definition
G4AtlasRunManager.cxx:118
G4AtlasRunManager::m_recordFlux
bool m_recordFlux
Definition
G4AtlasRunManager.h:81
G4AtlasRunManager::SetLogLevel
void SetLogLevel(int)
Definition
G4AtlasRunManager.h:54
G4AtlasRunManager::G4AtlasRunManager
G4AtlasRunManager()
Pure singleton private constructor.
Definition
G4AtlasRunManager.cxx:22
G4AtlasRunManager::m_quietMode
bool m_quietMode
Quiet Mode for production.
Definition
G4AtlasRunManager.h:96
G4AtlasRunManager::~G4AtlasRunManager
virtual ~G4AtlasRunManager()
Definition
G4AtlasRunManager.h:32
G4AtlasRunManager::SetPhysListSvc
void SetPhysListSvc(const std::string &typeAndName)
Configure the Physics List Tool handle.
Definition
G4AtlasRunManager.h:49
G4AtlasRunManager::m_fluxRecorder
std::unique_ptr< IFluxRecorder > m_fluxRecorder
Interface to flux recording.
Definition
G4AtlasRunManager.h:89
G4AtlasRunManager::SetVolumeSmartlessLevel
void SetVolumeSmartlessLevel(const std::map< std::string, double > &nameAndValue)
Definition
G4AtlasRunManager.h:56
G4AtlasRunManager::Initialize
void Initialize() override final
Definition
G4AtlasRunManager.cxx:39
G4AtlasRunManager::SetDetConstructionTool
void SetDetConstructionTool(IDetectorConstructionTool *detConstruction)
Configure the detector construction tool.
Definition
G4AtlasRunManager.h:44
G4AtlasRunManager::InitializePhysics
void InitializePhysics() override final
Definition
G4AtlasRunManager.cxx:71
IDetectorConstructionTool
Abstract interface to a detector construction tool.
Definition
IDetectorConstructionTool.h:25
IPhysicsListSvc
Abstract interface to Geant4 Physics list classes.
Definition
IPhysicsListSvc.h:21
ServiceHandle
Definition
ClusterMakerTool.h:36
private
#define private
Definition
testRead.cxx:27
Generated on
for ATLAS Offline Software by
1.17.0