ATLAS Offline Software
Loading...
Searching...
No Matches
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
7
8#include <memory>
9// package headers
10#include "CustomMonopole.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//=============================================================================
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
53
54//=============================================================================
55// Initialize
56//=============================================================================
58{
59 ATH_MSG_DEBUG("MonopolePhysicsTool initialize( )");
60 return StatusCode::SUCCESS;
61}
62
63auto MonopolePhysicsTool::GetPhysicsOption() -> UPPhysicsConstructor {
64 return std::make_unique<MonopolePhysicsTool::PhysicsConstructor>(name(),
65 msgLevel());
66}
67
69 ATH_MSG_DEBUG(" ConstructParticle for the Monopole being run");
71}
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}
#define ATH_MSG_DEBUG(x)
#define PARTICLEITERATOR
static const CustomMonopoleFactory & instance()
MonopolePhysicsTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
virtual StatusCode initialize() override final
Initialize method.
virtual ~MonopolePhysicsTool()
Destructor.
virtual UPPhysicsConstructor GetPhysicsOption() override final
Implements.