ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Extensions
G4ExtraProcesses
src
G4EMProcessesPhysicsTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Include files
6
7
// local
8
#include "
G4EMProcessesPhysicsTool.h
"
9
10
// Geant4 headers
11
#include "G4ParticleTable.hh"
12
#include "G4ProcessManager.hh"
13
#include "G4hIonisation.hh"
14
#include "G4hMultipleScattering.hh"
15
#include <cmath>
16
17
//-----------------------------------------------------------------------------
18
// Implementation file for class : G4EMProcessesPhysicsTool
19
//
20
// August-2020 : Miha Muskinja
21
//-----------------------------------------------------------------------------
22
23
//=============================================================================
24
// Standard constructor, initializes variables
25
//=============================================================================
26
G4EMProcessesPhysicsTool::G4EMProcessesPhysicsTool
(
const
std::string &
type
,
27
const
std::string &name,
28
const
IInterface *parent)
29
: base_class(
type
, name, parent)
30
{
31
m_physicsOptionType = G4AtlasPhysicsOption::Type::QS_ExtraProc;
32
33
declareProperty(
"ParticleList"
,
m_particleList
);
34
}
35
36
//=============================================================================
37
// Initialize
38
//=============================================================================
39
StatusCode
G4EMProcessesPhysicsTool::initialize
()
40
{
41
ATH_MSG_DEBUG
(
"initializing..."
);
42
return
StatusCode::SUCCESS;
43
}
44
45
//=============================================================================
46
// GetPhysicsOption
47
//=============================================================================
48
auto
G4EMProcessesPhysicsTool::GetPhysicsOption
() -> UPPhysicsConstructor {
49
return
std::make_unique<G4EMProcessesPhysicsTool::PhysicsConstructor>(
50
name(), msgLevel(),
m_particleList
);
51
}
52
53
//=============================================================================
54
// ConstructParticle
55
//=============================================================================
56
void
G4EMProcessesPhysicsTool::PhysicsConstructor::ConstructParticle
() {}
57
58
//=============================================================================
59
// ConstructProcess
60
//=============================================================================
61
void
G4EMProcessesPhysicsTool::PhysicsConstructor::ConstructProcess
() {
62
ATH_MSG_DEBUG
(
"G4EMProcessesPhysicsTool::ConstructProcess() - start"
);
63
ATH_MSG_DEBUG
(
"G4EMProcessesPhysicsTool::ConstructProcess() - m_particleList = "
<<
m_particleList
);
64
G4ParticleTable::G4PTblDicIterator *particleIterator = G4ParticleTable::GetParticleTable()->GetIterator();
65
particleIterator->reset();
66
67
while
((*particleIterator)())
68
{
69
G4ParticleDefinition *particle = particleIterator->value();
70
if
(std::find(
m_particleList
.begin(),
m_particleList
.end(), std::abs(particle->GetPDGEncoding())) !=
m_particleList
.end())
71
{
72
ATH_MSG_DEBUG
(
"Adding EM processes for "
73
<< particle->GetParticleName());
74
G4ProcessManager *proc = particle->GetProcessManager();
75
proc->AddProcess(
new
G4hMultipleScattering, -1, 1, 1);
76
proc->AddProcess(
new
G4hIonisation, -1, 2, 2);
77
}
78
}
// End of the particle iterator
79
ATH_MSG_DEBUG
(
"G4EMProcessesPhysicsTool::ConstructProcess() - end"
);
80
}
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
G4EMProcessesPhysicsTool.h
G4EMProcessesPhysicsTool::PhysicsConstructor::ConstructProcess
virtual void ConstructProcess() override
Definition
G4EMProcessesPhysicsTool.cxx:61
G4EMProcessesPhysicsTool::PhysicsConstructor::m_particleList
std::vector< int > m_particleList
Definition
G4EMProcessesPhysicsTool.h:46
G4EMProcessesPhysicsTool::PhysicsConstructor::ConstructParticle
virtual void ConstructParticle() override
Definition
G4EMProcessesPhysicsTool.cxx:56
G4EMProcessesPhysicsTool::m_particleList
std::vector< int > m_particleList
list of particles to apply the em processes to
Definition
G4EMProcessesPhysicsTool.h:51
G4EMProcessesPhysicsTool::G4EMProcessesPhysicsTool
G4EMProcessesPhysicsTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition
G4EMProcessesPhysicsTool.cxx:26
G4EMProcessesPhysicsTool::initialize
virtual StatusCode initialize() override final
Destructor.
Definition
G4EMProcessesPhysicsTool.cxx:39
G4EMProcessesPhysicsTool::GetPhysicsOption
virtual UPPhysicsConstructor GetPhysicsOption() override final
Implements.
Definition
G4EMProcessesPhysicsTool.cxx:48
type
Generated on
for ATLAS Offline Software by
1.17.0