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 // 34 // The Geant4-DNA web site is available at http://geant4-dna.org 35 // 36 /// \file medical/dna/wvalue/src/PhysicsList.cc 37 /// \brief Implementation of the PhysicsList class 38 39 #include "PhysicsList.hh" 40 41 #include "PhysicsListMessenger.hh" 42 43 #include "G4EmDNAPhysics.hh" 44 #include "G4EmDNAPhysics_option1.hh" 45 #include "G4EmDNAPhysics_option2.hh" 46 #include "G4EmDNAPhysics_option3.hh" 47 #include "G4EmDNAPhysics_option4.hh" 48 #include "G4EmDNAPhysics_option5.hh" 49 #include "G4EmDNAPhysics_option6.hh" 50 #include "G4EmDNAPhysics_option7.hh" 51 #include "G4UserSpecialCuts.hh" 52 53 // particles 54 55 #include "G4BaryonConstructor.hh" 56 #include "G4BosonConstructor.hh" 57 #include "G4DNAGenericIonsManager.hh" 58 #include "G4IonConstructor.hh" 59 #include "G4LeptonConstructor.hh" 60 #include "G4MesonConstructor.hh" 61 #include "G4ShortLivedConstructor.hh" 62 63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 64 65 PhysicsList::PhysicsList() : G4VModularPhysicsList(), fEmPhysicsList(0), fMessenger(0) 66 { 67 fMessenger = new PhysicsListMessenger(this); 68 69 SetVerboseLevel(1); 70 71 // EM physics 72 73 fEmPhysicsList = new G4EmDNAPhysics(); 74 } 75 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 77 78 PhysicsList::~PhysicsList() 79 { 80 delete fMessenger; 81 delete fEmPhysicsList; 82 } 83 84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 85 86 void PhysicsList::ConstructParticle() 87 { 88 G4BosonConstructor pBosonConstructor; 89 pBosonConstructor.ConstructParticle(); 90 91 G4LeptonConstructor pLeptonConstructor; 92 pLeptonConstructor.ConstructParticle(); 93 94 G4MesonConstructor pMesonConstructor; 95 pMesonConstructor.ConstructParticle(); 96 97 G4BaryonConstructor pBaryonConstructor; 98 pBaryonConstructor.ConstructParticle(); 99 100 G4IonConstructor pIonConstructor; 101 pIonConstructor.ConstructParticle(); 102 103 G4ShortLivedConstructor pShortLivedConstructor; 104 pShortLivedConstructor.ConstructParticle(); 105 106 G4DNAGenericIonsManager* genericIonsManager; 107 genericIonsManager = G4DNAGenericIonsManager::Instance(); 108 genericIonsManager->GetIon("alpha++"); 109 genericIonsManager->GetIon("alpha+"); 110 genericIonsManager->GetIon("helium"); 111 genericIonsManager->GetIon("hydrogen"); 112 } 113 114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 115 116 void PhysicsList::ConstructProcess() 117 { 118 // Transportation 119 120 AddTransportation(); 121 122 // Electromagnetic physics list 123 124 fEmPhysicsList->ConstructProcess(); 125 126 // Tracking cut 127 128 AddTrackingCut(); 129 } 130 131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 132 133 void PhysicsList::AddPhysicsList(const G4String& name) 134 { 135 if (verboseLevel > -1) { 136 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; 137 } 138 139 if (name == fEmName) return; 140 141 if (name == "dna") { 142 fEmName = name; 143 delete fEmPhysicsList; 144 fEmPhysicsList = new G4EmDNAPhysics(); 145 } 146 else if (name == "dna_opt1") { 147 fEmName = name; 148 delete fEmPhysicsList; 149 fEmPhysicsList = new G4EmDNAPhysics_option1(); 150 } 151 else if (name == "dna_opt2") { 152 fEmName = name; 153 delete fEmPhysicsList; 154 fEmPhysicsList = new G4EmDNAPhysics_option2(); 155 } 156 else if (name == "dna_opt3") { 157 fEmName = name; 158 delete fEmPhysicsList; 159 fEmPhysicsList = new G4EmDNAPhysics_option3(); 160 } 161 else if (name == "dna_opt4") { 162 fEmName = name; 163 delete fEmPhysicsList; 164 fEmPhysicsList = new G4EmDNAPhysics_option4(); 165 } 166 else if (name == "dna_opt5") { 167 fEmName = name; 168 delete fEmPhysicsList; 169 fEmPhysicsList = new G4EmDNAPhysics_option5(); 170 } 171 else if (name == "dna_opt6") { 172 fEmName = name; 173 delete fEmPhysicsList; 174 fEmPhysicsList = new G4EmDNAPhysics_option6(); 175 } 176 else if (name == "dna_opt7") { 177 fEmName = name; 178 delete fEmPhysicsList; 179 fEmPhysicsList = new G4EmDNAPhysics_option7(); 180 } 181 else { 182 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" 183 << " is not defined" << G4endl; 184 } 185 } 186 187 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 188 189 void PhysicsList::AddTrackingCut() 190 { 191 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper(); 192 193 auto particleIterator = GetParticleIterator(); 194 particleIterator->reset(); 195 while ((*particleIterator)()) { 196 G4ParticleDefinition* particle = particleIterator->value(); 197 G4String particleName = particle->GetParticleName(); 198 199 if (particleName == "e-") ph->RegisterProcess(new G4UserSpecialCuts(), particle); 200 } 201 } 202