File indexing completed on 2026-04-01 07:51:12
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 #include "PhysicsList.hh"
0030
0031 #include "PhysListEmStandard_GS.hh"
0032 #include "PhysListEmStandard_SS.hh"
0033 #include "PhysListEmStandard_WVI.hh"
0034 #include "PhysListEmStandard_option0.hh"
0035 #include "PhysListEmStandard_option3.hh"
0036 #include "PhysListEmStandard_option4.hh"
0037 #include "PhysicsListMessenger.hh"
0038 #include "StepMax.hh"
0039
0040 #include "G4LossTableManager.hh"
0041 #include "G4ParticleDefinition.hh"
0042 #include "G4ProcessManager.hh"
0043
0044
0045 #include "G4ChargedGeantino.hh"
0046 #include "G4Gamma.hh"
0047 #include "G4Geantino.hh"
0048
0049
0050 #include "G4Electron.hh"
0051 #include "G4Positron.hh"
0052
0053
0054 #include "G4Proton.hh"
0055 #include "G4SystemOfUnits.hh"
0056
0057
0058
0059 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0060 {
0061 G4LossTableManager::Instance();
0062 fMessenger = new PhysicsListMessenger(this);
0063
0064
0065 fEmName = G4String("standard_opt3");
0066 fEmPhysicsList = new PhysListEmStandard_option3(fEmName);
0067
0068 defaultCutValue = 10 * km;
0069
0070 SetVerboseLevel(1);
0071 }
0072
0073
0074
0075 PhysicsList::~PhysicsList()
0076 {
0077 delete fEmPhysicsList;
0078 delete fMessenger;
0079 }
0080
0081
0082
0083 void PhysicsList::ConstructParticle()
0084 {
0085
0086 G4Geantino::GeantinoDefinition();
0087 G4ChargedGeantino::ChargedGeantinoDefinition();
0088
0089
0090 G4Gamma::GammaDefinition();
0091
0092
0093 G4Electron::ElectronDefinition();
0094 G4Positron::PositronDefinition();
0095
0096
0097 G4Proton::ProtonDefinition();
0098 }
0099
0100
0101
0102 void PhysicsList::ConstructProcess()
0103 {
0104 AddTransportation();
0105 fEmPhysicsList->ConstructProcess();
0106
0107 AddStepMax();
0108 }
0109
0110
0111
0112 void PhysicsList::AddStepMax()
0113 {
0114
0115 StepMax* stepMaxProcess = new StepMax();
0116
0117 auto particleIterator = GetParticleIterator();
0118 particleIterator->reset();
0119 while ((*particleIterator)()) {
0120 G4ParticleDefinition* particle = particleIterator->value();
0121 G4ProcessManager* pmanager = particle->GetProcessManager();
0122
0123 if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
0124 pmanager->AddDiscreteProcess(stepMaxProcess);
0125 }
0126 }
0127 }
0128
0129
0130
0131 void PhysicsList::AddPhysicsList(const G4String& name)
0132 {
0133 if (verboseLevel > 0) {
0134 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0135 }
0136
0137 if (name == fEmName) return;
0138
0139 if (name == "standard_opt0") {
0140 fEmName = name;
0141 delete fEmPhysicsList;
0142 fEmPhysicsList = new PhysListEmStandard_option0(name);
0143 }
0144 else if (name == "standard_opt3") {
0145 fEmName = name;
0146 delete fEmPhysicsList;
0147 fEmPhysicsList = new PhysListEmStandard_option3(name);
0148 }
0149 else if (name == "standard_opt4") {
0150 fEmName = name;
0151 delete fEmPhysicsList;
0152 fEmPhysicsList = new PhysListEmStandard_option4(name);
0153 }
0154 else if (name == "standard_GS") {
0155 fEmName = name;
0156 delete fEmPhysicsList;
0157 fEmPhysicsList = new PhysListEmStandard_GS(name);
0158 }
0159 else if (name == "standard_WVI") {
0160 fEmName = name;
0161 delete fEmPhysicsList;
0162 fEmPhysicsList = new PhysListEmStandard_WVI(name);
0163 }
0164 else if (name == "standard_SS") {
0165 fEmName = name;
0166 delete fEmPhysicsList;
0167 fEmPhysicsList = new PhysListEmStandard_SS(name);
0168 }
0169 else {
0170 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0171 << " is not defined" << G4endl;
0172 }
0173 }
0174
0175