ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Atlas
G4AtlasTools
src
FastSimulationConstructorTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// class header
6
#include "
FastSimulationConstructorTool.h
"
7
8
// G4 headers
9
#include "G4FastSimulationManagerProcess.hh"
10
#include "G4ParticleDefinition.hh"
11
#include "G4ProcessManager.hh"
12
13
//=============================================================================
14
// Standard constructor, initializes variables
15
//=============================================================================
16
FastSimulationConstructorTool::FastSimulationConstructorTool
(
17
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent)
18
: base_class(
type
, name, parent) {
19
m_physicsOptionType = G4AtlasPhysicsOption::Type::UnknownType;
20
}
21
22
//=============================================================================
23
// Initialize
24
//=============================================================================
25
StatusCode
FastSimulationConstructorTool::initialize
() {
26
ATH_MSG_VERBOSE
(
"FastSimulationConstructorTool initialize( )"
);
27
28
return
StatusCode::SUCCESS;
29
}
30
31
auto
FastSimulationConstructorTool::GetPhysicsOption
() -> UPPhysicsConstructor {
32
return
std::make_unique<FastSimulationConstructorTool::PhysicsConstructor>(
33
m_initializeFastSimulation
, name(), this->msgLevel());
34
}
35
36
//=============================================================================
37
// Physics Constructor implementation
38
//=============================================================================
39
40
FastSimulationConstructorTool::PhysicsConstructor::PhysicsConstructor
(
41
bool
initializeFastSimulation,
const
std::string& name, MSG::Level level)
42
:
IPhysicsContructor
(name, level),
m_initializeFastSimulation
(initializeFastSimulation) {}
43
44
void
FastSimulationConstructorTool::PhysicsConstructor::ConstructParticle
() {}
45
46
void
FastSimulationConstructorTool::PhysicsConstructor::ConstructProcess
() {
47
48
if
(!
m_initializeFastSimulation
) {
49
ATH_MSG_INFO
(
"Fast simulation initialization flag is set to false. Skipping fast simulation setup."
);
50
return
;
51
}
52
53
ATH_MSG_INFO
(
"ConstructProcess for FastSimulation being run"
);
54
// Enable fast simulation processes for all particle types
55
G4FastSimulationManagerProcess* fastSimManagerProcess =
56
new
G4FastSimulationManagerProcess;
57
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
58
G4ParticleTable::G4PTblDicIterator* theParticleIterator =
59
theParticleTable->GetIterator();
60
61
theParticleIterator->reset();
62
while
((*theParticleIterator)()) {
63
G4ParticleDefinition* particle = theParticleIterator->value();
64
G4ProcessManager* pmanager = particle->GetProcessManager();
65
// TOD: magic numbers?
66
pmanager->AddProcess(fastSimManagerProcess, -1, 1, 1);
67
}
68
}
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
FastSimulationConstructorTool.h
FastSimulationConstructorTool::PhysicsConstructor::PhysicsConstructor
PhysicsConstructor(bool initializeFastSimulation, const std::string &name, MSG::Level level)
Definition
FastSimulationConstructorTool.cxx:40
FastSimulationConstructorTool::PhysicsConstructor::m_initializeFastSimulation
bool m_initializeFastSimulation
Definition
FastSimulationConstructorTool.h:41
FastSimulationConstructorTool::PhysicsConstructor::ConstructParticle
virtual void ConstructParticle() override
Definition
FastSimulationConstructorTool.cxx:44
FastSimulationConstructorTool::PhysicsConstructor::ConstructProcess
virtual void ConstructProcess() override
Definition
FastSimulationConstructorTool.cxx:46
FastSimulationConstructorTool::FastSimulationConstructorTool
FastSimulationConstructorTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition
FastSimulationConstructorTool.cxx:16
FastSimulationConstructorTool::m_initializeFastSimulation
Gaudi::Property< bool > m_initializeFastSimulation
Definition
FastSimulationConstructorTool.h:45
FastSimulationConstructorTool::GetPhysicsOption
UPPhysicsConstructor GetPhysicsOption() override
Definition
FastSimulationConstructorTool.cxx:31
FastSimulationConstructorTool::initialize
virtual StatusCode initialize() override
Initialize method.
Definition
FastSimulationConstructorTool.cxx:25
IPhysicsContructor::IPhysicsContructor
IPhysicsContructor(const std::string &name, MSG::Level level)
Standard constructor.
Definition
IPhysicsConstructor.h:44
type
Generated on
for ATLAS Offline Software by
1.17.0