File indexing completed on 2025-01-18 09:17:05
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 #include "PhysicsList.hh"
0032
0033 #include "G4DecayPhysics.hh"
0034 #include "G4EmLivermorePhysics.hh"
0035 #include "G4EmLowEPPhysics.hh"
0036 #include "G4EmPenelopePhysics.hh"
0037 #include "G4EmStandardPhysics.hh"
0038 #include "G4EmStandardPhysicsGS.hh"
0039 #include "G4EmStandardPhysicsSS.hh"
0040 #include "G4EmStandardPhysicsWVI.hh"
0041 #include "G4EmStandardPhysics_option1.hh"
0042 #include "G4EmStandardPhysics_option2.hh"
0043 #include "G4EmStandardPhysics_option3.hh"
0044 #include "G4EmStandardPhysics_option4.hh"
0045 #include "G4HadronDElasticPhysics.hh"
0046 #include "G4HadronElasticPhysics.hh"
0047 #include "G4HadronHElasticPhysics.hh"
0048 #include "G4HadronInelasticQBBC.hh"
0049 #include "G4IonPhysics.hh"
0050 #include "G4ParticleDefinition.hh"
0051 #include "G4ProcessManager.hh"
0052 #include "G4StepLimiter.hh"
0053 #include "G4SystemOfUnits.hh"
0054
0055 #include "PhysListEmStandard.hh"
0056 #include "PhysicsListMessenger.hh"
0057
0058
0059
0060 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0061 {
0062 fHelIsRegisted = false;
0063 fBicIsRegisted = false;
0064 fBiciIsRegisted = false;
0065
0066 fMessenger = new PhysicsListMessenger(this);
0067 SetVerboseLevel(1);
0068
0069
0070 fEmName = G4String("emlivermore");
0071 fEmPhysics = new G4EmLivermorePhysics();
0072
0073
0074
0075
0076 fDecayPhysics = new G4DecayPhysics(1);
0077
0078
0079 SetDefaultCutValue(0.01 * um);
0080 }
0081
0082
0083
0084 PhysicsList::~PhysicsList()
0085 {
0086 delete fMessenger;
0087 delete fEmPhysics;
0088 delete fDecayPhysics;
0089 for (size_t i = 0; i < fHadronPhysics.size(); i++) {
0090 delete fHadronPhysics[i];
0091 }
0092 }
0093
0094
0095
0096 void PhysicsList::ConstructParticle()
0097 {
0098 fDecayPhysics->ConstructParticle();
0099 }
0100
0101
0102
0103 void PhysicsList::ConstructProcess()
0104 {
0105
0106
0107 AddTransportation();
0108
0109
0110
0111 fEmPhysics->ConstructProcess();
0112
0113
0114
0115 fDecayPhysics->ConstructProcess();
0116
0117
0118 for (size_t i = 0; i < fHadronPhysics.size(); i++) {
0119 fHadronPhysics[i]->ConstructProcess();
0120 }
0121
0122
0123
0124 AddStepMax();
0125 }
0126
0127
0128
0129 void PhysicsList::AddStepMax()
0130 {
0131 auto fStepMaxProcess = new G4StepLimiter();
0132
0133 auto particleIterator = GetParticleIterator();
0134
0135 particleIterator->reset();
0136
0137 while ((*particleIterator)()) {
0138 G4ParticleDefinition* particle = particleIterator->value();
0139 G4ProcessManager* pmanager = particle->GetProcessManager();
0140
0141 if (fStepMaxProcess->IsApplicable(*particle)) {
0142 pmanager->AddDiscreteProcess(fStepMaxProcess);
0143 }
0144 }
0145 }
0146
0147
0148
0149 void PhysicsList::AddPhysicsList(const G4String& name)
0150 {
0151 if (verboseLevel > -1) {
0152 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0153 }
0154
0155 if (name == fEmName) return;
0156
0157 if (name == "local") {
0158 fEmName = name;
0159 delete fEmPhysics;
0160 fEmPhysics = new PhysListEmStandard(name);
0161 }
0162 else if (name == "emstandard_opt0") {
0163 fEmName = name;
0164 delete fEmPhysics;
0165 fEmPhysics = new G4EmStandardPhysics();
0166 }
0167 else if (name == "emstandard_opt1") {
0168 fEmName = name;
0169 delete fEmPhysics;
0170 fEmPhysics = new G4EmStandardPhysics_option1();
0171 }
0172 else if (name == "emstandard_opt2") {
0173 fEmName = name;
0174 delete fEmPhysics;
0175 fEmPhysics = new G4EmStandardPhysics_option2();
0176 }
0177 else if (name == "emstandard_opt3") {
0178 fEmName = name;
0179 delete fEmPhysics;
0180 fEmPhysics = new G4EmStandardPhysics_option3();
0181 }
0182 else if (name == "emstandard_opt4") {
0183 fEmName = name;
0184 delete fEmPhysics;
0185 fEmPhysics = new G4EmStandardPhysics_option4();
0186 }
0187 else if (name == "emstandardSS") {
0188 fEmName = name;
0189 delete fEmPhysics;
0190 fEmPhysics = new G4EmStandardPhysicsSS();
0191 }
0192 else if (name == "emstandardWVI") {
0193 fEmName = name;
0194 delete fEmPhysics;
0195 fEmPhysics = new G4EmStandardPhysicsWVI();
0196 }
0197 else if (name == "emstandardGS") {
0198 fEmName = name;
0199 delete fEmPhysics;
0200 fEmPhysics = new G4EmStandardPhysicsGS(verboseLevel);
0201 }
0202 else if (name == "empenelope") {
0203 fEmName = name;
0204 delete fEmPhysics;
0205 fEmPhysics = new G4EmPenelopePhysics();
0206 }
0207 else if (name == "emlowenergy") {
0208 fEmName = name;
0209 delete fEmPhysics;
0210 fEmPhysics = new G4EmLowEPPhysics();
0211 }
0212 else if (name == "emlivermore") {
0213 fEmName = name;
0214 delete fEmPhysics;
0215 fEmPhysics = new G4EmLivermorePhysics();
0216 }
0217 else if (name == "elastic" && !fHelIsRegisted) {
0218 fHadronPhysics.push_back(new G4HadronElasticPhysics(verboseLevel));
0219 fHelIsRegisted = true;
0220 }
0221 else if (name == "DElastic" && !fHelIsRegisted) {
0222 fHadronPhysics.push_back(new G4HadronDElasticPhysics(verboseLevel));
0223 fHelIsRegisted = true;
0224 }
0225 else if (name == "HElastic" && !fHelIsRegisted) {
0226 fHadronPhysics.push_back(new G4HadronHElasticPhysics(verboseLevel));
0227 fHelIsRegisted = true;
0228 }
0229 else if (name == "binary" && !fBicIsRegisted) {
0230 fHadronPhysics.push_back(new G4HadronInelasticQBBC(verboseLevel));
0231 fBicIsRegisted = true;
0232 }
0233 else if (name == "binary_ion" && !fBiciIsRegisted) {
0234 fHadronPhysics.push_back(new G4IonPhysics(verboseLevel));
0235 fBiciIsRegisted = true;
0236 }
0237 else {
0238 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0239 << " is not defined" << G4endl;
0240 }
0241 }
0242
0243