Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // Please cite the following paper if you use 26 // Please cite the following paper if you use this software 27 // Nucl.Instrum.Meth.B260:20-27, 2007 27 // Nucl.Instrum.Meth.B260:20-27, 2007 28 28 29 #include "PhysicsList.hh" 29 #include "PhysicsList.hh" 30 #include "G4SystemOfUnits.hh" 30 #include "G4SystemOfUnits.hh" 31 31 32 //....oooOO0OOooo........oooOO0OOooo........oo 32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 33 33 34 PhysicsList::PhysicsList(): G4VUserPhysicsLis 34 PhysicsList::PhysicsList(): G4VUserPhysicsList() 35 { 35 { 36 defaultCutValue = 1*micrometer; 36 defaultCutValue = 1*micrometer; 37 fCutForGamma = defaultCutValue; 37 fCutForGamma = defaultCutValue; 38 fCutForElectron = defaultCutValue; 38 fCutForElectron = defaultCutValue; 39 fCutForPositron = defaultCutValue; 39 fCutForPositron = defaultCutValue; 40 fCutForProton = defaultCutValue; 40 fCutForProton = defaultCutValue; 41 41 42 SetVerboseLevel(1); 42 SetVerboseLevel(1); 43 } 43 } 44 44 45 //....oooOO0OOooo........oooOO0OOooo........oo 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 46 46 47 PhysicsList::~PhysicsList() 47 PhysicsList::~PhysicsList() 48 {} 48 {} 49 49 50 //....oooOO0OOooo........oooOO0OOooo........oo 50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 51 51 52 void PhysicsList::ConstructParticle() 52 void PhysicsList::ConstructParticle() 53 { 53 { 54 ConstructBosons(); 54 ConstructBosons(); 55 ConstructLeptons(); 55 ConstructLeptons(); 56 ConstructBarions(); 56 ConstructBarions(); 57 } 57 } 58 58 59 //....oooOO0OOooo........oooOO0OOooo........oo 59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 60 60 61 void PhysicsList::ConstructBosons() 61 void PhysicsList::ConstructBosons() 62 { 62 { 63 // gamma 63 // gamma 64 G4Gamma::GammaDefinition(); 64 G4Gamma::GammaDefinition(); 65 65 66 // optical photon 66 // optical photon 67 G4OpticalPhoton::OpticalPhotonDefinition(); 67 G4OpticalPhoton::OpticalPhotonDefinition(); 68 } 68 } 69 //....oooOO0OOooo........oooOO0OOooo........o 69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 70 70 71 void PhysicsList::ConstructLeptons() 71 void PhysicsList::ConstructLeptons() 72 { 72 { 73 // leptons 73 // leptons 74 G4Electron::ElectronDefinition(); 74 G4Electron::ElectronDefinition(); 75 G4Positron::PositronDefinition(); 75 G4Positron::PositronDefinition(); 76 } 76 } 77 77 78 //....oooOO0OOooo........oooOO0OOooo........oo 78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 79 79 80 void PhysicsList::ConstructBarions() 80 void PhysicsList::ConstructBarions() 81 { 81 { 82 // barions 82 // barions 83 G4Proton::ProtonDefinition(); 83 G4Proton::ProtonDefinition(); 84 G4AntiProton::AntiProtonDefinition(); 84 G4AntiProton::AntiProtonDefinition(); 85 G4GenericIon::GenericIonDefinition(); 85 G4GenericIon::GenericIonDefinition(); 86 } 86 } 87 87 88 //....oooOO0OOooo........oooOO0OOooo........oo 88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 89 89 90 void PhysicsList::ConstructProcess() 90 void PhysicsList::ConstructProcess() 91 { 91 { 92 AddTransportation(); 92 AddTransportation(); 93 ConstructEM(); 93 ConstructEM(); 94 ConstructGeneral(); 94 ConstructGeneral(); 95 } 95 } 96 96 97 //....oooOO0OOooo........oooOO0OOooo........oo 97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 98 98 99 #include "G4PhotoElectricEffect.hh" 99 #include "G4PhotoElectricEffect.hh" 100 #include "G4ComptonScattering.hh" 100 #include "G4ComptonScattering.hh" 101 #include "G4GammaConversion.hh" 101 #include "G4GammaConversion.hh" 102 102 103 #include "G4eMultipleScattering.hh" 103 #include "G4eMultipleScattering.hh" 104 #include "G4eIonisation.hh" 104 #include "G4eIonisation.hh" 105 #include "G4eBremsstrahlung.hh" 105 #include "G4eBremsstrahlung.hh" 106 #include "G4eplusAnnihilation.hh" 106 #include "G4eplusAnnihilation.hh" 107 107 108 #include "G4MuMultipleScattering.hh" 108 #include "G4MuMultipleScattering.hh" 109 #include "G4WentzelVIModel.hh" 109 #include "G4WentzelVIModel.hh" 110 110 111 #include "G4MuIonisation.hh" 111 #include "G4MuIonisation.hh" 112 #include "G4MuBremsstrahlung.hh" 112 #include "G4MuBremsstrahlung.hh" 113 #include "G4MuPairProduction.hh" 113 #include "G4MuPairProduction.hh" 114 #include "G4CoulombScattering.hh" 114 #include "G4CoulombScattering.hh" 115 115 116 #include "G4hMultipleScattering.hh" 116 #include "G4hMultipleScattering.hh" 117 #include "G4ionIonisation.hh" 117 #include "G4ionIonisation.hh" 118 #include "G4hIonisation.hh" 118 #include "G4hIonisation.hh" 119 #include "G4hBremsstrahlung.hh" 119 #include "G4hBremsstrahlung.hh" 120 #include "G4hPairProduction.hh" 120 #include "G4hPairProduction.hh" 121 121 122 #include "G4StepLimiter.hh" 122 #include "G4StepLimiter.hh" 123 123 124 //....oooOO0OOooo........oooOO0OOooo........oo 124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 125 125 126 void PhysicsList::ConstructEM() 126 void PhysicsList::ConstructEM() 127 { 127 { 128 128 129 G4PhysicsListHelper* ph = G4PhysicsListHelpe 129 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper(); 130 130 131 // ******************************************* 131 // **************************************************************** 132 // Identical to G4EmStandardPhysics but added 132 // Identical to G4EmStandardPhysics but added G4StepLimiter process 133 // ******************************************* 133 // **************************************************************** 134 134 135 135 136 auto particleIterator=GetParticleIterator(); 136 auto particleIterator=GetParticleIterator(); 137 particleIterator->reset(); 137 particleIterator->reset(); 138 138 139 while( (*particleIterator)() ){ 139 while( (*particleIterator)() ){ 140 140 141 G4ParticleDefinition* particle = particleI 141 G4ParticleDefinition* particle = particleIterator->value(); 142 142 143 G4String particleName = particle->GetParti 143 G4String particleName = particle->GetParticleName(); 144 144 145 if (particleName == "gamma") { 145 if (particleName == "gamma") { 146 146 147 ph->RegisterProcess(new G4PhotoElectricE 147 ph->RegisterProcess(new G4PhotoElectricEffect(), particle); 148 ph->RegisterProcess(new G4ComptonScatter 148 ph->RegisterProcess(new G4ComptonScattering(), particle); 149 ph->RegisterProcess(new G4GammaConversio 149 ph->RegisterProcess(new G4GammaConversion(), particle); 150 150 151 } else if (particleName == "e-") { 151 } else if (particleName == "e-") { 152 152 153 ph->RegisterProcess(new G4eMultipleScatt 153 ph->RegisterProcess(new G4eMultipleScattering(), particle); 154 ph->RegisterProcess(new G4eIonisation(), 154 ph->RegisterProcess(new G4eIonisation(), particle); 155 ph->RegisterProcess(new G4eBremsstrahlun 155 ph->RegisterProcess(new G4eBremsstrahlung(), particle); 156 156 157 } else if (particleName == "e+") { 157 } else if (particleName == "e+") { 158 158 159 ph->RegisterProcess(new G4eMultipleScatt 159 ph->RegisterProcess(new G4eMultipleScattering(), particle); 160 ph->RegisterProcess(new G4eIonisation(), 160 ph->RegisterProcess(new G4eIonisation(), particle); 161 ph->RegisterProcess(new G4eBremsstrahlun 161 ph->RegisterProcess(new G4eBremsstrahlung(), particle); 162 ph->RegisterProcess(new G4eplusAnnihilat 162 ph->RegisterProcess(new G4eplusAnnihilation(), particle); 163 163 164 } else if( particleName == "mu+" || 164 } else if( particleName == "mu+" || 165 particleName == "mu-" ) { 165 particleName == "mu-" ) { 166 166 167 G4MuMultipleScattering* msc = new G4MuMu 167 G4MuMultipleScattering* msc = new G4MuMultipleScattering(); 168 msc->AddEmModel(0, new G4WentzelVIModel( 168 msc->AddEmModel(0, new G4WentzelVIModel()); 169 169 170 ph->RegisterProcess(msc, particle); 170 ph->RegisterProcess(msc, particle); 171 ph->RegisterProcess(new G4MuIonisation() 171 ph->RegisterProcess(new G4MuIonisation(), particle); 172 ph->RegisterProcess(new G4MuBremsstrahlu 172 ph->RegisterProcess(new G4MuBremsstrahlung(), particle); 173 ph->RegisterProcess(new G4MuPairProducti 173 ph->RegisterProcess(new G4MuPairProduction(), particle); 174 ph->RegisterProcess(new G4CoulombScatter 174 ph->RegisterProcess(new G4CoulombScattering(), particle); 175 175 176 } else if (particleName == "alpha" || 176 } else if (particleName == "alpha" || 177 particleName == "He3") { 177 particleName == "He3") { 178 178 179 ph->RegisterProcess(new G4hMultipleScatt 179 ph->RegisterProcess(new G4hMultipleScattering(), particle); 180 ph->RegisterProcess(new G4ionIonisation( 180 ph->RegisterProcess(new G4ionIonisation(), particle); 181 181 182 } else if (particleName == "GenericIon") { 182 } else if (particleName == "GenericIon") { 183 183 184 ph->RegisterProcess(new G4hMultipleScatt 184 ph->RegisterProcess(new G4hMultipleScattering(), particle); 185 ph->RegisterProcess(new G4ionIonisation( 185 ph->RegisterProcess(new G4ionIonisation(), particle); 186 186 187 } else if (particleName == "proton") { 187 } else if (particleName == "proton") { 188 ph->RegisterProcess(new G4hMultipleScatt 188 ph->RegisterProcess(new G4hMultipleScattering(), particle); 189 ph->RegisterProcess(new G4hIonisation(), 189 ph->RegisterProcess(new G4hIonisation(), particle); 190 ph->RegisterProcess(new G4hBremsstrahlun 190 ph->RegisterProcess(new G4hBremsstrahlung(), particle); 191 ph->RegisterProcess(new G4hPairProductio 191 ph->RegisterProcess(new G4hPairProduction(), particle); 192 192 193 ph->RegisterProcess(new G4StepLimiter(), 193 ph->RegisterProcess(new G4StepLimiter(), particle); 194 194 195 } 195 } 196 } 196 } 197 } 197 } 198 198 199 //....oooOO0OOooo........oooOO0OOooo........oo 199 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 200 200 201 void PhysicsList::ConstructGeneral() 201 void PhysicsList::ConstructGeneral() 202 { } 202 { } 203 203 204 //....oooOO0OOooo........oooOO0OOooo........oo 204 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 205 205 206 void PhysicsList::SetCuts() 206 void PhysicsList::SetCuts() 207 { 207 { 208 if (verboseLevel >0){ 208 if (verboseLevel >0){ 209 G4cout << "PhysicsList::SetCuts:"; 209 G4cout << "PhysicsList::SetCuts:"; 210 G4cout << "CutLength : " << G4BestUnit(def 210 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl; 211 } 211 } 212 212 213 SetCutValue(fCutForGamma, "gamma"); 213 SetCutValue(fCutForGamma, "gamma"); 214 SetCutValue(fCutForElectron, "e-"); 214 SetCutValue(fCutForElectron, "e-"); 215 SetCutValue(fCutForPositron, "e+"); 215 SetCutValue(fCutForPositron, "e+"); 216 SetCutValue(fCutForProton, "proton"); 216 SetCutValue(fCutForProton, "proton"); 217 SetCutValue(fCutForProton, "anti_proton"); 217 SetCutValue(fCutForProton, "anti_proton"); 218 218 219 if (verboseLevel>0) DumpCutValuesTable(); 219 if (verboseLevel>0) DumpCutValuesTable(); 220 } 220 } 221 221 222 //....oooOO0OOooo........oooOO0OOooo........oo 222 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 223 223 224 void PhysicsList::SetGammaCut(G4double val) 224 void PhysicsList::SetGammaCut(G4double val) 225 { 225 { 226 fCutForGamma = val; 226 fCutForGamma = val; 227 } 227 } 228 228 229 //....oooOO0OOooo........oooOO0OOooo........oo 229 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 230 230 231 void PhysicsList::SetElectronCut(G4double val) 231 void PhysicsList::SetElectronCut(G4double val) 232 { 232 { 233 fCutForElectron = val; 233 fCutForElectron = val; 234 } 234 } 235 235 236 //....oooOO0OOooo........oooOO0OOooo........oo 236 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 237 237 238 void PhysicsList::SetPositronCut(G4double val) 238 void PhysicsList::SetPositronCut(G4double val) 239 { 239 { 240 fCutForPositron = val; 240 fCutForPositron = val; 241 } 241 } 242 242 243 //....oooOO0OOooo........oooOO0OOooo........oo 243 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 244 244 245 void PhysicsList::SetProtonCut(G4double val) 245 void PhysicsList::SetProtonCut(G4double val) 246 { 246 { 247 fCutForProton = val; 247 fCutForProton = val; 248 } 248 } 249 249