File indexing completed on 2025-02-23 09:22:14
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 "PhysicsListMessenger.hh"
0036 #include "StepMax.hh"
0037
0038 #include "G4Decay.hh"
0039 #include "G4EmStandardPhysics.hh"
0040 #include "G4EmStandardPhysicsGS.hh"
0041 #include "G4EmStandardPhysicsSS.hh"
0042 #include "G4EmStandardPhysicsWVI.hh"
0043 #include "G4EmStandardPhysics_option1.hh"
0044 #include "G4EmStandardPhysics_option2.hh"
0045 #include "G4EmStandardPhysics_option3.hh"
0046 #include "G4EmStandardPhysics_option4.hh"
0047 #include "G4ParticleDefinition.hh"
0048 #include "G4ProcessManager.hh"
0049 #include "G4UnitsTable.hh"
0050
0051
0052 #include "G4ChargedGeantino.hh"
0053 #include "G4Gamma.hh"
0054 #include "G4Geantino.hh"
0055 #include "G4OpticalPhoton.hh"
0056
0057
0058 #include "G4AntiNeutrinoE.hh"
0059 #include "G4AntiNeutrinoMu.hh"
0060 #include "G4Electron.hh"
0061 #include "G4MuonMinus.hh"
0062 #include "G4MuonPlus.hh"
0063 #include "G4NeutrinoE.hh"
0064 #include "G4NeutrinoMu.hh"
0065 #include "G4Positron.hh"
0066
0067
0068 #include "G4BaryonConstructor.hh"
0069 #include "G4IonConstructor.hh"
0070 #include "G4MesonConstructor.hh"
0071 #include "G4SystemOfUnits.hh"
0072
0073
0074
0075 PhysicsList::PhysicsList()
0076 : G4VModularPhysicsList(), fMessenger(0), fEmName("emstandard_opt0"), fEmPhysicsList(0)
0077 {
0078 fMessenger = new PhysicsListMessenger(this);
0079
0080
0081 fEmPhysicsList = new G4EmStandardPhysics();
0082
0083 SetDefaultCutValue(1. * mm);
0084 SetVerboseLevel(1);
0085 }
0086
0087
0088
0089 PhysicsList::~PhysicsList()
0090 {
0091 delete fEmPhysicsList;
0092 delete fMessenger;
0093 }
0094
0095
0096
0097 void PhysicsList::ConstructParticle()
0098 {
0099
0100 G4Geantino::GeantinoDefinition();
0101 G4ChargedGeantino::ChargedGeantinoDefinition();
0102
0103
0104 G4Gamma::GammaDefinition();
0105
0106
0107 G4OpticalPhoton::OpticalPhotonDefinition();
0108
0109
0110 G4Electron::ElectronDefinition();
0111 G4Positron::PositronDefinition();
0112 G4MuonPlus::MuonPlusDefinition();
0113 G4MuonMinus::MuonMinusDefinition();
0114
0115 G4NeutrinoE::NeutrinoEDefinition();
0116 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
0117 G4NeutrinoMu::NeutrinoMuDefinition();
0118 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
0119
0120
0121 G4MesonConstructor mConstructor;
0122 mConstructor.ConstructParticle();
0123
0124
0125 G4BaryonConstructor bConstructor;
0126 bConstructor.ConstructParticle();
0127
0128
0129 G4IonConstructor iConstructor;
0130 iConstructor.ConstructParticle();
0131 }
0132
0133
0134
0135 void PhysicsList::ConstructProcess()
0136 {
0137 AddTransportation();
0138 fEmPhysicsList->ConstructProcess();
0139 AddDecay();
0140 AddStepMax();
0141 }
0142
0143
0144
0145 void PhysicsList::AddDecay()
0146 {
0147
0148
0149 G4Decay* fDecayProcess = new G4Decay();
0150
0151 auto particleIterator = GetParticleIterator();
0152 particleIterator->reset();
0153 while ((*particleIterator)()) {
0154 G4ParticleDefinition* particle = particleIterator->value();
0155 G4ProcessManager* pmanager = particle->GetProcessManager();
0156
0157 if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
0158 pmanager->AddProcess(fDecayProcess);
0159
0160
0161 pmanager->SetProcessOrdering(fDecayProcess, idxPostStep);
0162 pmanager->SetProcessOrdering(fDecayProcess, idxAtRest);
0163 }
0164 }
0165 }
0166
0167
0168
0169 void PhysicsList::AddStepMax()
0170 {
0171
0172 StepMax* stepMaxProcess = new StepMax();
0173
0174 auto particleIterator = GetParticleIterator();
0175 particleIterator->reset();
0176 while ((*particleIterator)()) {
0177 G4ParticleDefinition* particle = particleIterator->value();
0178 G4ProcessManager* pmanager = particle->GetProcessManager();
0179
0180 if (stepMaxProcess->IsApplicable(*particle)) {
0181 pmanager->AddDiscreteProcess(stepMaxProcess);
0182 }
0183 }
0184 }
0185
0186
0187
0188 void PhysicsList::AddPhysicsList(const G4String& name)
0189 {
0190 if (verboseLevel > -1) {
0191 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0192 }
0193
0194 if (name == fEmName) return;
0195
0196 if (name == "emstandard_opt0") {
0197 fEmName = name;
0198 delete fEmPhysicsList;
0199 fEmPhysicsList = new G4EmStandardPhysics();
0200 }
0201 else if (name == "emstandard_opt1") {
0202 fEmName = name;
0203 delete fEmPhysicsList;
0204 fEmPhysicsList = new G4EmStandardPhysics_option1();
0205 }
0206 else if (name == "emstandard_opt2") {
0207 fEmName = name;
0208 delete fEmPhysicsList;
0209 fEmPhysicsList = new G4EmStandardPhysics_option2();
0210 }
0211 else if (name == "emstandard_opt3") {
0212 fEmName = name;
0213 delete fEmPhysicsList;
0214 fEmPhysicsList = new G4EmStandardPhysics_option3();
0215 }
0216 else if (name == "emstandard_opt4") {
0217 fEmName = name;
0218 delete fEmPhysicsList;
0219 fEmPhysicsList = new G4EmStandardPhysics_option4();
0220 }
0221 else if (name == "standardSS") {
0222 fEmName = name;
0223 delete fEmPhysicsList;
0224 fEmPhysicsList = new G4EmStandardPhysicsSS();
0225 }
0226 else if (name == "standardGS") {
0227 fEmName = name;
0228 delete fEmPhysicsList;
0229 fEmPhysicsList = new G4EmStandardPhysicsGS();
0230 }
0231 else if (name == "standardWVI") {
0232 fEmName = name;
0233 delete fEmPhysicsList;
0234 fEmPhysicsList = new G4EmStandardPhysicsWVI();
0235 }
0236 else {
0237 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0238 << " is not defined" << G4endl;
0239 }
0240 }
0241
0242