File indexing completed on 2026-09-19 08:37:22
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
0036
0037
0038
0039
0040
0041
0042
0043 #include "PhysicsList.hh"
0044
0045 #include "DetectorConstruction.hh"
0046 #include "PhysicsListMessenger.hh"
0047 #include "StepMax.hh"
0048
0049 #include "G4DecayPhysics.hh"
0050 #include "G4Electron.hh"
0051 #include "G4EmConfigurator.hh"
0052 #include "G4EmLivermorePhysics.hh"
0053 #include "G4EmLowEPPhysics.hh"
0054 #include "G4EmParameters.hh"
0055 #include "G4EmPenelopePhysics.hh"
0056 #include "G4EmStandardPhysics.hh"
0057 #include "G4EmStandardPhysicsGS.hh"
0058 #include "G4EmStandardPhysicsSS.hh"
0059 #include "G4EmStandardPhysicsWVI.hh"
0060 #include "G4EmStandardPhysics_option1.hh"
0061 #include "G4EmStandardPhysics_option2.hh"
0062 #include "G4EmStandardPhysics_option3.hh"
0063 #include "G4EmStandardPhysics_option4.hh"
0064 #include "G4Gamma.hh"
0065 #include "G4LossTableManager.hh"
0066 #include "G4PAIModel.hh"
0067 #include "G4PAIPhotModel.hh"
0068 #include "G4ParticleTable.hh"
0069 #include "G4ParticleTypes.hh"
0070 #include "G4Positron.hh"
0071 #include "G4ProcessManager.hh"
0072 #include "G4ProductionCutsTable.hh"
0073 #include "G4Proton.hh"
0074 #include "G4SystemOfUnits.hh"
0075 #include "G4UnitsTable.hh"
0076
0077
0078
0079 PhysicsList::PhysicsList(DetectorConstruction* ptr) : fDetectorConstruction(ptr)
0080 {
0081
0082
0083
0084 G4EmParameters::Instance()->SetVerbose(0);
0085
0086 SetDefaultCutValue(1 * mm);
0087
0088 fMessenger = new PhysicsListMessenger(this);
0089
0090
0091 fDecayPhysicsList = new G4DecayPhysics();
0092
0093
0094 fEmName = G4String("emstandard_opt0");
0095 fEmPhysicsList = new G4EmStandardPhysics(0);
0096
0097 SetVerboseLevel(1);
0098 }
0099
0100
0101
0102 PhysicsList::~PhysicsList()
0103 {
0104 delete fMessenger;
0105 delete fDecayPhysicsList;
0106 delete fEmPhysicsList;
0107 }
0108
0109
0110
0111 void PhysicsList::ConstructParticle()
0112 {
0113 fDecayPhysicsList->ConstructParticle();
0114 }
0115
0116
0117
0118 void PhysicsList::ConstructProcess()
0119 {
0120 AddTransportation();
0121 fEmPhysicsList->ConstructProcess();
0122 fDecayPhysicsList->ConstructProcess();
0123 AddStepMax();
0124 }
0125
0126
0127
0128 void PhysicsList::AddPhysicsList(const G4String& name)
0129 {
0130 if (verboseLevel > 1) {
0131 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0132 }
0133
0134 if (name == fEmName) {
0135 return;
0136 }
0137 else if (name == "emstandard_opt0") {
0138 fEmName = name;
0139 delete fEmPhysicsList;
0140 fEmPhysicsList = new G4EmStandardPhysics(0);
0141 }
0142 else if (name == "emstandard_opt1") {
0143 fEmName = name;
0144 delete fEmPhysicsList;
0145 fEmPhysicsList = new G4EmStandardPhysics_option1(0);
0146 }
0147 else if (name == "emstandard_opt2") {
0148 fEmName = name;
0149 delete fEmPhysicsList;
0150 fEmPhysicsList = new G4EmStandardPhysics_option2(0);
0151 }
0152 else if (name == "emstandard_opt3") {
0153 fEmName = name;
0154 delete fEmPhysicsList;
0155 fEmPhysicsList = new G4EmStandardPhysics_option3(0);
0156 }
0157 else if (name == "emstandard_opt4") {
0158 fEmName = name;
0159 delete fEmPhysicsList;
0160 fEmPhysicsList = new G4EmStandardPhysics_option4(0);
0161 }
0162 else if (name == "emstandardWVI") {
0163 fEmName = name;
0164 delete fEmPhysicsList;
0165 fEmPhysicsList = new G4EmStandardPhysicsWVI(0);
0166 }
0167 else if (name == "emstandardSS") {
0168 fEmName = name;
0169 delete fEmPhysicsList;
0170 fEmPhysicsList = new G4EmStandardPhysicsSS(0);
0171 }
0172 else if (name == "emstandardGS") {
0173 fEmName = name;
0174 delete fEmPhysicsList;
0175 fEmPhysicsList = new G4EmStandardPhysicsGS(0);
0176 }
0177 else if (name == "pai") {
0178 G4EmParameters::Instance()->AddPAIModel("all", "world", "pai");
0179 }
0180 else if (name == "pai_photon") {
0181 G4EmParameters::Instance()->AddPAIModel("all", "world", "pai_photon");
0182 }
0183 else if (name == "emlivermore") {
0184 fEmName = name;
0185 delete fEmPhysicsList;
0186 fEmPhysicsList = new G4EmLivermorePhysics(0);
0187 }
0188 else if (name == "empenelope") {
0189 fEmName = name;
0190 delete fEmPhysicsList;
0191 fEmPhysicsList = new G4EmPenelopePhysics(0);
0192 }
0193 else if (name == "emlowenergy") {
0194 fEmName = name;
0195 delete fEmPhysicsList;
0196 fEmPhysicsList = new G4EmLowEPPhysics(0);
0197 }
0198 else {
0199 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0200 << " is not defined" << G4endl;
0201 }
0202 }
0203
0204
0205
0206 void PhysicsList::AddStepMax()
0207 {
0208
0209 StepMax* stepMaxProcess = new StepMax(fDetectorConstruction);
0210
0211 auto particleIterator = GetParticleIterator();
0212 particleIterator->reset();
0213 while ((*particleIterator)()) {
0214 G4ParticleDefinition* particle = particleIterator->value();
0215 G4ProcessManager* pmanager = particle->GetProcessManager();
0216
0217 if (stepMaxProcess->IsApplicable(*particle)) {
0218 pmanager->AddDiscreteProcess(stepMaxProcess);
0219 }
0220 }
0221 }
0222
0223
0224
0225 void PhysicsList::SetCuts()
0226 {
0227 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(25. * eV, 1e5);
0228 if (verboseLevel > 0) {
0229 DumpCutValuesTable();
0230 }
0231 }
0232
0233