ATLAS Offline Software
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"
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 
51 {
52 }
53 
54 //=============================================================================
55 // Initialize
56 //=============================================================================
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 
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());
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  if(particle->GetPDGCharge() != 0.0 && magnCharge == 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 }
MonopolePhysicsTool::MonopolePhysicsTool
MonopolePhysicsTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition: MonopolePhysicsTool.cxx:39
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:79
MonopolePhysicsTool::initialize
virtual StatusCode initialize() override final
Initialize method.
Definition: MonopolePhysicsTool.cxx:57
CustomMonopoleFactory::isCustomMonopole
bool isCustomMonopole(CustomMonopole *particle) const
Definition: CustomMonopoleFactory.cxx:28
MonopolePhysicsTool::GetPhysicsOption
virtual UPPhysicsConstructor GetPhysicsOption() override final
Implements.
Definition: MonopolePhysicsTool.cxx:63
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
CustomMonopoleFactory::instance
static const CustomMonopoleFactory & instance()
Definition: CustomMonopoleFactory.cxx:22
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
G4mplAtlasTransportation
Definition: G4mplAtlasTransportation.h:72
MonopolePhysicsTool.h
PARTICLEITERATOR
#define PARTICLEITERATOR
Definition: MonopolePhysicsTool.cxx:32
test_pyathena.parent
parent
Definition: test_pyathena.py:15
G4mplAtlasTransportation.h
CustomMonopoleFactory.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
MonopolePhysicsTool::~MonopolePhysicsTool
virtual ~MonopolePhysicsTool()
Destructor.
Definition: MonopolePhysicsTool.cxx:50
MonopolePhysicsTool::PhysicsConstructor::ConstructParticle
virtual void ConstructParticle() override
Definition: MonopolePhysicsTool.cxx:68
CustomMonopole.h
MonopolePhysicsTool::PhysicsConstructor::ConstructProcess
virtual void ConstructProcess() override
Definition: MonopolePhysicsTool.cxx:72
G4AtlasPhysicsOption::BSMPhysics
@ BSMPhysics
Definition: IPhysicsOptionTool.h:23
CustomMonopole
Definition: CustomMonopole.h:34