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 PhysicsList.cc << 26 // 27 /// \brief Implementation of the PhysicsList c << 27 // $Id: PhysicsList.cc,v 1.4 2006/10/24 16:54:16 maire Exp $ 28 // << 28 // GEANT4 tag $Name: geant4-09-02-patch-04 $ 29 // 29 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 31 //....oooOO0OOooo........oooOO0OOooo........oo 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 32 33 #include "PhysicsList.hh" 33 #include "PhysicsList.hh" >> 34 #include "PhysicsListMessenger.hh" >> 35 >> 36 #include "PhysListEmStandard.hh" 34 37 35 #include "PhysListEmLivermore.hh" 38 #include "PhysListEmLivermore.hh" 36 #include "PhysListEmPenelope.hh" 39 #include "PhysListEmPenelope.hh" 37 #include "PhysListEmStandard.hh" << 38 #include "PhysicsListMessenger.hh" << 39 40 40 #include "G4LossTableManager.hh" 41 #include "G4LossTableManager.hh" 41 #include "G4SystemOfUnits.hh" << 42 #include "G4UnitsTable.hh" 42 #include "G4UnitsTable.hh" 43 43 44 // particles << 45 << 46 #include "G4BaryonConstructor.hh" << 47 #include "G4BosonConstructor.hh" << 48 #include "G4IonConstructor.hh" << 49 #include "G4LeptonConstructor.hh" << 50 #include "G4MesonConstructor.hh" << 51 #include "G4ShortLivedConstructor.hh" << 52 << 53 //....oooOO0OOooo........oooOO0OOooo........oo 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 54 45 55 PhysicsList::PhysicsList() << 46 PhysicsList::PhysicsList() >> 47 : G4VModularPhysicsList() 56 { 48 { 57 G4LossTableManager::Instance(); 49 G4LossTableManager::Instance(); >> 50 >> 51 currentDefaultCut = 1.0*mm; >> 52 cutForGamma = currentDefaultCut; >> 53 cutForElectron = currentDefaultCut; >> 54 cutForPositron = currentDefaultCut; 58 55 59 fMessenger = new PhysicsListMessenger(this); << 56 pMessenger = new PhysicsListMessenger(this); 60 57 61 SetVerboseLevel(1); 58 SetVerboseLevel(1); 62 59 63 // EM physics 60 // EM physics 64 fEmName = G4String("standard"); << 61 emName = G4String("standard"); 65 fEmPhysicsList = new PhysListEmStandard(fEmN << 62 emPhysicsList = new PhysListEmStandard(emName); 66 63 67 // add new units for cross sections << 68 // << 69 new G4UnitDefinition("mm2/g", "mm2/g", "Surf << 70 new G4UnitDefinition("um2/mg", "um2/mg", "Su << 71 } 64 } 72 65 73 //....oooOO0OOooo........oooOO0OOooo........oo 66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 74 67 75 PhysicsList::~PhysicsList() 68 PhysicsList::~PhysicsList() 76 { 69 { 77 delete fMessenger; << 70 delete pMessenger; 78 } 71 } 79 72 80 //....oooOO0OOooo........oooOO0OOooo........oo 73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 81 74 82 void PhysicsList::ConstructParticle() << 75 // Bosons 83 { << 76 #include "G4ChargedGeantino.hh" 84 G4BosonConstructor pBosonConstructor; << 77 #include "G4Geantino.hh" 85 pBosonConstructor.ConstructParticle(); << 78 #include "G4Gamma.hh" >> 79 #include "G4OpticalPhoton.hh" 86 80 87 G4LeptonConstructor pLeptonConstructor; << 81 // leptons 88 pLeptonConstructor.ConstructParticle(); << 82 #include "G4MuonPlus.hh" >> 83 #include "G4MuonMinus.hh" >> 84 #include "G4NeutrinoMu.hh" >> 85 #include "G4AntiNeutrinoMu.hh" 89 86 90 G4MesonConstructor pMesonConstructor; << 87 #include "G4Electron.hh" 91 pMesonConstructor.ConstructParticle(); << 88 #include "G4Positron.hh" >> 89 #include "G4NeutrinoE.hh" >> 90 #include "G4AntiNeutrinoE.hh" 92 91 93 G4BaryonConstructor pBaryonConstructor; << 92 // Mesons 94 pBaryonConstructor.ConstructParticle(); << 93 #include "G4PionPlus.hh" >> 94 #include "G4PionMinus.hh" >> 95 #include "G4PionZero.hh" >> 96 #include "G4Eta.hh" >> 97 #include "G4EtaPrime.hh" >> 98 >> 99 #include "G4KaonPlus.hh" >> 100 #include "G4KaonMinus.hh" >> 101 #include "G4KaonZero.hh" >> 102 #include "G4AntiKaonZero.hh" >> 103 #include "G4KaonZeroLong.hh" >> 104 #include "G4KaonZeroShort.hh" >> 105 >> 106 // Baryons >> 107 #include "G4Proton.hh" >> 108 #include "G4AntiProton.hh" >> 109 #include "G4Neutron.hh" >> 110 #include "G4AntiNeutron.hh" >> 111 >> 112 // Nuclei >> 113 #include "G4Deuteron.hh" >> 114 #include "G4Triton.hh" >> 115 #include "G4Alpha.hh" >> 116 #include "G4GenericIon.hh" 95 117 96 G4IonConstructor pIonConstructor; << 118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 97 pIonConstructor.ConstructParticle(); << 98 119 99 G4ShortLivedConstructor pShortLivedConstruct << 120 void PhysicsList::ConstructParticle() 100 pShortLivedConstructor.ConstructParticle(); << 121 { >> 122 // pseudo-particles >> 123 G4Geantino::GeantinoDefinition(); >> 124 G4ChargedGeantino::ChargedGeantinoDefinition(); >> 125 >> 126 // gamma >> 127 G4Gamma::GammaDefinition(); >> 128 >> 129 // optical photon >> 130 G4OpticalPhoton::OpticalPhotonDefinition(); >> 131 >> 132 // leptons >> 133 G4Electron::ElectronDefinition(); >> 134 G4Positron::PositronDefinition(); >> 135 G4MuonPlus::MuonPlusDefinition(); >> 136 G4MuonMinus::MuonMinusDefinition(); >> 137 >> 138 G4NeutrinoE::NeutrinoEDefinition(); >> 139 G4AntiNeutrinoE::AntiNeutrinoEDefinition(); >> 140 G4NeutrinoMu::NeutrinoMuDefinition(); >> 141 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); >> 142 >> 143 // mesons >> 144 G4PionPlus::PionPlusDefinition(); >> 145 G4PionMinus::PionMinusDefinition(); >> 146 G4PionZero::PionZeroDefinition(); >> 147 G4Eta::EtaDefinition(); >> 148 G4EtaPrime::EtaPrimeDefinition(); >> 149 G4KaonPlus::KaonPlusDefinition(); >> 150 G4KaonMinus::KaonMinusDefinition(); >> 151 G4KaonZero::KaonZeroDefinition(); >> 152 G4AntiKaonZero::AntiKaonZeroDefinition(); >> 153 G4KaonZeroLong::KaonZeroLongDefinition(); >> 154 G4KaonZeroShort::KaonZeroShortDefinition(); >> 155 >> 156 // barions >> 157 G4Proton::ProtonDefinition(); >> 158 G4AntiProton::AntiProtonDefinition(); >> 159 G4Neutron::NeutronDefinition(); >> 160 G4AntiNeutron::AntiNeutronDefinition(); >> 161 >> 162 // ions >> 163 G4Deuteron::DeuteronDefinition(); >> 164 G4Triton::TritonDefinition(); >> 165 G4Alpha::AlphaDefinition(); >> 166 G4GenericIon::GenericIonDefinition(); 101 } 167 } 102 168 103 //....oooOO0OOooo........oooOO0OOooo........oo 169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 104 170 >> 171 #include "G4EmProcessOptions.hh" >> 172 105 void PhysicsList::ConstructProcess() 173 void PhysicsList::ConstructProcess() 106 { 174 { 107 // Transportation 175 // Transportation 108 // 176 // 109 AddTransportation(); 177 AddTransportation(); 110 178 111 // Electromagnetic physics list 179 // Electromagnetic physics list 112 // 180 // 113 fEmPhysicsList->ConstructProcess(); << 181 emPhysicsList->ConstructProcess(); 114 << 182 115 // Em options 183 // Em options 116 // 184 // 117 G4EmParameters* param = G4EmParameters::Inst << 185 G4EmProcessOptions emOptions; 118 param->SetIntegral(false); << 186 emOptions.SetStepFunction(1., 1*mm); >> 187 emOptions.SetIntegral(false); >> 188 emOptions.SetLossFluctuations(false); 119 } 189 } 120 190 121 //....oooOO0OOooo........oooOO0OOooo........oo 191 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 122 192 123 void PhysicsList::AddPhysicsList(const G4Strin 193 void PhysicsList::AddPhysicsList(const G4String& name) 124 { 194 { 125 if (verboseLevel > 0) { << 195 if (verboseLevel>0) { 126 G4cout << "PhysicsList::AddPhysicsList: <" 196 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; 127 } 197 } 128 << 198 129 if (name == fEmName) return; << 199 if (name == emName) return; 130 200 131 if (name == "standard") { 201 if (name == "standard") { 132 fEmName = name; << 202 133 delete fEmPhysicsList; << 203 emName = name; 134 fEmPhysicsList = new PhysListEmStandard(na << 204 delete emPhysicsList; 135 } << 205 emPhysicsList = new PhysListEmStandard(name); 136 else if (name == "livermore") { << 206 137 fEmName = name; << 207 } else if (name == "livermore") { 138 delete fEmPhysicsList; << 208 emName = name; 139 fEmPhysicsList = new PhysListEmLivermore(n << 209 delete emPhysicsList; 140 } << 210 emPhysicsList = new PhysListEmLivermore(name); 141 else if (name == "penelope") { << 211 142 fEmName = name; << 212 } else if (name == "penelope") { 143 delete fEmPhysicsList; << 213 emName = name; 144 fEmPhysicsList = new PhysListEmPenelope(na << 214 delete emPhysicsList; 145 } << 215 emPhysicsList = new PhysListEmPenelope(name); 146 else { << 216 >> 217 } else { 147 G4cout << "PhysicsList::AddPhysicsList: <" 218 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" 148 << " is not defined" << G4endl; << 219 << " is not defined" >> 220 << G4endl; 149 } 221 } 150 } 222 } 151 223 152 //....oooOO0OOooo........oooOO0OOooo........oo 224 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 153 225 154 #include "G4Electron.hh" << 155 #include "G4Gamma.hh" 226 #include "G4Gamma.hh" >> 227 #include "G4Electron.hh" 156 #include "G4Positron.hh" 228 #include "G4Positron.hh" 157 229 158 void PhysicsList::SetCuts() 230 void PhysicsList::SetCuts() >> 231 { >> 232 // set cut values for gamma at first and for e- second and next for e+, >> 233 // because some processes for e+/e- need cut values for gamma >> 234 SetCutValue(cutForGamma, "gamma"); >> 235 SetCutValue(cutForElectron, "e-"); >> 236 SetCutValue(cutForPositron, "e+"); >> 237 } >> 238 >> 239 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 240 >> 241 void PhysicsList::SetCutForGamma(G4double cut) 159 { 242 { 160 // fixe lower limit for cut << 243 cutForGamma = cut; 161 G4ProductionCutsTable::GetProductionCutsTabl << 244 SetParticleCuts(cutForGamma, G4Gamma::Gamma()); >> 245 } 162 246 163 // call base class method to set cuts which << 247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 164 // modified via /run/setCut/* commands << 165 G4VUserPhysicsList::SetCuts(); << 166 248 167 DumpCutValuesTable(); << 249 void PhysicsList::SetCutForElectron(G4double cut) >> 250 { >> 251 cutForElectron = cut; >> 252 SetParticleCuts(cutForElectron, G4Electron::Electron()); >> 253 } >> 254 >> 255 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 256 >> 257 void PhysicsList::SetCutForPositron(G4double cut) >> 258 { >> 259 cutForPositron = cut; >> 260 SetParticleCuts(cutForPositron, G4Positron::Positron()); 168 } 261 } 169 262 170 //....oooOO0OOooo........oooOO0OOooo........oo 263 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 171 264