File indexing completed on 2025-02-23 09:21:00
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 "PhysListEmStandard.hh"
0036 #include "PhysicsListMessenger.hh"
0037 #include "StepMax.hh"
0038
0039 #include "G4DecayPhysics.hh"
0040 #include "G4EmDNAPhysics.hh"
0041 #include "G4EmDNAPhysics_option2.hh"
0042 #include "G4EmDNAPhysics_option4.hh"
0043 #include "G4EmDNAPhysics_option6.hh"
0044 #include "G4EmLivermorePhysics.hh"
0045 #include "G4EmLowEPPhysics.hh"
0046 #include "G4EmPenelopePhysics.hh"
0047 #include "G4EmStandardPhysics.hh"
0048 #include "G4EmStandardPhysicsGS.hh"
0049 #include "G4EmStandardPhysicsSS.hh"
0050 #include "G4EmStandardPhysicsWVI.hh"
0051 #include "G4EmStandardPhysics_option1.hh"
0052 #include "G4EmStandardPhysics_option2.hh"
0053 #include "G4EmStandardPhysics_option3.hh"
0054 #include "G4EmStandardPhysics_option4.hh"
0055 #include "G4HadronElasticPhysics.hh"
0056 #include "G4ParticleDefinition.hh"
0057 #include "G4ProcessManager.hh"
0058 #include "G4SystemOfUnits.hh"
0059 #include "G4UnitsTable.hh"
0060
0061
0062
0063 #include "G4BaryonConstructor.hh"
0064 #include "G4BosonConstructor.hh"
0065 #include "G4DNAGenericIonsManager.hh"
0066 #include "G4IonConstructor.hh"
0067 #include "G4LeptonConstructor.hh"
0068 #include "G4MesonConstructor.hh"
0069 #include "G4ShortLivedConstructor.hh"
0070
0071
0072
0073 PhysicsList::PhysicsList()
0074 {
0075 fMessenger = new PhysicsListMessenger(this);
0076 SetVerboseLevel(1);
0077
0078
0079 fEmName = G4String("emstandard_opt4");
0080 fEmPhysicsList = new G4EmStandardPhysics_option4();
0081
0082
0083 fDecayPhysics = new G4DecayPhysics(1);
0084
0085 SetDefaultCutValue(1 * mm);
0086 }
0087
0088
0089
0090 PhysicsList::~PhysicsList()
0091 {
0092 delete fEmPhysicsList;
0093 delete fMessenger;
0094 }
0095
0096
0097
0098 void PhysicsList::ConstructParticle()
0099 {
0100 G4BosonConstructor pBosonConstructor;
0101 pBosonConstructor.ConstructParticle();
0102
0103 G4LeptonConstructor pLeptonConstructor;
0104 pLeptonConstructor.ConstructParticle();
0105
0106 G4MesonConstructor pMesonConstructor;
0107 pMesonConstructor.ConstructParticle();
0108
0109 G4BaryonConstructor pBaryonConstructor;
0110 pBaryonConstructor.ConstructParticle();
0111
0112 G4IonConstructor pIonConstructor;
0113 pIonConstructor.ConstructParticle();
0114
0115 G4ShortLivedConstructor sLivedConstructor;
0116 sLivedConstructor.ConstructParticle();
0117
0118
0119
0120 G4DNAGenericIonsManager* genericIonsManager;
0121 genericIonsManager = G4DNAGenericIonsManager::Instance();
0122 genericIonsManager->GetIon("alpha++");
0123 genericIonsManager->GetIon("alpha+");
0124 genericIonsManager->GetIon("helium");
0125 genericIonsManager->GetIon("hydrogen");
0126 }
0127
0128
0129
0130 void PhysicsList::ConstructProcess()
0131 {
0132 AddTransportation();
0133 fEmPhysicsList->ConstructProcess();
0134 fDecayPhysics->ConstructProcess();
0135 if (fHadPhysicsList) {
0136 fHadPhysicsList->ConstructProcess();
0137 }
0138 AddStepMax();
0139 }
0140
0141
0142
0143 void PhysicsList::AddStepMax()
0144 {
0145
0146 StepMax* stepMaxProcess = new StepMax();
0147
0148 auto particleIterator = GetParticleIterator();
0149 particleIterator->reset();
0150 while ((*particleIterator)()) {
0151 G4ParticleDefinition* particle = particleIterator->value();
0152 G4ProcessManager* pmanager = particle->GetProcessManager();
0153
0154 if (stepMaxProcess->IsApplicable(*particle)) {
0155 pmanager->AddDiscreteProcess(stepMaxProcess);
0156 }
0157 }
0158 }
0159
0160
0161
0162 void PhysicsList::AddPhysicsList(const G4String& name)
0163 {
0164 if (verboseLevel > -1) {
0165 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0166 }
0167
0168 if (name == fEmName) return;
0169
0170 if (name == "local") {
0171 fEmName = name;
0172 delete fEmPhysicsList;
0173 fEmPhysicsList = new PhysListEmStandard(name);
0174 }
0175 else if (name == "emstandard_opt0") {
0176 fEmName = name;
0177 delete fEmPhysicsList;
0178 fEmPhysicsList = new G4EmStandardPhysics();
0179 }
0180 else if (name == "emstandard_opt1") {
0181 fEmName = name;
0182 delete fEmPhysicsList;
0183 fEmPhysicsList = new G4EmStandardPhysics_option1();
0184 }
0185 else if (name == "emstandard_opt2") {
0186 fEmName = name;
0187 delete fEmPhysicsList;
0188 fEmPhysicsList = new G4EmStandardPhysics_option2();
0189 }
0190 else if (name == "emstandard_opt3") {
0191 fEmName = name;
0192 delete fEmPhysicsList;
0193 fEmPhysicsList = new G4EmStandardPhysics_option3();
0194 }
0195 else if (name == "emstandard_opt4") {
0196 fEmName = name;
0197 delete fEmPhysicsList;
0198 fEmPhysicsList = new G4EmStandardPhysics_option4();
0199 }
0200 else if (name == "emstandardSS") {
0201 fEmName = name;
0202 delete fEmPhysicsList;
0203 fEmPhysicsList = new G4EmStandardPhysicsSS();
0204 }
0205 else if (name == "emstandardWVI") {
0206 fEmName = name;
0207 delete fEmPhysicsList;
0208 fEmPhysicsList = new G4EmStandardPhysicsWVI();
0209 }
0210 else if (name == "emstandardGS") {
0211 fEmName = name;
0212 delete fEmPhysicsList;
0213 fEmPhysicsList = new G4EmStandardPhysicsGS();
0214 }
0215 else if (name == "empenelope") {
0216 fEmName = name;
0217 delete fEmPhysicsList;
0218 fEmPhysicsList = new G4EmPenelopePhysics();
0219 }
0220 else if (name == "emlowenergy") {
0221 fEmName = name;
0222 delete fEmPhysicsList;
0223 fEmPhysicsList = new G4EmLowEPPhysics();
0224 }
0225 else if (name == "emlivermore") {
0226 fEmName = name;
0227 delete fEmPhysicsList;
0228 fEmPhysicsList = new G4EmLivermorePhysics();
0229 }
0230 else if (name == "dna") {
0231 fEmName = name;
0232 delete fEmPhysicsList;
0233 fEmPhysicsList = new G4EmDNAPhysics();
0234 }
0235 else if (name == "dna_opt2") {
0236 fEmName = name;
0237 delete fEmPhysicsList;
0238 fEmPhysicsList = new G4EmDNAPhysics_option2();
0239 }
0240 else if (name == "dna_opt4") {
0241 fEmName = name;
0242 delete fEmPhysicsList;
0243 fEmPhysicsList = new G4EmDNAPhysics_option4();
0244 }
0245 else if (name == "dna_opt6") {
0246 fEmName = name;
0247 delete fEmPhysicsList;
0248 fEmPhysicsList = new G4EmDNAPhysics_option6();
0249 }
0250 else if (name == "had_elastic" && !fHadPhysicsList) {
0251 fHadPhysicsList = new G4HadronElasticPhysics();
0252 }
0253 else {
0254 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0255 << " is not defined" << G4endl;
0256 }
0257 }
0258
0259