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 /// \file medical/GammaTherapy/src/PhysicsList 26 /// \file medical/GammaTherapy/src/PhysicsList.cc 27 /// \brief Implementation of the PhysicsList c 27 /// \brief Implementation of the PhysicsList class 28 // 28 // >> 29 // $Id: PhysicsList.cc 67994 2013-03-13 11:05:39Z gcosmo $ 29 // 30 // 30 //-------------------------------------------- 31 //--------------------------------------------------------------------------- 31 // 32 // 32 // ClassName: PhysicsList 33 // ClassName: PhysicsList 33 // 34 // 34 // Author: V.Ivanchenko 03.05.2004 35 // Author: V.Ivanchenko 03.05.2004 35 // 36 // 36 // Modified: 37 // Modified: 37 // 16.11.06 Use components from physics_lists 38 // 16.11.06 Use components from physics_lists subdirectory (V.Ivanchenko) 38 // 16.05.07 Use renamed EM components from phy 39 // 16.05.07 Use renamed EM components from physics_lists (V.Ivanchenko) 39 // 40 // 40 //-------------------------------------------- 41 //---------------------------------------------------------------------------- 41 // 42 // 42 43 43 //....oooOO0OOooo........oooOO0OOooo........oo 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 44 //....oooOO0OOooo........oooOO0OOooo........oo 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 45 46 46 #include "PhysicsList.hh" 47 #include "PhysicsList.hh" 47 << 48 #include "PhysicsListMessenger.hh" 48 #include "PhysicsListMessenger.hh" 49 #include "StepLimiterBuilder.hh" << 50 49 51 #include "G4DecayPhysics.hh" << 52 #include "G4EmExtraPhysics.hh" << 53 #include "G4EmLivermorePhysics.hh" << 54 #include "G4EmLowEPPhysics.hh" << 55 #include "G4EmParameters.hh" << 56 #include "G4EmPenelopePhysics.hh" << 57 #include "G4EmStandardPhysics.hh" 50 #include "G4EmStandardPhysics.hh" 58 #include "G4EmStandardPhysics_option1.hh" 51 #include "G4EmStandardPhysics_option1.hh" 59 #include "G4EmStandardPhysics_option2.hh" 52 #include "G4EmStandardPhysics_option2.hh" 60 #include "G4EmStandardPhysics_option3.hh" 53 #include "G4EmStandardPhysics_option3.hh" 61 #include "G4EmStandardPhysics_option4.hh" << 54 #include "G4EmLivermorePhysics.hh" >> 55 #include "G4EmPenelopePhysics.hh" >> 56 #include "StepLimiterBuilder.hh" >> 57 #include "G4DecayPhysics.hh" 62 #include "G4HadronElasticPhysics.hh" 58 #include "G4HadronElasticPhysics.hh" 63 #include "G4HadronInelasticQBBC.hh" 59 #include "G4HadronInelasticQBBC.hh" 64 #include "G4IonBinaryCascadePhysics.hh" 60 #include "G4IonBinaryCascadePhysics.hh" >> 61 #include "G4EmExtraPhysics.hh" >> 62 #include "G4StoppingPhysics.hh" >> 63 >> 64 #include "G4UnitsTable.hh" 65 #include "G4LossTableManager.hh" 65 #include "G4LossTableManager.hh" >> 66 #include "G4EmProcessOptions.hh" >> 67 66 #include "G4PhysicalConstants.hh" 68 #include "G4PhysicalConstants.hh" 67 #include "G4StoppingPhysics.hh" << 68 #include "G4SystemOfUnits.hh" 69 #include "G4SystemOfUnits.hh" 69 #include "G4UnitsTable.hh" << 70 70 71 //....oooOO0OOooo........oooOO0OOooo........oo 71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 72 72 73 PhysicsList::PhysicsList() : G4VModularPhysics << 73 PhysicsList::PhysicsList(): G4VModularPhysicsList() 74 { 74 { >> 75 fEmBuilderIsRegisted = false; 75 fHelIsRegisted = false; 76 fHelIsRegisted = false; 76 fBicIsRegisted = false; 77 fBicIsRegisted = false; 77 fIonIsRegisted = false; 78 fIonIsRegisted = false; 78 fGnucIsRegisted = false; 79 fGnucIsRegisted = false; 79 fStopIsRegisted = false; 80 fStopIsRegisted = false; 80 fVerbose = 1; 81 fVerbose = 1; 81 << 82 G4LossTableManager::Instance()->SetVerbose(fVerbose); 82 SetDefaultCutValue(1 * mm); << 83 defaultCutValue = 1.*mm; >> 84 fCutForGamma = defaultCutValue; >> 85 fCutForElectron = defaultCutValue; >> 86 fCutForPositron = defaultCutValue; 83 87 84 fMessenger = new PhysicsListMessenger(this); 88 fMessenger = new PhysicsListMessenger(this); 85 89 86 // Add Physics builders 90 // Add Physics builders 87 RegisterPhysics(new G4EmStandardPhysics()); << 88 RegisterPhysics(new G4DecayPhysics()); 91 RegisterPhysics(new G4DecayPhysics()); 89 RegisterPhysics(new StepLimiterBuilder()); << 90 } 92 } 91 93 92 //....oooOO0OOooo........oooOO0OOooo........oo 94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 93 95 94 PhysicsList::~PhysicsList() 96 PhysicsList::~PhysicsList() 95 { 97 { 96 delete fMessenger; 98 delete fMessenger; 97 } 99 } 98 100 99 //....oooOO0OOooo........oooOO0OOooo........oo 101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 100 102 101 void PhysicsList::ConstructParticle() 103 void PhysicsList::ConstructParticle() 102 { 104 { 103 if (fVerbose > 0) { << 105 if(fVerbose > 0) { 104 G4cout << "### PhysicsList Construte Parti 106 G4cout << "### PhysicsList Construte Particles" << G4endl; 105 } 107 } 106 G4VModularPhysicsList::ConstructParticle(); 108 G4VModularPhysicsList::ConstructParticle(); 107 } 109 } 108 110 109 //....oooOO0OOooo........oooOO0OOooo........oo 111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 110 112 111 void PhysicsList::ConstructProcess() 113 void PhysicsList::ConstructProcess() 112 { 114 { 113 if (fVerbose > 0) { << 115 if(fVerbose > 0) { 114 G4cout << "### PhysicsList Construte Proce 116 G4cout << "### PhysicsList Construte Processes" << G4endl; 115 } 117 } 116 << 118 if(!fEmBuilderIsRegisted) { AddPhysicsList("emstandard"); } >> 119 RegisterPhysics(new StepLimiterBuilder()); 117 G4VModularPhysicsList::ConstructProcess(); 120 G4VModularPhysicsList::ConstructProcess(); 118 121 119 // Define energy interval for loss processes 122 // Define energy interval for loss processes 120 // from 10 eV to 10 GeV 123 // from 10 eV to 10 GeV 121 G4EmParameters* param = G4EmParameters::Inst << 124 G4EmProcessOptions emOptions; 122 param->SetMinEnergy(0.01 * keV); << 125 emOptions.SetMinEnergy(0.01*keV); 123 param->SetMaxEnergy(10. * GeV); << 126 emOptions.SetMaxEnergy(10.*GeV); 124 param->SetNumberOfBinsPerDecade(10); << 127 emOptions.SetDEDXBinning(90); 125 param->SetVerbose(1); << 128 emOptions.SetLambdaBinning(90); 126 } 129 } 127 130 128 //....oooOO0OOooo........oooOO0OOooo........oo 131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 129 132 130 void PhysicsList::AddPhysicsList(const G4Strin 133 void PhysicsList::AddPhysicsList(const G4String& name) 131 { 134 { 132 if (fVerbose > 0) { << 135 if(fVerbose > 0) { 133 G4cout << "### PhysicsList Add Physics <" << 136 G4cout << "### PhysicsList Add Physics <" << name 134 } << 137 << "> " << G4endl; 135 if (name == "emstandard") { << 138 } 136 ReplacePhysics(new G4EmStandardPhysics()); << 139 if ((name == "emstandard") && !fEmBuilderIsRegisted) { 137 } << 140 RegisterPhysics(new G4EmStandardPhysics()); 138 else if (name == "emstandard_opt1") { << 141 fEmBuilderIsRegisted = true; 139 ReplacePhysics(new G4EmStandardPhysics_opt << 142 140 } << 143 } else if (name == "emstandard_opt1" && !fEmBuilderIsRegisted) { 141 else if (name == "emstandard_opt2") { << 144 RegisterPhysics(new G4EmStandardPhysics_option1()); 142 ReplacePhysics(new G4EmStandardPhysics_opt << 145 fEmBuilderIsRegisted = true; 143 } << 146 144 else if (name == "emstandard_opt3") { << 147 } else if (name == "emstandard_opt2" && !fEmBuilderIsRegisted) { 145 ReplacePhysics(new G4EmStandardPhysics_opt << 148 RegisterPhysics(new G4EmStandardPhysics_option2()); 146 } << 149 fEmBuilderIsRegisted = true; 147 else if (name == "emstandard_opt4") { << 150 148 ReplacePhysics(new G4EmStandardPhysics_opt << 151 } else if (name == "emstandard_opt3" && !fEmBuilderIsRegisted) { 149 } << 152 RegisterPhysics(new G4EmStandardPhysics_option3()); 150 else if (name == "emlivermore") { << 153 fEmBuilderIsRegisted = true; 151 ReplacePhysics(new G4EmLivermorePhysics()) << 154 152 } << 155 } else if (name == "emlivermore" && !fEmBuilderIsRegisted) { 153 else if (name == "empenelope") { << 156 RegisterPhysics(new G4EmLivermorePhysics()); 154 ReplacePhysics(new G4EmPenelopePhysics()); << 157 fEmBuilderIsRegisted = true; 155 } << 158 156 else if (name == "emlowenergy") { << 159 } else if (name == "empenelope" && !fEmBuilderIsRegisted) { 157 ReplacePhysics(new G4EmLowEPPhysics()); << 160 RegisterPhysics(new G4EmPenelopePhysics()); 158 } << 161 fEmBuilderIsRegisted = true; 159 else if (name == "elastic" && !fHelIsRegiste << 162 >> 163 } else if (name == "elastic" && !fHelIsRegisted && fEmBuilderIsRegisted) { 160 RegisterPhysics(new G4HadronElasticPhysics 164 RegisterPhysics(new G4HadronElasticPhysics()); 161 fHelIsRegisted = true; 165 fHelIsRegisted = true; 162 } << 166 163 else if (name == "binary" && !fBicIsRegisted << 167 } else if (name == "binary" && !fBicIsRegisted && fEmBuilderIsRegisted) { 164 RegisterPhysics(new G4HadronInelasticQBBC( 168 RegisterPhysics(new G4HadronInelasticQBBC()); 165 fBicIsRegisted = true; 169 fBicIsRegisted = true; 166 } << 170 167 else if (name == "binary_ion" && !fIonIsRegi << 171 } else if (name == "binary_ion" && !fIonIsRegisted && fEmBuilderIsRegisted) { 168 RegisterPhysics(new G4IonBinaryCascadePhys 172 RegisterPhysics(new G4IonBinaryCascadePhysics()); 169 fIonIsRegisted = true; 173 fIonIsRegisted = true; 170 } << 174 171 else if (name == "gamma_nuc" && !fGnucIsRegi << 175 } else if (name == "gamma_nuc" && !fGnucIsRegisted && fEmBuilderIsRegisted) { 172 RegisterPhysics(new G4EmExtraPhysics()); 176 RegisterPhysics(new G4EmExtraPhysics()); 173 fGnucIsRegisted = true; 177 fGnucIsRegisted = true; 174 } << 178 175 else if (name == "stopping" && !fStopIsRegis << 179 } else if (name == "stopping" && !fStopIsRegisted && fEmBuilderIsRegisted) { 176 RegisterPhysics(new G4StoppingPhysics()); 180 RegisterPhysics(new G4StoppingPhysics()); 177 fStopIsRegisted = true; 181 fStopIsRegisted = true; 178 } << 182 179 else { << 183 } else if(!fEmBuilderIsRegisted) { 180 G4cout << "PhysicsList::AddPhysicsList <" << 184 G4cout << "PhysicsList::AddPhysicsList <" << name << ">" >> 185 << " fail - EM physics should be registered first " << G4endl; >> 186 } else { >> 187 G4cout << "PhysicsList::AddPhysicsList <" << name << ">" 181 << " fail - module is already regit 188 << " fail - module is already regitered or is unknown " << G4endl; 182 } 189 } >> 190 } >> 191 >> 192 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 193 >> 194 void PhysicsList::SetCuts() >> 195 { >> 196 SetCutValue(fCutForGamma, "gamma"); >> 197 SetCutValue(fCutForElectron, "e-"); >> 198 SetCutValue(fCutForPositron, "e+"); >> 199 >> 200 if (fVerbose>0) DumpCutValuesTable(); >> 201 } >> 202 >> 203 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 204 >> 205 void PhysicsList::SetCutForGamma(G4double cut) >> 206 { >> 207 fCutForGamma = cut; >> 208 SetParticleCuts(fCutForGamma, G4Gamma::Gamma()); >> 209 } >> 210 >> 211 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 212 >> 213 void PhysicsList::SetCutForElectron(G4double cut) >> 214 { >> 215 fCutForElectron = cut; >> 216 SetParticleCuts(fCutForElectron, G4Electron::Electron()); >> 217 } >> 218 >> 219 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 220 >> 221 void PhysicsList::SetCutForPositron(G4double cut) >> 222 { >> 223 fCutForPositron = cut; >> 224 SetParticleCuts(fCutForPositron, G4Positron::Positron()); 183 } 225 } 184 226 185 //....oooOO0OOooo........oooOO0OOooo........oo 227 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 186 228