File indexing completed on 2025-02-23 09:20:21
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 #include "PhysicsListMessenger.hh"
0035 #include "StepMax.hh"
0036
0037 #include <G4EmStandardPhysics.hh>
0038 #include <G4eBremsstrahlung.hh>
0039
0040 #include <G4DecayPhysics.hh>
0041 #include <G4ProductionCutsTable.hh>
0042 #include <G4SystemOfUnits.hh>
0043
0044 #include "G4SystemOfUnits.hh"
0045 #include "G4VPhysicsConstructor.hh"
0046
0047
0048 #include "G4EmStandardPhysics_option4.hh"
0049 #include "G4EmStandardPhysics_option3.hh"
0050 #include "G4EmLivermorePhysics.hh"
0051 #include "G4EmPenelopePhysics.hh"
0052 #include "G4DecayPhysics.hh"
0053 #include "G4HadronElasticPhysics.hh"
0054 #include "G4HadronInelasticQBBC.hh"
0055 #include "G4IonBinaryCascadePhysics.hh"
0056 #include "G4Decay.hh"
0057
0058 #include "G4UnitsTable.hh"
0059 #include "G4ProcessManager.hh"
0060
0061
0062 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0063 {
0064 defaultCutValue = 1.*mm;
0065 helIsRegistered = false;
0066 bicIsRegistered = false;
0067 biciIsRegistered = false;
0068 locIonIonInelasticIsRegistered = false;
0069
0070 stepMaxProcess = nullptr;
0071
0072 pMessenger = new PhysicsListMessenger(this);
0073
0074 SetVerboseLevel(1);
0075
0076
0077 emPhysicsList = new G4EmStandardPhysics_option3(1);
0078 emName = G4String("emstandard_opt3");
0079
0080
0081
0082
0083
0084 decPhysicsList = new G4DecayPhysics();
0085 }
0086
0087 void PhysicsList::SetCuts()
0088 {
0089 G4VUserPhysicsList::SetVerboseLevel(2);
0090 G4VUserPhysicsList::SetCuts();
0091 }
0092
0093
0094 PhysicsList::~PhysicsList()
0095 {
0096 delete pMessenger;
0097 delete emPhysicsList;
0098 delete decPhysicsList;
0099 for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];}
0100 }
0101
0102 void PhysicsList::ConstructParticle()
0103 {
0104 decPhysicsList->ConstructParticle();
0105 }
0106
0107 void PhysicsList::ConstructProcess()
0108 {
0109
0110 AddTransportation();
0111
0112
0113 emPhysicsList->ConstructProcess();
0114
0115
0116 decPhysicsList->ConstructProcess();
0117
0118
0119 for(size_t i=0; i<hadronPhys.size(); i++)
0120 {
0121 hadronPhys[i]->ConstructProcess();
0122 }
0123
0124
0125 AddStepMax();
0126 }
0127
0128 void PhysicsList::AddPhysicsList(const G4String& name)
0129 {
0130 if (verboseLevel>1)
0131 {
0132 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0133 }
0134 if (name == emName) return;
0135
0136
0137 if (name == "standard_opt3")
0138 {
0139 emName = name;
0140 delete emPhysicsList;
0141 emPhysicsList = new G4EmStandardPhysics_option3();
0142 G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: "
0143 << "G4EmStandardPhysics_option3" << G4endl;
0144 }
0145 else if (name == "standard_opt4")
0146 {
0147 emName = name;
0148 delete emPhysicsList;
0149 emPhysicsList = new G4EmStandardPhysics_option4();
0150 G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: "
0151 << "G4EmStandardPhysics_option4" << G4endl;
0152 }
0153 else if (name == "LowE_Livermore")
0154 {
0155 emName = name;
0156 delete emPhysicsList;
0157 emPhysicsList = new G4EmLivermorePhysics();
0158 G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: "
0159 << "G4EmLivermorePhysics" << G4endl;
0160 }
0161 else if (name == "LowE_Penelope")
0162 {
0163 emName = name;
0164 delete emPhysicsList;
0165 emPhysicsList = new G4EmPenelopePhysics();
0166 G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: "
0167 << "G4EmLivermorePhysics" << G4endl;
0168
0169
0170 }
0171 else if (name == "elastic" && !helIsRegistered)
0172 {
0173
0174 hadronPhys.push_back( new G4HadronElasticPhysics());
0175 helIsRegistered = true;
0176 G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: "
0177 << "G4HadronElasticPhysics()" << G4endl;
0178 }
0179 else if (name == "binary" && !bicIsRegistered)
0180 {
0181 hadronPhys.push_back(new G4HadronInelasticQBBC());
0182 bicIsRegistered = true;
0183 G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: "
0184 << "G4HadronInelasticQBBC()" << G4endl;
0185 }
0186 else if (name == "binary_ion" && !biciIsRegistered)
0187 {
0188 hadronPhys.push_back(new G4IonBinaryCascadePhysics());
0189 biciIsRegistered = true;
0190 }
0191 else
0192 {
0193 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0194 << " is not defined"
0195 << G4endl;
0196 }
0197 }
0198
0199 void PhysicsList::AddStepMax()
0200 {
0201
0202 stepMaxProcess = new StepMax();
0203
0204 auto particleIterator=GetParticleIterator();
0205 particleIterator->reset();
0206 while ((*particleIterator)())
0207 {
0208 G4ParticleDefinition* particle = particleIterator->value();
0209 G4ProcessManager* pmanager = particle->GetProcessManager();
0210
0211 if (stepMaxProcess->IsApplicable(*particle) && pmanager)
0212 {
0213 pmanager ->AddDiscreteProcess(stepMaxProcess);
0214 }
0215 }
0216 }