Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // This example is provided by the Geant4-DNA collaboration 27 // Any report or published results obtained using the Geant4-DNA software 28 // shall cite the following Geant4-DNA collaboration publication: 29 // Med. Phys. 37 (2010) 4692-4708 30 // The Geant4-DNA web site is available at http://geant4-dna.org 31 // 32 33 #include "PhysicsList.hh" 34 35 #include "DetectorConstruction.hh" 36 #include "PhysicsListMessenger.hh" 37 38 #include "G4PhysicsConstructorRegistry.hh" 39 #include "G4PhysicsListHelper.hh" 40 #include "G4RunManager.hh" 41 #include "G4SystemOfUnits.hh" 42 // #include "CommandLineParser.hh" 43 44 #include "G4BetheBlochIonGasModel.hh" 45 #include "G4BraggIonGasModel.hh" 46 #include "G4ComptonScattering.hh" 47 #include "G4DNAAttachment.hh" 48 #include "G4DNABornExcitationModel.hh" 49 #include "G4DNABornIonisationModel.hh" 50 #include "G4DNAChampionElasticModel.hh" 51 #include "G4DNAChargeDecrease.hh" 52 #include "G4DNAChargeIncrease.hh" 53 #include "G4DNAChemistryManager.hh" 54 #include "G4DNADingfelderChargeDecreaseModel.hh" 55 #include "G4DNADingfelderChargeIncreaseModel.hh" 56 #include "G4DNADiracRMatrixExcitationModel.hh" 57 #include "G4DNAELSEPAElasticModel.hh" 58 #include "G4DNAElastic.hh" 59 #include "G4DNAExcitation.hh" 60 #include "G4DNAGenericIonsManager.hh" 61 #include "G4DNAIonisation.hh" 62 #include "G4DNAMeltonAttachmentModel.hh" 63 #include "G4DNAMillerGreenExcitationModel.hh" 64 #include "G4DNAPlasmonExcitation.hh" 65 #include "G4DNAQuinnPlasmonExcitationModel.hh" 66 #include "G4DNARelativisticIonisationModel.hh" 67 #include "G4DNARuddIonisationModel.hh" 68 #include "G4DNASancheExcitationModel.hh" 69 #include "G4DNAVibExcitation.hh" 70 #include "G4DummyModel.hh" 71 #include "G4EmConfigurator.hh" 72 #include "G4Gamma.hh" 73 #include "G4GammaConversion.hh" 74 #include "G4GoudsmitSaundersonMscModel.hh" 75 #include "G4IonFluctuations.hh" 76 #include "G4LivermoreBremsstrahlungModel.hh" 77 #include "G4LivermoreComptonModel.hh" 78 #include "G4LivermoreGammaConversionModel.hh" 79 #include "G4LivermoreIonisationModel.hh" 80 #include "G4LivermorePhotoElectricModel.hh" 81 #include "G4LivermoreRayleighModel.hh" 82 #include "G4LossTableManager.hh" 83 #include "G4MollerBhabhaModel.hh" 84 #include "G4PenelopeBremsstrahlungModel.hh" 85 #include "G4PenelopeIonisationModel.hh" 86 #include "G4PhotoElectricEffect.hh" 87 #include "G4RayleighScattering.hh" 88 #include "G4SeltzerBergerModel.hh" 89 #include "G4StepLimiter.hh" 90 #include "G4UAtomicDeexcitation.hh" 91 #include "G4UniversalFluctuation.hh" 92 #include "G4UrbanMscModel.hh" 93 #include "G4VEmModel.hh" 94 #include "G4eBremsstrahlung.hh" 95 #include "G4eIonisation.hh" 96 #include "G4eMultipleScattering.hh" 97 #include "G4hIonisation.hh" 98 #include "G4hMultipleScattering.hh" 99 #include "G4ionIonisation.hh" 100 101 // #include "G4ElectronCapture.hh" 102 103 #include "G4ProcessTable.hh" 104 105 // using namespace G4DNAPARSER; 106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 107 108 PhysicsList::PhysicsList() : G4VModularPhysicsList(), fpDetector(0) 109 { 110 fpDetector = dynamic_cast<const DetectorConstruction*>( 111 G4RunManager::GetRunManager()->GetUserDetectorConstruction()); 112 defaultCutValue = 0.1 * nanometer; 113 fcutForGamma = defaultCutValue; 114 fcutForElectron = defaultCutValue; 115 fcutForPositron = defaultCutValue; 116 fcutForProton = defaultCutValue; 117 118 fPhysMessenger = new PhysicsListMessenger(this); 119 SetVerboseLevel(1); 120 121 // RegisterConstructor("G4EmDNAChemistry"); 122 } 123 124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 125 126 PhysicsList::~PhysicsList() 127 { 128 delete fPhysMessenger; 129 } 130 131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 132 133 void PhysicsList::RegisterConstructor(const G4String& name) 134 { 135 RegisterPhysics(G4PhysicsConstructorRegistry::Instance()->GetPhysicsConstructor(name)); 136 } 137 138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 139 140 void PhysicsList::ConstructParticle() 141 { 142 ConstructBosons(); 143 ConstructLeptons(); 144 ConstructBarions(); 145 146 G4VModularPhysicsList::ConstructParticle(); 147 } 148 149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 150 151 void PhysicsList::ConstructBosons() 152 { 153 G4Gamma::GammaDefinition(); 154 } 155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 156 157 void PhysicsList::ConstructLeptons() 158 { 159 G4Electron::ElectronDefinition(); 160 G4Positron::PositronDefinition(); 161 } 162 163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 164 165 void PhysicsList::ConstructBarions() 166 { 167 G4Proton::ProtonDefinition(); 168 G4GenericIon::GenericIonDefinition(); 169 170 G4DNAGenericIonsManager* genericIonsManager; 171 genericIonsManager = G4DNAGenericIonsManager::Instance(); 172 genericIonsManager->GetIon("alpha++"); 173 genericIonsManager->GetIon("alpha+"); 174 genericIonsManager->GetIon("helium"); 175 genericIonsManager->GetIon("hydrogen"); 176 } 177 178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 179 180 void PhysicsList::ConstructProcess() 181 { 182 ConstructEM(); 183 ConstructGeneral(); 184 185 // Contruct processes of the chemistry list 186 G4VModularPhysicsList::ConstructProcess(); 187 } 188 189 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 190 191 void PhysicsList::ConstructEM() 192 { 193 G4bool isGNP = false; 194 if (fphysname == "") fphysname = "DNA"; 195 196 G4Material* NPMaterial = fpDetector->GetNPMaterial(); 197 G4String npname = NPMaterial->GetName(); 198 199 if (npname == "G4_Au") isGNP = true; 200 201 auto theParticleIterator = GetParticleIterator(); 202 theParticleIterator->reset(); 203 204 while ((*theParticleIterator)()) { 205 G4ParticleDefinition* particle = theParticleIterator->value(); 206 207 G4ProcessManager* pm = particle->GetProcessManager(); 208 209 G4String particleName = particle->GetParticleName(); 210 211 if (particleName == "e-") { 212 G4DNAElastic* theDNAElasticProcess = new G4DNAElastic("e-_G4DNAElastic"); 213 theDNAElasticProcess->SetEmModel(new G4DNAChampionElasticModel(), 1); 214 pm->AddDiscreteProcess(theDNAElasticProcess); 215 216 G4DNAExcitation* theDNAExcitationProcess = new G4DNAExcitation("e-_G4DNAExcitation"); 217 theDNAExcitationProcess->SetEmModel(new G4DNABornExcitationModel(), 1); 218 pm->AddDiscreteProcess(theDNAExcitationProcess); 219 220 G4DNAIonisation* theDNAIonizationProcess = new G4DNAIonisation("e-_G4DNAIonisation"); 221 theDNAIonizationProcess->SetEmModel(new G4DNABornIonisationModel(), 1); 222 pm->AddDiscreteProcess(theDNAIonizationProcess); 223 224 G4DNAAttachment* theDNAAttachmentProcess = new G4DNAAttachment("e-_G4DNAAttachment"); 225 pm->AddDiscreteProcess(theDNAAttachmentProcess); 226 227 G4DNAVibExcitation* theDNAVibExcProcess = new G4DNAVibExcitation("e-_G4DNAVibExcitation"); 228 pm->AddDiscreteProcess(theDNAVibExcProcess); 229 230 G4eBremsstrahlung* theDNABremProcess = new G4eBremsstrahlung("e-_G4DNABremsstrahlung"); 231 pm->AddDiscreteProcess(theDNABremProcess); 232 233 if (isGNP) { 234 if (fphysname == "DNA") { 235 G4DNAElastic* theDNAELSEPAElasticProcess = new G4DNAElastic("e-_G4DNAELSEPAElastic"); 236 theDNAELSEPAElasticProcess->SetEmModel(new G4DummyModel(), 1); 237 pm->AddDiscreteProcess(theDNAELSEPAElasticProcess); 238 G4DNAExcitation* theDNADRMExcitationProcess = 239 new G4DNAExcitation("e-_G4DNADRMExcitation"); 240 theDNADRMExcitationProcess->SetEmModel(new G4DummyModel(), 1); 241 pm->AddDiscreteProcess(theDNADRMExcitationProcess); 242 G4DNAIonisation* theDNARelativisticIonizationProcess = 243 new G4DNAIonisation("e-_G4DNARelativisticIonisation"); 244 theDNARelativisticIonizationProcess->SetEmModel(new G4DummyModel(), 1); 245 pm->AddDiscreteProcess(theDNARelativisticIonizationProcess); 246 G4DNAPlasmonExcitation* theDNAPExcitationProcess = 247 new G4DNAPlasmonExcitation("e-_G4DNAPlasmonExcitation"); 248 theDNAPExcitationProcess->SetEmModel(new G4DummyModel(), 1); 249 pm->AddDiscreteProcess(theDNAPExcitationProcess); 250 G4eBremsstrahlung* theDNAeBremProcess = 251 new G4eBremsstrahlung("e-_G4DNABremsstrahlung_GNP"); 252 theDNAeBremProcess->SetEmModel(new G4DummyModel(), 1); 253 pm->AddDiscreteProcess(theDNAeBremProcess); 254 } 255 if (fphysname == "Livermore") { 256 G4eMultipleScattering* msc = new G4eMultipleScattering(); 257 msc->SetEmModel(new G4DummyModel(), 1); 258 pm->AddDiscreteProcess(msc); 259 G4eIonisation* eIoni = new G4eIonisation("e-_G4LivermoreIoni"); 260 eIoni->SetEmModel(new G4DummyModel(), 1); 261 pm->AddDiscreteProcess(eIoni); 262 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung("e-_G4LivermoreBrem"); 263 eBrem->SetEmModel(new G4DummyModel(), 1); 264 pm->AddDiscreteProcess(eBrem); 265 266 G4StepLimiter* steplimit = new G4StepLimiter(); 267 pm->AddDiscreteProcess(steplimit); 268 } 269 if (fphysname == "Penelope") { 270 G4eMultipleScattering* msc = new G4eMultipleScattering(); 271 msc->SetEmModel(new G4DummyModel(), 1); 272 pm->AddDiscreteProcess(msc); 273 G4eIonisation* eIoni = new G4eIonisation("e-_G4PenelopeIoni"); 274 eIoni->SetEmModel(new G4DummyModel(), 1); 275 pm->AddDiscreteProcess(eIoni); 276 G4eBremsstrahlung* eBrem = new G4eBremsstrahlung("e-_G4PenelopeBrem"); 277 eBrem->SetEmModel(new G4DummyModel(), 1); 278 pm->AddDiscreteProcess(eBrem); 279 280 G4StepLimiter* steplimit = new G4StepLimiter(); 281 pm->AddDiscreteProcess(steplimit); 282 } 283 } 284 285 //// Capture of low-energy e- 286 // G4ElectronCapture* ecap = new G4ElectronCapture("NP",10.*eV); 287 // pm->AddDiscreteProcess(ecap); 288 } 289 else if (particleName == "proton") { 290 } 291 else if (particleName == "hydrogen") { 292 } 293 else if (particleName == "gamma") { 294 G4PhotoElectricEffect* thePhotoElectricEffect = new G4PhotoElectricEffect(); 295 thePhotoElectricEffect->SetEmModel(new G4LivermorePhotoElectricModel(), 1); 296 pm->AddDiscreteProcess(thePhotoElectricEffect); 297 298 G4ComptonScattering* theComptonScattering = new G4ComptonScattering(); 299 theComptonScattering->SetEmModel(new G4LivermoreComptonModel(), 1); 300 pm->AddDiscreteProcess(theComptonScattering); 301 302 G4GammaConversion* theGammaConversion = new G4GammaConversion(); 303 theGammaConversion->SetEmModel(new G4LivermoreGammaConversionModel(), 1); 304 pm->AddDiscreteProcess(theGammaConversion); 305 306 G4RayleighScattering* theRayleigh = new G4RayleighScattering(); 307 pm->AddDiscreteProcess(theRayleigh); 308 } 309 } 310 311 if (isGNP) { 312 G4EmConfigurator* em_config = G4LossTableManager::Instance()->EmConfigurator(); 313 G4VEmModel* mod; 314 mod = new G4DNAChampionElasticModel(); 315 mod->SetActivationLowEnergyLimit(1 * GeV); 316 em_config->SetExtraEmModel("e-", "e-_G4DNAElastic", mod, "NP"); 317 mod = new G4DNABornExcitationModel(); 318 mod->SetActivationLowEnergyLimit(1 * GeV); 319 em_config->SetExtraEmModel("e-", "e-_G4DNAExcitation", mod, "NP"); 320 mod = new G4DNABornIonisationModel(); 321 mod->SetActivationLowEnergyLimit(1 * GeV); 322 em_config->SetExtraEmModel("e-", "e-_G4DNAIonisation", mod, "NP"); 323 mod = new G4DNAMeltonAttachmentModel(); 324 mod->SetActivationLowEnergyLimit(1 * GeV); 325 em_config->SetExtraEmModel("e-", "e-_G4DNAAttachment", mod, "NP"); 326 mod = new G4DNASancheExcitationModel(); 327 mod->SetActivationLowEnergyLimit(1 * GeV); 328 em_config->SetExtraEmModel("e-", "e-_G4DNAVibExcitation", mod, "NP"); 329 mod = new G4SeltzerBergerModel(); 330 mod->SetActivationLowEnergyLimit(1 * GeV); 331 em_config->SetExtraEmModel("e-", "e-_G4DNABremsstrahlung", mod, "NP"); 332 333 if (fphysname == "DNA") { 334 mod = new G4DNAELSEPAElasticModel(); 335 em_config->SetExtraEmModel("e-", "e-_G4DNAELSEPAElastic", mod, "NP", 10 * eV, 1 * GeV); 336 mod = new G4DNADiracRMatrixExcitationModel(); 337 em_config->SetExtraEmModel("e-", "e-_G4DNADRMExcitation", mod, "NP", 10 * eV, 1 * GeV); 338 mod = new G4DNARelativisticIonisationModel(); 339 em_config->SetExtraEmModel("e-", "e-_G4DNARelativisticIonisation", mod, "NP", 10 * eV, 340 1 * GeV); 341 mod = new G4DNAQuinnPlasmonExcitationModel(); 342 em_config->SetExtraEmModel("e-", "e-_G4DNAPlasmonExcitation", mod, "NP", 10 * eV, 1 * GeV); 343 mod = new G4SeltzerBergerModel(); 344 em_config->SetExtraEmModel("e-", "e-_G4DNABremsstrahlung_GNP", mod, "NP", 10 * eV, 1 * GeV); 345 } 346 if (fphysname == "Livermore") { 347 mod = new G4UrbanMscModel(); 348 // mod = new G4GoudsmitSaundersonMscModel(); 349 em_config->SetExtraEmModel("e-", "msc", mod, "NP", 0 * eV, 100 * MeV, 350 new G4UniversalFluctuation()); 351 mod = new G4LivermoreIonisationModel(); 352 em_config->SetExtraEmModel("e-", "e-_G4LivermoreIoni", mod, "NP", 0 * eV, 1.0 * MeV, 353 new G4UniversalFluctuation()); 354 mod = new G4LivermoreBremsstrahlungModel(); 355 em_config->SetExtraEmModel("e-", "e-_G4LivermoreBrem", mod, "NP", 0 * eV, 1 * GeV, 356 new G4UniversalFluctuation()); 357 } 358 if (fphysname == "Penelope") { 359 mod = new G4UrbanMscModel(); 360 // mod = new G4GoudsmitSaundersonMscModel(); 361 em_config->SetExtraEmModel("e-", "msc", mod, "NP", 0 * eV, 100 * MeV, 362 new G4UniversalFluctuation()); 363 mod = new G4PenelopeIonisationModel(); 364 em_config->SetExtraEmModel("e-", "e-_G4PenelopeIoni", mod, "NP", 0 * eV, 1.0 * MeV, 365 new G4UniversalFluctuation()); 366 mod = new G4PenelopeBremsstrahlungModel(); 367 em_config->SetExtraEmModel("e-", "e-_G4PenelopeBrem", mod, "NP", 0 * eV, 1 * GeV, 368 new G4UniversalFluctuation()); 369 } 370 } 371 372 G4VAtomDeexcitation* de = new G4UAtomicDeexcitation(); 373 G4LossTableManager::Instance()->SetAtomDeexcitation(de); 374 de->SetFluo(true); 375 de->SetPIXE(true); 376 de->SetAuger(true); 377 de->SetAugerCascade(true); 378 } 379 380 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 381 382 void PhysicsList::ConstructGeneral() {} 383 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 384 385 void PhysicsList::SetCuts() 386 { 387 if (verboseLevel > 0) { 388 G4cout << "PhysicsList::SetCuts:"; 389 G4cout << "CutLength : " << G4BestUnit(defaultCutValue, "Length") << G4endl; 390 } 391 392 SetCutValue(fcutForGamma, "gamma"); 393 SetCutValue(fcutForElectron, "e-"); 394 SetCutValue(fcutForPositron, "e+"); 395 396 if (verboseLevel > 0) { 397 DumpCutValuesTable(); 398 } 399 } 400 void PhysicsList::SetPhysics4NP(const G4String& name) 401 { 402 fphysname = name; 403 } 404