10#include <G4VPhysicsConstructor.hh>
13#include "CustomParticle.hh"
16#include "G4MuIonisation.hh"
17#include "G4ParticleTable.hh"
18#include "G4ProcessManager.hh"
19#include "G4Transportation.hh"
20#include "G4Version.hh"
21#include "G4hIonisation.hh"
22#include "G4hMultipleScattering.hh"
24using namespace ExtraParticles;
36 const std::string &name,
37 const IInterface *parent)
38 : base_class(
type, name, parent) {
39 m_physicsOptionType = G4AtlasPhysicsOption::Type::QS_ExtraParticles;
54 return StatusCode::SUCCESS;
61 return std::make_unique<ExtraParticlesPhysicsTool::PhysicsConstructor>(
69 ATH_MSG_DEBUG(
"ExtraParticlesPhysicsTool::ConstructParticle - start");
71 "ExtraParticlesPhysicsTool::ConstructParticle - m_extraParticlesConfig = "
75 G4ParticleTable *theParticleTable = G4ParticleTable::GetParticleTable();
79 G4String name = particle.first;
80 G4double mass = particle.second[0];
81 G4double
width = particle.second[1];
82 G4int
charge = particle.second[2];
83 G4int pdg = particle.second[3];
84 G4double lifetime = particle.second[4];
85 G4bool stable =
false;
88 if (theParticleTable->FindParticle(pdg)) {
90 << theParticleTable->FindParticle(pdg)->GetParticleName()
92 <<
") as it is already in the ParticleTable.");
98 << mass <<
" " <<
width <<
" " << lifetime);
104 ATH_MSG_DEBUG(
"ExtraParticlesPhysicsTool::ConstructParticle - end");
111 ATH_MSG_DEBUG(
"ExtraParticlesPhysicsTool::ConstructProcess - start");
113 std::vector<std::string> extraParticleNames;
115 extraParticleNames.push_back(extraParticle->GetParticleName());
117 ATH_MSG_DEBUG(
"ExtraParticlesPhysicsTool::ConstructProcess - m_extraParticleNames = " << extraParticleNames);
120 if (particle->GetPDGCharge() != 0) {
122 << particle->GetParticleName());
123 G4ProcessManager *proc = particle->GetProcessManager();
124 proc->AddProcess(
new G4hMultipleScattering, -1, 1, 1);
125 proc->AddProcess(
new G4hIonisation, -1, 2, 2);
128 ATH_MSG_DEBUG(
"ExtraParticlesPhysicsTool::ConstructProcess - end");
double charge(const T &p)
bool msgLvl(const MSG::Level lvl) const
Test the output level.
std::set< G4ParticleDefinition * > m_extraParticles
a set to hold the newly created extra particles
virtual void ConstructParticle() override
virtual void ConstructProcess() override
std::map< std::string, std::vector< double > > m_extraParticlesConfig
a set of parameters for extra particle building
ExtraParticlesPhysicsTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
virtual UPPhysicsConstructor GetPhysicsOption() override final
Implements.
virtual ~ExtraParticlesPhysicsTool()
Destructor.
std::map< std::string, std::vector< double > > m_extraParticlesConfig
a set of parameters for extra particle building
virtual StatusCode initialize() override final
Initialize method.