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 // package headers
8 #include "CustomMonopole.h"
11 #include "G4mplAtlasIonisation.hh"
12 // Geant4 headers
13 #include "G4Version.hh"
14 #include "G4Transportation.hh"
15 #include "G4MuIonisation.hh"
16 #include "G4ProcessManager.hh"
17 #include "G4hIonisation.hh"
18 
19 //-----------------------------------------------------------------------------
20 // Implementation file for class : MonopolePhysicsTool
21 //
22 // 14-05-2015 Edoardo Farina
23 //-----------------------------------------------------------------------------
24 
25 #if G4VERSION_NUMBER > 1029
26 #define PARTICLEITERATOR (this->GetParticleIterator())
27 #elif G4VERSION_NUMBER > 1009
28 #define PARTICLEITERATOR aParticleIterator
29 #else
30 #define PARTICLEITERATOR theParticleIterator
31 #endif
32 
33 
34 //=============================================================================
35 // Standard constructor, initializes variables
36 //=============================================================================
38  const std::string& nam,const IInterface* parent )
39  : base_class ( type, nam , parent )
40 {
41  m_physicsOptionType = G4AtlasPhysicsOption::Type::BSMPhysics;
42 }
43 
44 //=============================================================================
45 // Destructor
46 //=============================================================================
47 
49 {
50 }
51 
52 //=============================================================================
53 // Initialize
54 //=============================================================================
56 {
57  ATH_MSG_DEBUG("MonopolePhysicsTool initialize( )");
58  this->SetPhysicsName(name());
59  return StatusCode::SUCCESS;
60 }
61 
63 {
64  return this;
65 }
66 
67 
69 {
70  ATH_MSG_DEBUG(" ConstructParticle for the Monopole being run");
72 
73 }
75 {
76 
77  PARTICLEITERATOR->reset();
78 
79  while((*PARTICLEITERATOR)())
80  {
81 
82  CustomMonopole* particle = dynamic_cast<CustomMonopole*>(PARTICLEITERATOR->value());
84  {
85  ATH_MSG_DEBUG( particle->GetParticleName() << " is Custom" );
86 
87  G4ProcessManager* pmanager = particle->GetProcessManager();
88 
89  G4double magnCharge = particle->MagneticCharge();
90 
91 
92  pmanager->RemoveProcess(0);
93  pmanager->AddProcess(new G4mplAtlasTransportation(particle), -1, 0, 0);
94 
95  if (magnCharge != 0.0){
96  pmanager->AddProcess(new G4mplAtlasIonisation(magnCharge, G4String("mplAtlasIonisation")), -1, 1, 1);
97 
98  }
99 
100 
101  if(particle->GetPDGCharge() != 0.0) {
102  pmanager->AddProcess(new G4hIonisation(), -1, 2, 2);
103  }
104  pmanager->DumpInfo();
105 
106 
107  }
108  }
109 
110  ATH_MSG_DEBUG("ConstructProcess for Monopole finished");
111 }
MonopolePhysicsTool::MonopolePhysicsTool
MonopolePhysicsTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition: MonopolePhysicsTool.cxx:37
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
MonopolePhysicsTool::initialize
virtual StatusCode initialize() override final
Initialize method.
Definition: MonopolePhysicsTool.cxx:55
CustomMonopoleFactory::isCustomMonopole
bool isCustomMonopole(CustomMonopole *particle) const
Definition: CustomMonopoleFactory.cxx:28
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:30
test_pyathena.parent
parent
Definition: test_pyathena.py:15
MonopolePhysicsTool::ConstructProcess
virtual void ConstructProcess() override final
Definition: MonopolePhysicsTool.cxx:74
G4mplAtlasTransportation.h
CustomMonopoleFactory.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MonopolePhysicsTool::GetPhysicsOption
virtual MonopolePhysicsTool * GetPhysicsOption() override final
Implements.
Definition: MonopolePhysicsTool.cxx:62
MonopolePhysicsTool
Definition: MonopolePhysicsTool.h:20
MonopolePhysicsTool::ConstructParticle
virtual void ConstructParticle() override final
Definition: MonopolePhysicsTool.cxx:68
MonopolePhysicsTool::~MonopolePhysicsTool
virtual ~MonopolePhysicsTool()
Destructor.
Definition: MonopolePhysicsTool.cxx:48
CustomMonopole.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
G4AtlasPhysicsOption::BSMPhysics
@ BSMPhysics
Definition: IPhysicsOptionTool.h:22
CustomMonopole
Definition: CustomMonopole.h:34