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 // Code developed by: 26 // Code developed by: 27 // S.Larsson 27 // S.Larsson 28 // 28 // 29 // ******************************** 29 // ******************************** 30 // * * 30 // * * 31 // * PurgMagPhysicsList.cc * 31 // * PurgMagPhysicsList.cc * 32 // * * 32 // * * 33 // ******************************** 33 // ******************************** 34 // 34 // >> 35 // >> 36 // $Id: PurgMagPhysicsList.cc,v 1.5 2006/06/29 16:06:15 gunter Exp $ >> 37 // GEANT4 tag $Name: geant4-09-02-patch-04 $ >> 38 // >> 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 35 40 36 #include "PurgMagPhysicsList.hh" 41 #include "PurgMagPhysicsList.hh" 37 #include "G4SystemOfUnits.hh" << 42 38 #include "G4ParticleDefinition.hh" 43 #include "G4ParticleDefinition.hh" 39 #include "G4ParticleWithCuts.hh" 44 #include "G4ParticleWithCuts.hh" 40 #include "G4ProcessManager.hh" 45 #include "G4ProcessManager.hh" 41 #include "G4ParticleTypes.hh" 46 #include "G4ParticleTypes.hh" 42 #include "G4ParticleTable.hh" 47 #include "G4ParticleTable.hh" 43 #include "G4Material.hh" 48 #include "G4Material.hh" 44 #include "G4UnitsTable.hh" 49 #include "G4UnitsTable.hh" 45 #include "G4ios.hh" 50 #include "G4ios.hh" 46 #include "G4EmStandardPhysics_option4.hh" << 51 47 #include "G4VPhysicsConstructor.hh" << 52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 48 #include "G4DecayPhysics.hh" << 49 53 50 PurgMagPhysicsList::PurgMagPhysicsList(): G4V 54 PurgMagPhysicsList::PurgMagPhysicsList(): G4VUserPhysicsList() 51 { 55 { 52 defaultCutValue = 1*micrometer; 56 defaultCutValue = 1*micrometer; 53 cutForGamma = defaultCutValue; 57 cutForGamma = defaultCutValue; 54 cutForElectron = defaultCutValue; 58 cutForElectron = defaultCutValue; 55 cutForPositron = defaultCutValue; 59 cutForPositron = defaultCutValue; 56 cutForProton = defaultCutValue; 60 cutForProton = defaultCutValue; 57 << 61 58 fEmPhysicsList = new G4EmStandardPhysics_opt << 59 fDecPhysicsList = new G4DecayPhysics(); << 60 SetVerboseLevel(1); 62 SetVerboseLevel(1); 61 } 63 } 62 64 >> 65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 66 63 PurgMagPhysicsList::~PurgMagPhysicsList() 67 PurgMagPhysicsList::~PurgMagPhysicsList() >> 68 {} >> 69 >> 70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 71 >> 72 void PurgMagPhysicsList::ConstructParticle() >> 73 { >> 74 // In this method, static member functions should be called >> 75 // for all particles which you want to use. >> 76 // This ensures that objects of these particle types will be >> 77 // created in the program. >> 78 >> 79 ConstructBosons(); >> 80 ConstructLeptons(); >> 81 ConstructBarions(); >> 82 } >> 83 >> 84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 85 >> 86 void PurgMagPhysicsList::ConstructBosons() >> 87 { >> 88 >> 89 // gamma >> 90 G4Gamma::GammaDefinition(); >> 91 >> 92 // optical photon >> 93 G4OpticalPhoton::OpticalPhotonDefinition(); >> 94 } >> 95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 96 >> 97 void PurgMagPhysicsList::ConstructLeptons() 64 { 98 { 65 delete fDecPhysicsList; << 99 // leptons 66 delete fEmPhysicsList; << 100 G4Electron::ElectronDefinition(); >> 101 G4Positron::PositronDefinition(); 67 } 102 } 68 103 69 void PurgMagPhysicsList::ConstructParticle() << 104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 105 >> 106 void PurgMagPhysicsList::ConstructBarions() 70 { 107 { 71 fDecPhysicsList -> ConstructParticle(); << 108 // barions 72 } << 109 G4Proton::ProtonDefinition(); >> 110 G4AntiProton::AntiProtonDefinition(); >> 111 } >> 112 >> 113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 73 114 74 void PurgMagPhysicsList::ConstructProcess() 115 void PurgMagPhysicsList::ConstructProcess() 75 { 116 { 76 AddTransportation(); 117 AddTransportation(); 77 fEmPhysicsList -> ConstructProcess(); << 118 ConstructEM(); 78 << 119 ConstructGeneral(); 79 // Deexcitation << 80 // Both Fluorescence and Auger e- emission act << 81 //G4VAtomDeexcitation* de = new G4UAtomicDeexc << 82 //G4LossTableManager::Instance()->SetAtomDeexc << 83 //de -> SetFluo(true); << 84 //de -> SetAuger(true); << 85 } 120 } 86 121 >> 122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 123 >> 124 #include "G4MultipleScattering.hh" >> 125 // Bosons >> 126 #include "G4PhotoElectricEffect.hh" >> 127 #include "G4ComptonScattering.hh" >> 128 #include "G4GammaConversion.hh" >> 129 // Leptons >> 130 #include "G4eIonisation.hh" >> 131 #include "G4eBremsstrahlung.hh" >> 132 #include "G4eplusAnnihilation.hh" >> 133 >> 134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 135 >> 136 void PurgMagPhysicsList::ConstructEM() >> 137 { >> 138 theParticleIterator->reset(); >> 139 while( (*theParticleIterator)() ) >> 140 { >> 141 G4ParticleDefinition* particle = theParticleIterator->value(); >> 142 G4ProcessManager* pmanager = particle->GetProcessManager(); >> 143 G4String particleName = particle->GetParticleName(); >> 144 >> 145 >> 146 if (particleName == "gamma") { >> 147 //gamma >> 148 pmanager->AddDiscreteProcess(new G4GammaConversion); >> 149 pmanager->AddDiscreteProcess(new G4ComptonScattering); >> 150 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect); >> 151 >> 152 } else if (particleName == "e-") { >> 153 //electron >> 154 pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3); >> 155 pmanager->AddProcess(new G4eIonisation, -1, 2,2); >> 156 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); >> 157 >> 158 } else if (particleName == "e+") { >> 159 //positron >> 160 pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3); >> 161 pmanager->AddProcess(new G4eIonisation, -1, 2,2); >> 162 pmanager->AddProcess(new G4MultipleScattering, -1, 1,1); >> 163 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); >> 164 >> 165 } else if (particleName == "proton") { >> 166 //proton >> 167 pmanager->AddProcess(new G4MultipleScattering, -1,1,1); >> 168 >> 169 } else if (particleName == "anti_proton") { >> 170 //antiproton >> 171 pmanager->AddProcess(new G4MultipleScattering, -1,1,1); >> 172 } >> 173 } >> 174 } >> 175 >> 176 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 177 >> 178 void PurgMagPhysicsList::ConstructGeneral() >> 179 { } >> 180 >> 181 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 182 87 void PurgMagPhysicsList::SetCuts() 183 void PurgMagPhysicsList::SetCuts() 88 { 184 { 89 if (verboseLevel >0){ 185 if (verboseLevel >0){ 90 G4cout << "PurgMagPhysicsList::SetCuts:"; 186 G4cout << "PurgMagPhysicsList::SetCuts:"; 91 G4cout << "CutLength : " << G4BestUnit(def 187 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl; 92 } 188 } 93 189 94 // set cut values for gamma at first and for 190 // set cut values for gamma at first and for e- second and next for e+, 95 // because some processes for e+/e- need cut 191 // because some processes for e+/e- need cut values for gamma 96 SetCutValue(cutForGamma, "gamma"); 192 SetCutValue(cutForGamma, "gamma"); 97 SetCutValue(cutForElectron, "e-"); 193 SetCutValue(cutForElectron, "e-"); 98 SetCutValue(cutForPositron, "e+"); 194 SetCutValue(cutForPositron, "e+"); 99 195 100 // set cut values for proton and anti_proton 196 // set cut values for proton and anti_proton before all other hadrons 101 // because some processes for hadrons need c 197 // because some processes for hadrons need cut values for proton/anti_proton 102 SetCutValue(cutForProton, "proton"); 198 SetCutValue(cutForProton, "proton"); 103 SetCutValue(cutForProton, "anti_proton"); 199 SetCutValue(cutForProton, "anti_proton"); 104 200 105 // SetCutValueForOthers(defaultCutValue); << 201 // SetCutValueForOthers(defaultCutValue); 106 202 107 if (verboseLevel>0) DumpCutValuesTable(); 203 if (verboseLevel>0) DumpCutValuesTable(); 108 } 204 } 109 205 >> 206 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 207 110 void PurgMagPhysicsList::SetGammaLowLimit(G4do 208 void PurgMagPhysicsList::SetGammaLowLimit(G4double lowcut) 111 { 209 { 112 if (verboseLevel >0){ 210 if (verboseLevel >0){ 113 G4cout << "PurgMagPhysicsList::SetCuts:"; 211 G4cout << "PurgMagPhysicsList::SetCuts:"; 114 G4cout << "Gamma cut in energy: " << lowcu 212 G4cout << "Gamma cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 115 } 213 } 116 214 117 // G4Gamma::SetEnergyRange(lowcut,1e5); 215 // G4Gamma::SetEnergyRange(lowcut,1e5); 118 SetGELowLimit(lowcut); 216 SetGELowLimit(lowcut); 119 } 217 } 120 218 >> 219 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 220 121 void PurgMagPhysicsList::SetElectronLowLimit(G 221 void PurgMagPhysicsList::SetElectronLowLimit(G4double lowcut) 122 { 222 { 123 if (verboseLevel >0){ 223 if (verboseLevel >0){ 124 224 125 G4cout << "PurgMagPhysicsList::SetCuts:"; 225 G4cout << "PurgMagPhysicsList::SetCuts:"; 126 G4cout << "Electron cut in energy: " << lo 226 G4cout << "Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 127 } 227 } 128 228 129 // G4Electron::SetEnergyRange(lowcut,1e5); 229 // G4Electron::SetEnergyRange(lowcut,1e5); 130 SetGELowLimit(lowcut); 230 SetGELowLimit(lowcut); 131 } 231 } 132 232 >> 233 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 234 133 void PurgMagPhysicsList::SetPositronLowLimit(G 235 void PurgMagPhysicsList::SetPositronLowLimit(G4double lowcut) 134 { 236 { 135 if (verboseLevel >0){ 237 if (verboseLevel >0){ 136 238 137 G4cout << "PurgMagPhysicsList::SetCuts:"; 239 G4cout << "PurgMagPhysicsList::SetCuts:"; 138 G4cout << "Positron cut in energy: " << lo 240 G4cout << "Positron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 139 } 241 } 140 242 141 G4cerr << "PurgMagPhysicsList::SetPositronLo 243 G4cerr << "PurgMagPhysicsList::SetPositronLowLimit: Not currently able to set Positron LowLimit." << G4endl; 142 G4Exception("PurgMagPhysicsList::SetPositron << 244 G4Exception("Positron Low Limit: not implemented in PurgMagPhysicsList"); 143 FatalException,"Positron Low Limit: no << 144 // 245 // 145 // G4Positron::SetEnergyRange(lowcut,1e5); 246 // G4Positron::SetEnergyRange(lowcut,1e5); 146 } 247 } 147 248 >> 249 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 148 250 149 void PurgMagPhysicsList::SetProtonLowLimit(G4d 251 void PurgMagPhysicsList::SetProtonLowLimit(G4double lowcut) 150 { 252 { 151 if (verboseLevel >0){ 253 if (verboseLevel >0){ 152 254 153 G4cout << "PurgMagPhysicsList::SetCuts:"; 255 G4cout << "PurgMagPhysicsList::SetCuts:"; 154 G4cout << "Proton cut in energy: " << lowc 256 G4cout << "Proton cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 155 } 257 } 156 258 157 G4cerr << "PurgMagPhysicsList::SetProtonLowL 259 G4cerr << "PurgMagPhysicsList::SetProtonLowLimit: Not currently able to set Proton LowLimit." << G4endl; 158 G4Exception("PurgMagPhysicsList::SetProtonLo << 260 G4Exception("Proton Low Limit: not implemented in PurgMagPhysicsList"); 159 FatalException,"Proton Low Limit: not << 160 // 261 // 161 // G4Proton::SetEnergyRange(lowcut,1e5); 262 // G4Proton::SetEnergyRange(lowcut,1e5); 162 // G4AntiProton::SetEnergyRange(lowcut,1e5); 263 // G4AntiProton::SetEnergyRange(lowcut,1e5); 163 } 264 } 164 265 >> 266 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 267 165 void PurgMagPhysicsList::SetGEPLowLimit(G4doub 268 void PurgMagPhysicsList::SetGEPLowLimit(G4double lowcut) 166 { 269 { 167 if (verboseLevel >0){ 270 if (verboseLevel >0){ 168 G4cout << "PurgMagPhysicsList::SetGEPLowLi 271 G4cout << "PurgMagPhysicsList::SetGEPLowLimit:"; 169 G4cout << "Gamma and Electron cut in energ 272 G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 170 } 273 } 171 274 172 // G4Gamma::SetEnergyRange(lowcut,1e5); 275 // G4Gamma::SetEnergyRange(lowcut,1e5); 173 // G4Electron::SetEnergyRange(lowcut,1e5); 276 // G4Electron::SetEnergyRange(lowcut,1e5); 174 // G4Positron::SetEnergyRange(lowcut,1e5); 277 // G4Positron::SetEnergyRange(lowcut,1e5); 175 this->SetGELowLimit(lowcut); 278 this->SetGELowLimit(lowcut); 176 279 177 G4cerr << " SetGEPLowLimit : Uncertain wheth 280 G4cerr << " SetGEPLowLimit : Uncertain whether setting Positron low limit " << G4endl; 178 } 281 } >> 282 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 179 283 >> 284 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 180 void PurgMagPhysicsList::SetGELowLimit(G4doubl 285 void PurgMagPhysicsList::SetGELowLimit(G4double lowcut) 181 { 286 { 182 if (verboseLevel >0){ 287 if (verboseLevel >0){ 183 G4cout << "PurgMagPhysicsList::SetGELowLim 288 G4cout << "PurgMagPhysicsList::SetGELowLimit:"; 184 G4cout << "Gamma and Electron cut in energ 289 G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 185 } 290 } 186 291 187 G4ProductionCutsTable::GetProductionCutsTabl 292 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowcut,1e5); 188 } 293 } 189 void PurgMagPhysicsList::SetGammaCut(G4double 294 void PurgMagPhysicsList::SetGammaCut(G4double val) 190 { 295 { >> 296 ResetCuts(); 191 cutForGamma = val; 297 cutForGamma = val; 192 } 298 } 193 299 >> 300 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 301 194 void PurgMagPhysicsList::SetElectronCut(G4doub 302 void PurgMagPhysicsList::SetElectronCut(G4double val) 195 { 303 { >> 304 // ResetCuts(); 196 cutForElectron = val; 305 cutForElectron = val; 197 } 306 } 198 307 >> 308 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 309 199 void PurgMagPhysicsList::SetPositronCut(G4doub 310 void PurgMagPhysicsList::SetPositronCut(G4double val) 200 { 311 { >> 312 // ResetCuts(); 201 cutForPositron = val; 313 cutForPositron = val; 202 } 314 } 203 315 >> 316 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 317 204 void PurgMagPhysicsList::SetProtonCut(G4double 318 void PurgMagPhysicsList::SetProtonCut(G4double val) 205 { 319 { >> 320 //ResetCuts(); 206 cutForProton = val; 321 cutForProton = val; 207 } 322 } >> 323 >> 324 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 208 325 209 326 210 327 211 328 212 329 213 330 214 331