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