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 // dnadamage3 example is derived from the chem6 example 28 // chem6 example authors: W. G. Shin and S. Incerti (CENBG, France) 29 // 30 // Any report or published results obtained using the Geant4-DNA software 31 // shall cite the following Geant4-DNA collaboration publication: 32 // J. Appl. Phys. 125 (2019) 104301 33 // Med. Phys. 45 (2018) e722-e739 34 // J. Comput. Phys. 274 (2014) 841-882 35 // Med. Phys. 37 (2010) 4692-4708 36 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157-178 37 // The Geant4-DNA web site is available at http://geant4-dna.org 38 // 39 // Authors: J. Naoki D. Kondo (UCSF, US) 40 // J. Ramos-Mendez and B. Faddegon (UCSF, US) 41 // 42 /// \file PhysicsList.cc 43 /// \brief Implementation of the PhysicsList class 44 45 #include "PhysicsList.hh" 46 47 #include "G4EmDNAChemistry.hh" 48 #include "G4EmDNAChemistryForPlasmids.hh" 49 #include "G4EmDNAChemistry_option1.hh" 50 #include "G4EmDNAChemistry_option2.hh" 51 #include "G4EmDNAChemistry_option3.hh" 52 #include "G4EmDNAPhysics.hh" 53 #include "G4EmDNAPhysics_option1.hh" 54 #include "G4EmDNAPhysics_option2.hh" 55 #include "G4EmDNAPhysics_option3.hh" 56 #include "G4EmDNAPhysics_option4.hh" 57 #include "G4EmDNAPhysics_option5.hh" 58 #include "G4EmDNAPhysics_option6.hh" 59 #include "G4EmDNAPhysics_option7.hh" 60 #include "G4EmDNAPhysics_option8.hh" 61 #include "G4EmParameters.hh" 62 #include "G4PhysicsConstructorRegistry.hh" 63 #include "G4SystemOfUnits.hh" 64 65 #include <memory> 66 67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 68 69 PhysicsList::PhysicsList() : G4VModularPhysicsList() 70 { 71 G4double currentDefaultCut = 1. * nanometer; 72 // fixe lower limit for cut 73 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV); 74 SetDefaultCutValue(currentDefaultCut); 75 SetVerboseLevel(1); 76 77 RegisterPhysicsConstructor("G4EmDNAPhysics_option2"); 78 RegisterChemistryConstructor("G4EmDNAChemistryForPlasmids"); 79 80 fpPhysicsUI = new G4UIcmdWithAString("/physics/SetPhysics", this); 81 fpPhysicsUI->AvailableForStates(G4State_PreInit); 82 83 fpChemistryUI = new G4UIcmdWithAString("/physics/SetChemistry", this); 84 fpChemistryUI->AvailableForStates(G4State_PreInit); 85 86 fpDMSOUI = new G4UIcmdWithADouble("/chem/scavenger/DMSO", this); 87 fpDMSOUI->AvailableForStates(G4State_PreInit); 88 89 fpOxygenUI = new G4UIcmdWithADouble("/chem/scavenger/Oxygen", this); 90 fpOxygenUI->AvailableForStates(G4State_PreInit); 91 } 92 93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 94 95 void PhysicsList::ConstructParticle() 96 { 97 if (fEmDNAPhysicsList != nullptr) { 98 fEmDNAPhysicsList->ConstructParticle(); 99 } 100 if (fEmDNAChemistryList != nullptr) { 101 fEmDNAChemistryList->ConstructParticle(); 102 } 103 } 104 105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 106 107 void PhysicsList::ConstructProcess() 108 { 109 AddTransportation(); 110 if (fEmDNAPhysicsList != nullptr) { 111 fEmDNAPhysicsList->ConstructProcess(); 112 } 113 if (fEmDNAChemistryList != nullptr) { 114 fEmDNAChemistryList->ConstructProcess(); 115 } 116 } 117 118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 119 120 void PhysicsList::RegisterPhysicsConstructor(const G4String& name) 121 { 122 if (name == fPhysDNAName) { 123 return; 124 } 125 if (verboseLevel > 0) { 126 G4cout << "===== Register Physics constructor ==== " << name << G4endl; 127 } 128 if (name == "G4EmDNAPhysics") { 129 delete fEmDNAPhysicsList; 130 fEmDNAPhysicsList = new G4EmDNAPhysics(verboseLevel); 131 fPhysDNAName = name; 132 } 133 else if (name == "G4EmDNAPhysics_option1") { 134 delete fEmDNAPhysicsList; 135 fEmDNAPhysicsList = new G4EmDNAPhysics_option1(verboseLevel); 136 fPhysDNAName = name; 137 } 138 else if (name == "G4EmDNAPhysics_option2") { 139 delete fEmDNAPhysicsList; 140 fEmDNAPhysicsList = new G4EmDNAPhysics_option2(verboseLevel); 141 fPhysDNAName = name; 142 } 143 else if (name == "G4EmDNAPhysics_option3") { 144 delete fEmDNAPhysicsList; 145 fEmDNAPhysicsList = new G4EmDNAPhysics_option3(verboseLevel); 146 fPhysDNAName = name; 147 } 148 else if (name == "G4EmDNAPhysics_option4") { 149 delete fEmDNAPhysicsList; 150 fEmDNAPhysicsList = new G4EmDNAPhysics_option4(verboseLevel); 151 fPhysDNAName = name; 152 } 153 else if (name == "G4EmDNAPhysics_option5") { 154 delete fEmDNAPhysicsList; 155 fEmDNAPhysicsList = new G4EmDNAPhysics_option5(verboseLevel); 156 fPhysDNAName = name; 157 } 158 else if (name == "G4EmDNAPhysics_option6") { 159 delete fEmDNAPhysicsList; 160 fEmDNAPhysicsList = new G4EmDNAPhysics_option6(verboseLevel); 161 fPhysDNAName = name; 162 } 163 else if (name == "G4EmDNAPhysics_option7") { 164 delete fEmDNAPhysicsList; 165 fEmDNAPhysicsList = new G4EmDNAPhysics_option7(verboseLevel); 166 fPhysDNAName = name; 167 } 168 else if (name == "G4EmDNAPhysics_option8") { 169 delete fEmDNAPhysicsList; 170 fEmDNAPhysicsList = new G4EmDNAPhysics_option8(verboseLevel); 171 fPhysDNAName = name; 172 } 173 else { 174 G4cout << "PhysicsList::RegisterPhysicsConstructor: <" << name << ">" 175 << " fails - name is not defined" << G4endl; 176 } 177 } 178 179 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 180 181 void PhysicsList::RegisterChemistryConstructor(const G4String& name) 182 { 183 if (verboseLevel > 0) { 184 G4cout << "===== Register Chemistry constructor ==== " << name << G4endl; 185 } 186 if (name == "G4EmDNAChemistry") { 187 delete fEmDNAChemistryList; 188 fEmDNAChemistryList = new G4EmDNAChemistry(); 189 fEmDNAChemistryList->SetVerboseLevel(verboseLevel); 190 fChemDNAName = name; 191 } 192 else if (name == "G4EmDNAChemistry_option1") { 193 delete fEmDNAChemistryList; 194 fEmDNAChemistryList = new G4EmDNAChemistry_option1(); 195 fEmDNAChemistryList->SetVerboseLevel(verboseLevel); 196 fChemDNAName = name; 197 } 198 else if (name == "G4EmDNAChemistry_option2") { 199 delete fEmDNAChemistryList; 200 fEmDNAChemistryList = new G4EmDNAChemistry_option2(); 201 fEmDNAChemistryList->SetVerboseLevel(verboseLevel); 202 fChemDNAName = name; 203 } 204 else if (name == "G4EmDNAChemistry_option3") { 205 delete fEmDNAChemistryList; 206 fEmDNAChemistryList = new G4EmDNAChemistry_option3(); 207 fEmDNAChemistryList->SetVerboseLevel(verboseLevel); 208 fChemDNAName = name; 209 } 210 else if (name == "G4EmDNAChemistryForPlasmids") { 211 delete fEmDNAChemistryList; 212 fEmDNAChemistryList = new G4EmDNAChemistryForPlasmids(fDMSO, fOxygen); 213 fEmDNAChemistryList->SetVerboseLevel(verboseLevel); 214 fChemDNAName = name; 215 } 216 else { 217 G4cout << "PhysicsList::RegisterChemistryConstructor: <" << name << ">" 218 << " fails - name is not defined" << G4endl; 219 } 220 } 221 222 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 223 224 void PhysicsList::SetNewValue(G4UIcommand* command, G4String newValue) 225 { 226 if (command == fpPhysicsUI) { 227 RegisterPhysicsConstructor(newValue); 228 } 229 230 if (command == fpChemistryUI) { 231 RegisterChemistryConstructor(newValue); 232 } 233 234 if (command == fpDMSOUI) { 235 fDMSO = fpDMSOUI->GetNewDoubleValue(newValue); 236 } 237 238 else if (command == fpOxygenUI) { 239 fOxygen = fpOxygenUI->GetNewDoubleValue(newValue); 240 } 241 } 242 243 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 244