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