ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Extensions
Monopole
src
MonopolePhysicsTool.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
// class header
6
#include "
MonopolePhysicsTool.h
"
7
8
#include <memory>
9
// package headers
10
#include "
CustomMonopole.h
"
11
#include "
CustomMonopoleFactory.h
"
12
#include "
G4mplAtlasTransportation.h
"
13
#include "G4mplAtlasIonisation.hh"
14
// Geant4 headers
15
#include "G4Version.hh"
16
#include "G4Transportation.hh"
17
#include "G4MuIonisation.hh"
18
#include "G4ProcessManager.hh"
19
#include "G4hIonisation.hh"
20
21
//-----------------------------------------------------------------------------
22
// Implementation file for class : MonopolePhysicsTool
23
//
24
// 14-05-2015 Edoardo Farina
25
//-----------------------------------------------------------------------------
26
27
#if G4VERSION_NUMBER > 1029
28
#define PARTICLEITERATOR (this->GetParticleIterator())
29
#elif G4VERSION_NUMBER > 1009
30
#define PARTICLEITERATOR aParticleIterator
31
#else
32
#define PARTICLEITERATOR theParticleIterator
33
#endif
34
35
36
//=============================================================================
37
// Standard constructor, initializes variables
38
//=============================================================================
39
MonopolePhysicsTool::MonopolePhysicsTool
(
const
std::string&
type
,
40
const
std::string& nam,
const
IInterface* parent )
41
: base_class (
type
, nam , parent )
42
{
43
m_physicsOptionType = G4AtlasPhysicsOption::Type::BSMPhysics;
44
}
45
46
//=============================================================================
47
// Destructor
48
//=============================================================================
49
50
MonopolePhysicsTool::~MonopolePhysicsTool
()
51
{
52
}
53
54
//=============================================================================
55
// Initialize
56
//=============================================================================
57
StatusCode
MonopolePhysicsTool::initialize
( )
58
{
59
ATH_MSG_DEBUG
(
"MonopolePhysicsTool initialize( )"
);
60
return
StatusCode::SUCCESS;
61
}
62
63
auto
MonopolePhysicsTool::GetPhysicsOption
() -> UPPhysicsConstructor {
64
return
std::make_unique<MonopolePhysicsTool::PhysicsConstructor>(name(),
65
msgLevel());
66
}
67
68
void
MonopolePhysicsTool::PhysicsConstructor::ConstructParticle
() {
69
ATH_MSG_DEBUG
(
" ConstructParticle for the Monopole being run"
);
70
CustomMonopoleFactory::instance
();
71
}
72
void
MonopolePhysicsTool::PhysicsConstructor::ConstructProcess
() {
73
74
PARTICLEITERATOR
->reset();
75
76
while
((*
PARTICLEITERATOR
)())
77
{
78
79
CustomMonopole
* particle =
dynamic_cast<
CustomMonopole
*
>
(
PARTICLEITERATOR
->value());
80
if
(
CustomMonopoleFactory::instance
().isCustomMonopole(particle))
81
{
82
ATH_MSG_DEBUG
( particle->GetParticleName() <<
" is Custom"
);
83
84
G4ProcessManager* pmanager = particle->GetProcessManager();
85
86
G4double magnCharge = particle->MagneticCharge();
87
88
89
pmanager->RemoveProcess(0);
90
pmanager->AddProcess(
new
G4mplAtlasTransportation
(particle), -1, 0, 0);
91
92
if
(magnCharge != 0.0){
93
pmanager->AddProcess(
new
G4mplAtlasIonisation(magnCharge, G4String(
"mplAtlasIonisation"
)), -1, 1, 1);
94
95
}
96
97
98
else
if
(particle->GetPDGCharge() != 0.0) {
// don't apply process for dyons, electric ionisation is applied in G4mplAtlasIonisationWithDeltaModel.cxx
99
pmanager->AddProcess(
new
G4hIonisation(), -1, 2, 2);
100
}
101
pmanager->DumpInfo();
102
103
104
}
105
}
106
107
ATH_MSG_DEBUG
(
"ConstructProcess for Monopole finished"
);
108
}
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CustomMonopoleFactory.h
CustomMonopole.h
G4mplAtlasTransportation.h
PARTICLEITERATOR
#define PARTICLEITERATOR
Definition
LucidPhysicsTool.cxx:25
MonopolePhysicsTool.h
CustomMonopoleFactory::instance
static const CustomMonopoleFactory & instance()
Definition
CustomMonopoleFactory.cxx:22
CustomMonopole
Definition
CustomMonopole.h:34
G4mplAtlasTransportation
Definition
G4mplAtlasTransportation.h:72
MonopolePhysicsTool::PhysicsConstructor::ConstructParticle
virtual void ConstructParticle() override
Definition
MonopolePhysicsTool.cxx:68
MonopolePhysicsTool::PhysicsConstructor::ConstructProcess
virtual void ConstructProcess() override
Definition
MonopolePhysicsTool.cxx:72
MonopolePhysicsTool::MonopolePhysicsTool
MonopolePhysicsTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition
MonopolePhysicsTool.cxx:39
MonopolePhysicsTool::initialize
virtual StatusCode initialize() override final
Initialize method.
Definition
MonopolePhysicsTool.cxx:57
MonopolePhysicsTool::~MonopolePhysicsTool
virtual ~MonopolePhysicsTool()
Destructor.
Definition
MonopolePhysicsTool.cxx:50
MonopolePhysicsTool::GetPhysicsOption
virtual UPPhysicsConstructor GetPhysicsOption() override final
Implements.
Definition
MonopolePhysicsTool.cxx:63
type
Generated on
for ATLAS Offline Software by
1.17.0