File indexing completed on 2025-02-23 09:20:54
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
0037 #include "G4ComptonScattering.hh"
0038 #include "G4DecayPhysics.hh"
0039 #include "G4GammaConversion.hh"
0040 #include "G4MuBremsstrahlung.hh"
0041 #include "G4MuIonisation.hh"
0042 #include "G4MuMultipleScattering.hh"
0043 #include "G4MuPairProduction.hh"
0044 #include "G4ParticleDefinition.hh"
0045 #include "G4ParticleTable.hh"
0046 #include "G4ParticleTypes.hh"
0047 #include "G4PhotoElectricEffect.hh"
0048 #include "G4ProcessManager.hh"
0049 #include "G4ProcessTable.hh"
0050 #include "G4RayleighScattering.hh"
0051 #include "G4StepLimiter.hh"
0052 #include "G4SynchrotronRadiation.hh"
0053 #include "G4SynchrotronRadiationInMat.hh"
0054 #include "G4SystemOfUnits.hh"
0055 #include "G4XrayReflection.hh"
0056 #include "G4eBremsstrahlung.hh"
0057 #include "G4eIonisation.hh"
0058 #include "G4eMultipleScattering.hh"
0059 #include "G4eplusAnnihilation.hh"
0060 #include "G4hBremsstrahlung.hh"
0061 #include "G4hIonisation.hh"
0062 #include "G4hMultipleScattering.hh"
0063 #include "G4hPairProduction.hh"
0064
0065
0066
0067 PhysicsList::PhysicsList() : G4VUserPhysicsList(), fMess(0)
0068 {
0069 SetDefaultCutValue(1. * km);
0070
0071 fSRType = true;
0072 fMess = new PhysicsListMessenger(this);
0073 fDecayPhysics = new G4DecayPhysics();
0074 }
0075
0076
0077
0078 void PhysicsList::ConstructParticle()
0079 {
0080 fDecayPhysics->ConstructParticle();
0081 }
0082
0083
0084
0085 void PhysicsList::ConstructProcess()
0086 {
0087 AddTransportation();
0088 ConstructEM();
0089 fDecayPhysics->ConstructProcess();
0090 }
0091
0092
0093
0094 void PhysicsList::ConstructEM()
0095 {
0096 auto particleIterator = GetParticleIterator();
0097 particleIterator->reset();
0098 auto fSync = new G4SynchrotronRadiation();
0099 while ((*particleIterator)()) {
0100 G4ParticleDefinition* particle = particleIterator->value();
0101 G4ProcessManager* pmanager = particle->GetProcessManager();
0102 G4String particleName = particle->GetParticleName();
0103
0104 if (particleName == "gamma") {
0105
0106 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
0107 pmanager->AddDiscreteProcess(new G4ComptonScattering);
0108 pmanager->AddDiscreteProcess(new G4GammaConversion);
0109 pmanager->AddDiscreteProcess(new G4RayleighScattering);
0110 pmanager->AddDiscreteProcess(new G4XrayReflection);
0111 }
0112 else if (particleName == "e-") {
0113
0114 pmanager->AddProcess(new G4eMultipleScattering, -1, 1, -1);
0115 pmanager->AddProcess(new G4eIonisation, -1, 2, 1);
0116 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 2);
0117 if (fSRType) {
0118 pmanager->AddProcess(fSync, -1, -1, 3);
0119 }
0120 else {
0121 pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1, -1, 3);
0122 }
0123 pmanager->AddProcess(new G4StepLimiter, -1, -1, 4);
0124 }
0125 else if (particleName == "e+") {
0126
0127 pmanager->AddProcess(new G4eMultipleScattering, -1, 1, -1);
0128 pmanager->AddProcess(new G4eIonisation, -1, 2, 1);
0129 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 2);
0130 pmanager->AddProcess(new G4eplusAnnihilation, 0, -1, 3);
0131 if (fSRType) {
0132 pmanager->AddProcess(fSync, -1, -1, 4);
0133 }
0134 else {
0135 pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1, -1, 4);
0136 }
0137 pmanager->AddProcess(new G4StepLimiter, -1, -1, 5);
0138 }
0139 else if (particleName == "mu+" || particleName == "mu-") {
0140
0141 pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, -1);
0142 pmanager->AddProcess(new G4MuIonisation, -1, 2, 1);
0143 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 2);
0144 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 3);
0145 pmanager->AddProcess(fSync, -1, -1, 4);
0146 pmanager->AddProcess(new G4StepLimiter, -1, -1, 5);
0147 }
0148 else if (particleName == "proton") {
0149
0150 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, -1);
0151 pmanager->AddProcess(new G4hIonisation, -1, 2, 1);
0152 pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 2);
0153 pmanager->AddProcess(new G4hPairProduction, -1, 4, 3);
0154 pmanager->AddProcess(fSync, -1, -1, 4);
0155 pmanager->AddProcess(new G4StepLimiter, -1, -1, 5);
0156 }
0157 else if (particle->GetPDGCharge() != 0.0 && !particle->IsShortLived()) {
0158 pmanager->AddProcess(fSync, -1, -1, 1);
0159 }
0160 }
0161 }
0162
0163
0164
0165 void PhysicsList::SetXrayReflectionRoughness(G4double SurfaceRoughness)
0166 {
0167 G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
0168 G4XrayReflection* XrayReflectionProcess =
0169 (G4XrayReflection*)theProcessTable->FindProcess("XrayReflection", "gamma");
0170 if (XrayReflectionProcess)
0171 XrayReflectionProcess->SetSurfaceRoughness(SurfaceRoughness);
0172 else
0173 G4cout << "Warning. No process XrayReflection found, "
0174 "SetXrayReflectionRoughness ignored"
0175 << G4endl;
0176 }
0177
0178