File indexing completed on 2026-09-20 08:29:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include "PhysicsList.hh"
0030
0031 #include "PhysListEmLivermore.hh"
0032 #include "PhysListEmPenelope.hh"
0033 #include "PhysListEmStandard.hh"
0034 #include "PhysicsListMessenger.hh"
0035
0036 #include "G4LossTableManager.hh"
0037 #include "G4SystemOfUnits.hh"
0038 #include "G4UnitsTable.hh"
0039
0040
0041
0042 PhysicsList::PhysicsList()
0043 {
0044 G4LossTableManager::Instance();
0045 fMessenger = new PhysicsListMessenger(this);
0046
0047
0048 fEmName = G4String("standard");
0049 fEmPhysicsList = new PhysListEmStandard(fEmName);
0050
0051 SetDefaultCutValue(1. * mm);
0052
0053 SetVerboseLevel(1);
0054 }
0055
0056
0057
0058 PhysicsList::~PhysicsList()
0059 {
0060 delete fEmPhysicsList;
0061 delete fMessenger;
0062 }
0063
0064
0065
0066 void PhysicsList::AddPhysicsList(const G4String& name)
0067 {
0068 if (verboseLevel > 1) {
0069 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0070 }
0071
0072 if (name == fEmName) return;
0073
0074 if (name == "standard") {
0075 fEmName = name;
0076 delete fEmPhysicsList;
0077 fEmPhysicsList = new PhysListEmStandard(name);
0078 }
0079 else if (name == "livermore") {
0080 fEmName = name;
0081 delete fEmPhysicsList;
0082 fEmPhysicsList = new PhysListEmLivermore(name);
0083 }
0084 else if (name == "penelope") {
0085 fEmName = name;
0086 delete fEmPhysicsList;
0087 fEmPhysicsList = new PhysListEmPenelope(name);
0088 }
0089 else {
0090 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0091 << " is not defined" << G4endl;
0092 }
0093 }
0094
0095
0096
0097
0098 #include "G4ChargedGeantino.hh"
0099 #include "G4Gamma.hh"
0100 #include "G4Geantino.hh"
0101
0102
0103 #include "G4Electron.hh"
0104 #include "G4MuonMinus.hh"
0105 #include "G4MuonPlus.hh"
0106 #include "G4Positron.hh"
0107
0108
0109 #include "G4KaonMinus.hh"
0110 #include "G4KaonPlus.hh"
0111 #include "G4PionMinus.hh"
0112 #include "G4PionPlus.hh"
0113
0114
0115 #include "G4AntiNeutron.hh"
0116 #include "G4AntiProton.hh"
0117 #include "G4Neutron.hh"
0118 #include "G4Proton.hh"
0119
0120
0121 #include "G4Alpha.hh"
0122 #include "G4Deuteron.hh"
0123 #include "G4GenericIon.hh"
0124 #include "G4Triton.hh"
0125
0126 void PhysicsList::ConstructParticle()
0127 {
0128
0129 G4Geantino::GeantinoDefinition();
0130 G4ChargedGeantino::ChargedGeantinoDefinition();
0131
0132
0133 G4Gamma::GammaDefinition();
0134
0135
0136 G4Electron::ElectronDefinition();
0137 G4Positron::PositronDefinition();
0138 G4MuonPlus::MuonPlusDefinition();
0139 G4MuonMinus::MuonMinusDefinition();
0140
0141
0142 G4PionPlus::PionPlusDefinition();
0143 G4PionMinus::PionMinusDefinition();
0144 G4KaonPlus::KaonPlusDefinition();
0145 G4KaonMinus::KaonMinusDefinition();
0146
0147
0148 G4Proton::ProtonDefinition();
0149 G4AntiProton::AntiProtonDefinition();
0150 G4Neutron::NeutronDefinition();
0151 G4AntiNeutron::AntiNeutronDefinition();
0152
0153
0154 G4Deuteron::DeuteronDefinition();
0155 G4Triton::TritonDefinition();
0156 G4Alpha::AlphaDefinition();
0157 G4GenericIon::GenericIonDefinition();
0158 }
0159
0160
0161
0162 void PhysicsList::ConstructProcess()
0163 {
0164 AddTransportation();
0165 fEmPhysicsList->ConstructProcess();
0166 AddStepMax();
0167 }
0168
0169
0170
0171 #include "StepMax.hh"
0172
0173 #include "G4ProcessManager.hh"
0174
0175 void PhysicsList::AddStepMax()
0176 {
0177
0178 StepMax* stepMaxProcess = new StepMax();
0179
0180 auto particleIterator = GetParticleIterator();
0181 particleIterator->reset();
0182 while ((*particleIterator)()) {
0183 G4ParticleDefinition* particle = particleIterator->value();
0184 G4ProcessManager* pmanager = particle->GetProcessManager();
0185
0186 if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
0187 pmanager->AddDiscreteProcess(stepMaxProcess);
0188 }
0189 }
0190 }
0191
0192