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