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 // In this method, static member functions should be called >> 55 // for all particles which you want to use. >> 56 // This ensures that objects of these particle types will be >> 57 // created in the program. >> 58 54 ConstructBosons(); 59 ConstructBosons(); 55 ConstructLeptons(); 60 ConstructLeptons(); 56 ConstructBarions(); 61 ConstructBarions(); 57 } 62 } 58 63 59 //....oooOO0OOooo........oooOO0OOooo........oo 64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 60 65 61 void PhysicsList::ConstructBosons() 66 void PhysicsList::ConstructBosons() 62 { 67 { >> 68 63 // gamma 69 // gamma 64 G4Gamma::GammaDefinition(); 70 G4Gamma::GammaDefinition(); 65 71 66 // optical photon 72 // optical photon 67 G4OpticalPhoton::OpticalPhotonDefinition(); 73 G4OpticalPhoton::OpticalPhotonDefinition(); 68 } 74 } 69 //....oooOO0OOooo........oooOO0OOooo........o 75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 70 76 71 void PhysicsList::ConstructLeptons() 77 void PhysicsList::ConstructLeptons() 72 { 78 { 73 // leptons 79 // leptons 74 G4Electron::ElectronDefinition(); 80 G4Electron::ElectronDefinition(); 75 G4Positron::PositronDefinition(); 81 G4Positron::PositronDefinition(); 76 } 82 } 77 83 78 //....oooOO0OOooo........oooOO0OOooo........oo 84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 79 85 80 void PhysicsList::ConstructBarions() 86 void PhysicsList::ConstructBarions() 81 { 87 { 82 // barions 88 // barions 83 G4Proton::ProtonDefinition(); 89 G4Proton::ProtonDefinition(); 84 G4AntiProton::AntiProtonDefinition(); 90 G4AntiProton::AntiProtonDefinition(); 85 G4GenericIon::GenericIonDefinition(); 91 G4GenericIon::GenericIonDefinition(); 86 } 92 } 87 93 88 //....oooOO0OOooo........oooOO0OOooo........oo 94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 89 95 90 void PhysicsList::ConstructProcess() 96 void PhysicsList::ConstructProcess() 91 { 97 { 92 AddTransportation(); 98 AddTransportation(); 93 ConstructEM(); 99 ConstructEM(); 94 ConstructGeneral(); 100 ConstructGeneral(); 95 } 101 } 96 102 97 //....oooOO0OOooo........oooOO0OOooo........oo 103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 98 104 99 #include "G4PhotoElectricEffect.hh" 105 #include "G4PhotoElectricEffect.hh" 100 #include "G4ComptonScattering.hh" 106 #include "G4ComptonScattering.hh" 101 #include "G4GammaConversion.hh" 107 #include "G4GammaConversion.hh" 102 108 103 #include "G4eMultipleScattering.hh" 109 #include "G4eMultipleScattering.hh" 104 #include "G4eIonisation.hh" 110 #include "G4eIonisation.hh" 105 #include "G4eBremsstrahlung.hh" 111 #include "G4eBremsstrahlung.hh" 106 #include "G4eplusAnnihilation.hh" 112 #include "G4eplusAnnihilation.hh" 107 113 108 #include "G4MuMultipleScattering.hh" 114 #include "G4MuMultipleScattering.hh" 109 #include "G4WentzelVIModel.hh" 115 #include "G4WentzelVIModel.hh" 110 116 111 #include "G4MuIonisation.hh" 117 #include "G4MuIonisation.hh" 112 #include "G4MuBremsstrahlung.hh" 118 #include "G4MuBremsstrahlung.hh" 113 #include "G4MuPairProduction.hh" 119 #include "G4MuPairProduction.hh" 114 #include "G4CoulombScattering.hh" 120 #include "G4CoulombScattering.hh" 115 121 116 #include "G4hMultipleScattering.hh" 122 #include "G4hMultipleScattering.hh" 117 #include "G4ionIonisation.hh" 123 #include "G4ionIonisation.hh" 118 #include "G4hIonisation.hh" 124 #include "G4hIonisation.hh" 119 #include "G4hBremsstrahlung.hh" 125 #include "G4hBremsstrahlung.hh" 120 #include "G4hPairProduction.hh" 126 #include "G4hPairProduction.hh" 121 127 122 #include "G4StepLimiter.hh" 128 #include "G4StepLimiter.hh" 123 129 124 //....oooOO0OOooo........oooOO0OOooo........oo 130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 125 131 126 void PhysicsList::ConstructEM() 132 void PhysicsList::ConstructEM() 127 { 133 { 128 134 129 G4PhysicsListHelper* ph = G4PhysicsListHelpe 135 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper(); 130 136 131 // ******************************************* 137 // **************************************************************** 132 // Identical to G4EmStandardPhysics but added 138 // Identical to G4EmStandardPhysics but added G4StepLimiter process 133 // ******************************************* 139 // **************************************************************** 134 140 135 << 136 auto particleIterator=GetParticleIterator(); 141 auto particleIterator=GetParticleIterator(); 137 particleIterator->reset(); 142 particleIterator->reset(); 138 143 139 while( (*particleIterator)() ){ 144 while( (*particleIterator)() ){ 140 145 141 G4ParticleDefinition* particle = particleI 146 G4ParticleDefinition* particle = particleIterator->value(); 142 << 143 G4String particleName = particle->GetParti 147 G4String particleName = particle->GetParticleName(); 144 148 145 if (particleName == "gamma") { 149 if (particleName == "gamma") { 146 150 147 ph->RegisterProcess(new G4PhotoElectricE 151 ph->RegisterProcess(new G4PhotoElectricEffect(), particle); 148 ph->RegisterProcess(new G4ComptonScatter 152 ph->RegisterProcess(new G4ComptonScattering(), particle); 149 ph->RegisterProcess(new G4GammaConversio 153 ph->RegisterProcess(new G4GammaConversion(), particle); 150 154 151 } else if (particleName == "e-") { 155 } else if (particleName == "e-") { 152 156 153 ph->RegisterProcess(new G4eMultipleScatt 157 ph->RegisterProcess(new G4eMultipleScattering(), particle); 154 ph->RegisterProcess(new G4eIonisation(), 158 ph->RegisterProcess(new G4eIonisation(), particle); 155 ph->RegisterProcess(new G4eBremsstrahlun 159 ph->RegisterProcess(new G4eBremsstrahlung(), particle); 156 160 157 } else if (particleName == "e+") { 161 } else if (particleName == "e+") { 158 162 159 ph->RegisterProcess(new G4eMultipleScatt 163 ph->RegisterProcess(new G4eMultipleScattering(), particle); 160 ph->RegisterProcess(new G4eIonisation(), 164 ph->RegisterProcess(new G4eIonisation(), particle); 161 ph->RegisterProcess(new G4eBremsstrahlun 165 ph->RegisterProcess(new G4eBremsstrahlung(), particle); 162 ph->RegisterProcess(new G4eplusAnnihilat 166 ph->RegisterProcess(new G4eplusAnnihilation(), particle); 163 167 164 } else if( particleName == "mu+" || 168 } else if( particleName == "mu+" || 165 particleName == "mu-" ) { 169 particleName == "mu-" ) { 166 170 167 G4MuMultipleScattering* msc = new G4MuMu 171 G4MuMultipleScattering* msc = new G4MuMultipleScattering(); 168 msc->AddEmModel(0, new G4WentzelVIModel( 172 msc->AddEmModel(0, new G4WentzelVIModel()); 169 173 170 ph->RegisterProcess(msc, particle); 174 ph->RegisterProcess(msc, particle); 171 ph->RegisterProcess(new G4MuIonisation() 175 ph->RegisterProcess(new G4MuIonisation(), particle); 172 ph->RegisterProcess(new G4MuBremsstrahlu 176 ph->RegisterProcess(new G4MuBremsstrahlung(), particle); 173 ph->RegisterProcess(new G4MuPairProducti 177 ph->RegisterProcess(new G4MuPairProduction(), particle); 174 ph->RegisterProcess(new G4CoulombScatter 178 ph->RegisterProcess(new G4CoulombScattering(), particle); 175 179 176 } else if (particleName == "alpha" || 180 } else if (particleName == "alpha" || 177 particleName == "He3") { 181 particleName == "He3") { 178 182 179 ph->RegisterProcess(new G4hMultipleScatt 183 ph->RegisterProcess(new G4hMultipleScattering(), particle); 180 ph->RegisterProcess(new G4ionIonisation( 184 ph->RegisterProcess(new G4ionIonisation(), particle); 181 185 182 } else if (particleName == "GenericIon") { 186 } else if (particleName == "GenericIon") { 183 187 184 ph->RegisterProcess(new G4hMultipleScatt 188 ph->RegisterProcess(new G4hMultipleScattering(), particle); 185 ph->RegisterProcess(new G4ionIonisation( 189 ph->RegisterProcess(new G4ionIonisation(), particle); 186 190 187 } else if (particleName == "proton") { 191 } else if (particleName == "proton") { 188 ph->RegisterProcess(new G4hMultipleScatt 192 ph->RegisterProcess(new G4hMultipleScattering(), particle); 189 ph->RegisterProcess(new G4hIonisation(), 193 ph->RegisterProcess(new G4hIonisation(), particle); 190 ph->RegisterProcess(new G4hBremsstrahlun 194 ph->RegisterProcess(new G4hBremsstrahlung(), particle); 191 ph->RegisterProcess(new G4hPairProductio 195 ph->RegisterProcess(new G4hPairProduction(), particle); 192 196 193 ph->RegisterProcess(new G4StepLimiter(), 197 ph->RegisterProcess(new G4StepLimiter(), particle); 194 198 195 } 199 } 196 } 200 } 197 } 201 } 198 202 199 //....oooOO0OOooo........oooOO0OOooo........oo 203 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 200 204 201 void PhysicsList::ConstructGeneral() 205 void PhysicsList::ConstructGeneral() 202 { } 206 { } 203 207 204 //....oooOO0OOooo........oooOO0OOooo........oo 208 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 205 209 206 void PhysicsList::SetCuts() 210 void PhysicsList::SetCuts() 207 { 211 { 208 if (verboseLevel >0){ 212 if (verboseLevel >0){ 209 G4cout << "PhysicsList::SetCuts:"; 213 G4cout << "PhysicsList::SetCuts:"; 210 G4cout << "CutLength : " << G4BestUnit(def 214 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl; 211 } 215 } 212 216 >> 217 // set cut values for gamma at first and for e- second and next for e+, >> 218 // because some processes for e+/e- need cut values for gamma 213 SetCutValue(fCutForGamma, "gamma"); 219 SetCutValue(fCutForGamma, "gamma"); 214 SetCutValue(fCutForElectron, "e-"); 220 SetCutValue(fCutForElectron, "e-"); 215 SetCutValue(fCutForPositron, "e+"); 221 SetCutValue(fCutForPositron, "e+"); >> 222 >> 223 // set cut values for proton and anti_proton before all other hadrons >> 224 // because some processes for hadrons need cut values for proton/anti_proton 216 SetCutValue(fCutForProton, "proton"); 225 SetCutValue(fCutForProton, "proton"); 217 SetCutValue(fCutForProton, "anti_proton"); 226 SetCutValue(fCutForProton, "anti_proton"); 218 227 >> 228 //SetCutValueForOthers(defaultCutValue); >> 229 219 if (verboseLevel>0) DumpCutValuesTable(); 230 if (verboseLevel>0) DumpCutValuesTable(); 220 } 231 } 221 232 222 //....oooOO0OOooo........oooOO0OOooo........oo 233 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 223 234 >> 235 void PhysicsList::SetGammaLowLimit(G4double lowcut) >> 236 { >> 237 if (verboseLevel >0){ >> 238 G4cout << "PhysicsList::SetCuts:"; >> 239 G4cout << "Gamma cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; >> 240 } >> 241 >> 242 // G4Gamma::SetEnergyRange(lowcut,1e5); >> 243 SetGELowLimit(lowcut); >> 244 } >> 245 >> 246 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 247 >> 248 void PhysicsList::SetElectronLowLimit(G4double lowcut) >> 249 { >> 250 if (verboseLevel >0){ >> 251 >> 252 G4cout << "PhysicsList::SetCuts:"; >> 253 G4cout << "Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; >> 254 } >> 255 >> 256 // G4Electron::SetEnergyRange(lowcut,1e5); >> 257 SetGELowLimit(lowcut); >> 258 } >> 259 >> 260 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 261 >> 262 void PhysicsList::SetGEPLowLimit(G4double lowcut) >> 263 { >> 264 if (verboseLevel >0){ >> 265 G4cout << "PhysicsList::SetGEPLowLimit:"; >> 266 G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; >> 267 } >> 268 >> 269 this->SetGELowLimit(lowcut); >> 270 >> 271 G4cerr << " SetGEPLowLimit : Uncertain whether setting Positron low limit " << G4endl; >> 272 } >> 273 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 274 >> 275 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 276 void PhysicsList::SetGELowLimit(G4double lowcut) >> 277 { >> 278 if (verboseLevel >0){ >> 279 G4cout << "PhysicsList::SetGELowLimit:"; >> 280 G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; >> 281 } >> 282 >> 283 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowcut,1e5); >> 284 } 224 void PhysicsList::SetGammaCut(G4double val) 285 void PhysicsList::SetGammaCut(G4double val) 225 { 286 { >> 287 ResetCuts(); 226 fCutForGamma = val; 288 fCutForGamma = val; 227 } 289 } 228 290 229 //....oooOO0OOooo........oooOO0OOooo........oo 291 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 230 292 231 void PhysicsList::SetElectronCut(G4double val) 293 void PhysicsList::SetElectronCut(G4double val) 232 { 294 { >> 295 // ResetCuts(); 233 fCutForElectron = val; 296 fCutForElectron = val; 234 } 297 } 235 298 236 //....oooOO0OOooo........oooOO0OOooo........oo 299 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 237 300 238 void PhysicsList::SetPositronCut(G4double val) 301 void PhysicsList::SetPositronCut(G4double val) 239 { 302 { >> 303 // ResetCuts(); 240 fCutForPositron = val; 304 fCutForPositron = val; 241 } 305 } 242 306 243 //....oooOO0OOooo........oooOO0OOooo........oo 307 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 244 308 245 void PhysicsList::SetProtonCut(G4double val) 309 void PhysicsList::SetProtonCut(G4double val) 246 { 310 { >> 311 //ResetCuts(); 247 fCutForProton = val; 312 fCutForProton = val; 248 } 313 } >> 314 >> 315 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 249 316