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 publications: 29 // Med. Phys. 45, (2018) e722-e739 30 // Phys. Med. 31 (2015) 861-874 31 // Med. Phys. 37 (2010) 4692-4708 32 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178 33 // The Geant4-DNA web site is available at http://geant4-dna.org 34 // 35 // 36 /// \file PhysicsList.cc 37 /// \brief Implementation of the PhysicsList class 38 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 40 41 #include "PhysicsList.hh" 42 43 #include "G4DecayPhysics.hh" 44 #include "G4EmDNABuilder.hh" 45 #include "G4EmDNAPhysics.hh" 46 #include "G4EmDNAPhysicsActivator.hh" 47 #include "G4EmDNAPhysics_option1.hh" 48 #include "G4EmDNAPhysics_option2.hh" 49 #include "G4EmDNAPhysics_option3.hh" 50 #include "G4EmDNAPhysics_option4.hh" 51 #include "G4EmDNAPhysics_option5.hh" 52 #include "G4EmDNAPhysics_option6.hh" 53 #include "G4EmDNAPhysics_option7.hh" 54 #include "G4EmDNAPhysics_option8.hh" 55 #include "G4EmLivermorePhysics.hh" 56 #include "G4EmPenelopePhysics.hh" 57 #include "G4EmStandardPhysics.hh" 58 #include "G4EmStandardPhysics_option3.hh" 59 #include "G4EmStandardPhysics_option4.hh" 60 #include "G4GenericIon.hh" 61 #include "G4RadioactiveDecayPhysics.hh" 62 63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 64 65 PhysicsList::PhysicsList() : G4VModularPhysicsList() 66 { 67 SetDefaultCutValue(1.0 * micrometer); 68 SetVerboseLevel(1); 69 70 fEmPhysics = "emstandard_opt4"; 71 fEmPhysicsList = new G4EmStandardPhysics_option4(); 72 fDecayPhysicsList = new G4DecayPhysics(); 73 fEmDNAActivator = new G4EmDNAPhysicsActivator(); 74 75 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV); 76 G4EmParameters* param = G4EmParameters::Instance(); 77 param->SetMinEnergy(100 * eV); 78 param->SetMaxEnergy(1 * GeV); 79 } 80 81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 82 83 PhysicsList::~PhysicsList() 84 { 85 delete fEmPhysicsList; 86 delete fEmDNAActivator; 87 delete fDecayPhysicsList; 88 delete fRadDecayPhysicsList; 89 } 90 91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 92 93 void PhysicsList::ConstructParticle() 94 { 95 fEmPhysicsList->ConstructParticle(); 96 fDecayPhysicsList->ConstructParticle(); 97 fEmDNAActivator->ConstructParticle(); 98 } 99 100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 101 102 void PhysicsList::ConstructProcess() 103 { 104 AddTransportation(); 105 fEmPhysicsList->ConstructProcess(); 106 fDecayPhysicsList->ConstructProcess(); 107 108 if (nullptr != fRadDecayPhysicsList) { 109 fRadDecayPhysicsList->ConstructProcess(); 110 } 111 112 if (!fDNAPL) { 113 fEmDNAActivator->ConstructProcess(); 114 } 115 116 if (fIsTrackingCutSet) { 117 TrackingCut(); 118 } 119 } 120 121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 122 123 void PhysicsList::AddPhysics(const G4String& name) 124 { 125 if (name == fEmPhysics) { 126 return; 127 } 128 129 G4cout << "### PhysicsList::AddPhysics Warning: Physics List <" << name << "> is requested" 130 << G4endl; 131 132 fEmPhysics = name; 133 134 if (name == "emstandard_opt0") { 135 delete fEmPhysicsList; 136 fEmPhysicsList = new G4EmStandardPhysics(); 137 fDNAPL = false; 138 } 139 else if (name == "emstandard_opt3") { 140 delete fEmPhysicsList; 141 fEmPhysicsList = new G4EmStandardPhysics_option3(); 142 fDNAPL = false; 143 } 144 else if (name == "emstandard_opt4") { 145 delete fEmPhysicsList; 146 fEmPhysicsList = new G4EmStandardPhysics_option4(); 147 fDNAPL = false; 148 } 149 else if (name == "raddecay") { 150 if (nullptr == fRadDecayPhysicsList) fRadDecayPhysicsList = new G4RadioactiveDecayPhysics(); 151 } 152 else if (name == "emlivermore") { 153 delete fEmPhysicsList; 154 fEmPhysicsList = new G4EmLivermorePhysics(); 155 fDNAPL = false; 156 } 157 else if (name == "empenelope") { 158 delete fEmPhysicsList; 159 fEmPhysicsList = new G4EmPenelopePhysics(); 160 fDNAPL = false; 161 } 162 else if (name == "DNA_Opt0") { 163 delete fEmPhysicsList; 164 fEmPhysicsList = new G4EmDNAPhysics(); 165 fDNAPL = true; 166 } 167 else if (name == "DNA_Opt1") { 168 delete fEmPhysicsList; 169 fEmPhysicsList = new G4EmDNAPhysics_option1(); 170 fDNAPL = true; 171 } 172 else if (name == "DNA_Opt2") { 173 delete fEmPhysicsList; 174 fEmPhysicsList = new G4EmDNAPhysics_option2(); 175 fDNAPL = true; 176 } 177 else if (name == "DNA_Opt3") { 178 delete fEmPhysicsList; 179 fEmPhysicsList = new G4EmDNAPhysics_option3(); 180 fDNAPL = true; 181 } 182 else if (name == "DNA_Opt4") { 183 delete fEmPhysicsList; 184 fEmPhysicsList = new G4EmDNAPhysics_option4(); 185 fDNAPL = true; 186 } 187 else if (name == "DNA_Opt5") { 188 delete fEmPhysicsList; 189 fEmPhysicsList = new G4EmDNAPhysics_option5(); 190 fDNAPL = true; 191 } 192 else if (name == "DNA_Opt6") { 193 delete fEmPhysicsList; 194 fEmPhysicsList = new G4EmDNAPhysics_option6(); 195 fDNAPL = true; 196 } 197 else if (name == "DNA_Opt7") { 198 delete fEmPhysicsList; 199 fEmPhysicsList = new G4EmDNAPhysics_option7(); 200 fDNAPL = true; 201 } 202 else if (name == "DNA_Opt8") { 203 delete fEmPhysicsList; 204 fEmPhysicsList = new G4EmDNAPhysics_option8(); 205 fDNAPL = true; 206 } 207 else { 208 G4cout << "### PhysicsList::AddPhysics Warning: Physics List <" << name 209 << "> is does not exist - the command ignored" << G4endl; 210 } 211 } 212 213 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 214 215 void PhysicsList::TrackingCut() 216 { 217 auto particle = G4GenericIon::GenericIon(); // DNA heavy ions 218 auto particleName = particle->GetParticleName(); 219 auto capture = G4EmDNABuilder::FindOrBuildCapture(0.5 * CLHEP::MeV, particle); 220 capture->AddRegion("World"); 221 capture->AddRegion("regionTarget"); 222 capture->SetKinEnergyLimit(0.5 * CLHEP::MeV); // 0.5 MeV/u 223 } 224 225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 226 227 void PhysicsList::SetTrackingCut(G4bool isCut) 228 { 229 fIsTrackingCutSet = isCut; 230 } 231