File indexing completed on 2025-01-31 09:22:33
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
0034
0035 #include "PhysicsList.hh"
0036 #include "PhysicsListMessenger.hh"
0037
0038 #include "G4SystemOfUnits.hh"
0039 #include "StepMax.hh"
0040 #include "G4EmStandardPhysics.hh"
0041 #include "G4EmStandardPhysics_option1.hh"
0042 #include "G4EmStandardPhysics_option2.hh"
0043 #include "G4EmStandardPhysics_option3.hh"
0044 #include "G4EmStandardPhysics_option4.hh"
0045 #include "G4EmLivermorePhysics.hh"
0046 #include "G4EmPenelopePhysics.hh"
0047 #include "G4DecayPhysics.hh"
0048 #include "G4ProcessManager.hh"
0049 #include "G4Gamma.hh"
0050 #include "G4Electron.hh"
0051 #include "G4Positron.hh"
0052
0053 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0054 {
0055 fMessenger = new PhysicsListMessenger(this);
0056
0057 SetVerboseLevel(1);
0058
0059
0060 fEmName = G4String("emlivermore");
0061
0062 fEmPhysicsList = new G4EmLivermorePhysics();
0063
0064
0065 fDecPhysicsList = new G4DecayPhysics();
0066 }
0067
0068 PhysicsList::~PhysicsList()
0069 {
0070 delete fMessenger;
0071 delete fEmPhysicsList;
0072 delete fDecPhysicsList;
0073 }
0074
0075 void PhysicsList::ConstructParticle()
0076 {
0077 fDecPhysicsList->ConstructParticle();
0078 }
0079
0080 void PhysicsList::ConstructProcess()
0081 {
0082
0083 AddTransportation();
0084
0085
0086 fEmPhysicsList->ConstructProcess();
0087
0088
0089 fDecPhysicsList->ConstructProcess();
0090
0091
0092 AddStepMax();
0093
0094 }
0095
0096 void PhysicsList::AddPhysicsList(const G4String& name)
0097 {
0098 if (verboseLevel>1) {
0099 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0100 }
0101
0102 if (name == fEmName) return;
0103
0104 if (name == "emstandard_opt0") {
0105
0106 fEmName = name;
0107 delete fEmPhysicsList;
0108 fEmPhysicsList = new G4EmStandardPhysics(1);
0109
0110 } else if (name == "emstandard_opt1") {
0111
0112 fEmName = name;
0113 delete fEmPhysicsList;
0114 fEmPhysicsList = new G4EmStandardPhysics_option1();
0115
0116 } else if (name == "emstandard_opt2") {
0117
0118 fEmName = name;
0119 delete fEmPhysicsList;
0120 fEmPhysicsList = new G4EmStandardPhysics_option2();
0121
0122 } else if (name == "emstandard_opt3") {
0123
0124 fEmName = name;
0125 delete fEmPhysicsList;
0126 fEmPhysicsList = new G4EmStandardPhysics_option3();
0127
0128 } else if (name == "emstandard_opt4") {
0129
0130 fEmName = name;
0131 delete fEmPhysicsList;
0132 fEmPhysicsList = new G4EmStandardPhysics_option4();
0133
0134 } else if (name == "emlivermore") {
0135
0136 fEmName = name;
0137 delete fEmPhysicsList;
0138 fEmPhysicsList = new G4EmLivermorePhysics();
0139
0140 } else if (name == "empenelope") {
0141
0142 fEmName = name;
0143 delete fEmPhysicsList;
0144 fEmPhysicsList = new G4EmPenelopePhysics();
0145
0146 }
0147 }
0148
0149 void PhysicsList::AddStepMax()
0150 {
0151
0152 StepMax* stepMaxProcess = new StepMax(fMessenger);
0153
0154 auto particleIterator=GetParticleIterator();
0155 particleIterator->reset();
0156 while ((*particleIterator)()){
0157 G4ParticleDefinition* particle = particleIterator->value();
0158 G4ProcessManager* pmanager = particle->GetProcessManager();
0159
0160 if (stepMaxProcess->IsApplicable(*particle))
0161 {
0162 pmanager ->AddDiscreteProcess(stepMaxProcess);
0163 }
0164 }
0165 }