Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 27 #include "eRositaPhysicsList.hh" 28 29 #include "globals.hh" 30 #include "G4ios.hh" 31 #include "G4ParticleDefinition.hh" 32 #include "G4ParticleTypes.hh" 33 #include "G4PhysicsListHelper.hh" 34 #include "G4ProductionCutsTable.hh" 35 #include "G4StepLimiter.hh" 36 #include "G4SystemOfUnits.hh" 37 #include "G4VPhysicsConstructor.hh" 38 39 // Physics List 40 #include "G4DecayPhysics.hh" 41 #include "G4EmLivermorePhysics.hh" 42 #include "G4EmPenelopePhysics.hh" 43 #include "G4EmStandardPhysics.hh" 44 45 // Process 46 #include "G4ComptonScattering.hh" 47 #include "G4eBremsstrahlung.hh" 48 #include "G4eIonisation.hh" 49 #include "G4eMultipleScattering.hh" 50 #include "G4eplusAnnihilation.hh" 51 #include "G4GammaConversion.hh" 52 #include "G4hImpactIonisation.hh" 53 #include "G4hIonisation.hh" 54 #include "G4hMultipleScattering.hh" 55 #include "G4ionIonisation.hh" 56 #include "G4PhotoElectricEffect.hh" 57 #include "G4RayleighScattering.hh" 58 59 // Model 60 #include "G4LivermoreBremsstrahlungModel.hh" 61 #include "G4LivermoreComptonModel.hh" 62 #include "G4LivermoreGammaConversionModel.hh" 63 #include "G4LivermoreIonisationModel.hh" 64 #include "G4LivermorePhotoElectricModel.hh" 65 #include "G4LivermoreRayleighModel.hh" 66 #include "G4PenelopeAnnihilationModel.hh" 67 #include "G4UniversalFluctuation.hh" 68 69 //....oooOO0OOooo........oooOO0OOooo........oo 70 71 eRositaPhysicsList::eRositaPhysicsList() 72 { 73 SetVerboseLevel(1); 74 75 constexpr auto DEFAULT_CUT_VALUE{0.001 * m 76 SetDefaultCutValue(DEFAULT_CUT_VALUE); 77 78 G4cout << "=============================== 79 << G4endl 80 << "Geant4 eRosita example, base 81 << G4endl 82 << "Further details can be found 83 << G4endl 84 << " M. G. Pia et al.," 85 << G4endl 86 << " 'PIXE Simulation With Gean 87 << G4endl 88 << " IEEE Trans. Nucl. Sci., vo 89 << G4endl 90 << " N. Meidinger et al.," 91 << G4endl 92 << " 'Development of the focal 93 << G4endl 94 << " NIM A 624, 321-329, 2010" 95 << G4endl 96 << "============================ 97 << G4endl; 98 99 G4cout << G4endl; 100 } 101 102 //....oooOO0OOooo........oooOO0OOooo........oo 103 104 eRositaPhysicsList::~eRositaPhysicsList() 105 { 106 } 107 108 //....oooOO0OOooo........oooOO0OOooo........oo 109 110 void eRositaPhysicsList::ConstructBosons() 111 { 112 // geantino (pseudo-particle) 113 // G4Geantino::GeantinoDefinition(); 114 115 // charged geantino (pseudo-particle) 116 // G4ChargedGeantino::ChargedGeantinoDefin 117 118 // photon (gamma) 119 G4Gamma::GammaDefinition(); 120 } 121 122 //....oooOO0OOooo........oooOO0OOooo........oo 123 124 void eRositaPhysicsList::ConstructLeptons() 125 { 126 // leptons 127 128 // e+ / e- 129 G4Electron::ElectronDefinition(); 130 G4Positron::PositronDefinition(); 131 132 // mu+ / mu- 133 // G4MuonPlus::MuonPlusDefinition(); 134 // G4MuonMinus::MuonMinusDefinition(); 135 136 // nu_e 137 // G4NeutrinoE::NeutrinoEDefinition(); 138 // G4AntiNeutrinoE::AntiNeutrinoEDefinitio 139 140 // nu_mu 141 // G4NeutrinoMu::NeutrinoMuDefinition(); 142 // G4AntiNeutrinoMu::AntiNeutrinoMuDefinit 143 } 144 145 //....oooOO0OOooo........oooOO0OOooo........oo 146 147 void eRositaPhysicsList::ConstructMesons() 148 { 149 // light mesons 150 151 // pion 152 // G4PionPlus::PionPlusDefinition(); 153 // G4PionMinus::PionMinusDefinition(); 154 // G4PionZero::PionZeroDefinition(); 155 156 // eta 157 // G4Eta::EtaDefinition(); 158 // G4EtaPrime::EtaPrimeDefinition(); 159 160 // kaon 161 // G4KaonPlus::KaonPlusDefinition(); 162 // G4KaonMinus::KaonMinusDefinition(); 163 // G4KaonZero::KaonZeroDefinition(); 164 // G4AntiKaonZero::AntiKaonZeroDefinition( 165 // G4KaonZeroLong::KaonZeroLongDefinition( 166 // G4KaonZeroShort::KaonZeroShortDefinitio 167 } 168 169 //....oooOO0OOooo........oooOO0OOooo........oo 170 171 void eRositaPhysicsList::ConstructBaryons() 172 { 173 // baryons 174 175 // proton 176 G4Proton::ProtonDefinition(); 177 G4AntiProton::AntiProtonDefinition(); 178 179 // neutron 180 // G4Neutron::NeutronDefinition(); 181 // G4AntiNeutron::AntiNeutronDefinition(); 182 } 183 184 //....oooOO0OOooo........oooOO0OOooo........oo 185 186 void eRositaPhysicsList::ConstructParticle() 187 { 188 ConstructBosons(); 189 ConstructLeptons(); 190 ConstructMesons(); 191 ConstructBaryons(); 192 } 193 194 //....oooOO0OOooo........oooOO0OOooo........oo 195 196 void eRositaPhysicsList::ConstructEM() 197 { 198 auto *helper = G4PhysicsListHelper::GetPhy 199 200 auto particleIterator = GetParticleIterato 201 particleIterator->reset(); 202 203 while ((*particleIterator)()) { 204 auto *particle = particleIterator->val 205 auto particleName = particle->GetParti 206 207 if (particleName == "gamma") { // phot 208 // photoelectric effect 209 auto *photoelectricEffect = new G4 210 // photoelectricEffect->ActivateAu 211 // photoelectricEffect->SetCutForL 212 // photoelectricEffect->SetCutForL 213 photoelectricEffect->SetEmModel(ne 214 helper->RegisterProcess(photoelect 215 216 // Compton scattering 217 auto *comptonScattering = new G4Co 218 comptonScattering->SetEmModel(new 219 helper->RegisterProcess(comptonSca 220 221 // gamma conversion 222 auto *gammaConversion = new G4Gamm 223 gammaConversion->SetEmModel(new G4 224 helper->RegisterProcess(gammaConve 225 226 // Rayleigh scattering 227 auto *rayleighScattering = new G4R 228 rayleighScattering->SetEmModel(new 229 helper->RegisterProcess(rayleighSc 230 } else if (particleName == "e-") { // 231 // multiple scattering 232 helper->RegisterProcess(new G4eMul 233 234 // ionization 235 auto *ionization = new G4eIonisati 236 ionization->SetEmModel(new G4Liver 237 ionization->SetFluctModel(new G4Un 238 helper->RegisterProcess(ionization 239 240 // Bremsstrahlung 241 auto *bremsstrahlung = new G4eBrem 242 bremsstrahlung->SetEmModel(new G4L 243 helper->RegisterProcess(bremsstrah 244 } else if (particleName == "e+") { // 245 // multiple scattering 246 helper->RegisterProcess(new G4eMul 247 248 // ionization 249 helper->RegisterProcess(new G4eIon 250 251 // Bremsstrahlung 252 auto *bremsstrahlung = new G4eBrem 253 bremsstrahlung->SetEmModel(new G4L 254 helper->RegisterProcess(bremsstrah 255 256 // annihilation 257 auto *annihilation = new G4eplusAn 258 annihilation->SetEmModel(new G4Pen 259 helper->RegisterProcess(annihilati 260 // } else if( particleName == "mu+" || 261 // // muon 262 // helper->RegisterProcess(new G4M 263 // helper->RegisterProcess(new G4M 264 // helper->RegisterProcess(new G4M 265 // helper->RegisterProcess(new G4M 266 } else if (particleName == "proton" || 267 helper->RegisterProcess(new G4hMul 268 helper->RegisterProcess(new G4hIon 269 /* 270 // proton 271 // auto *ionization = new G4hImpac 272 // ionization->SetPixeCrossSection 273 // ionization->SetPixeCrossSection 274 // ionization->SetPixeCrossSection 275 // ionization->SetPixeProjectileMi 276 // ionization->SetPixeProjectileMa 277 // ionization->SetCutForSecondaryP 278 // ionization->SetCutForAugerElect 279 280 auto *ionization = new G4hIonisati 281 auto *multipleScattering = new G4h 282 283 processManager->AddProcess(multipl 284 processManager->AddProcess(ionizat 285 */ 286 } else if (particleName == "alpha" || 287 // pion, alpha, ion (should never 288 helper->RegisterProcess(new G4hMul 289 helper->RegisterProcess(new G4ionI 290 } else if ((!particle->IsShortLived()) 291 // every other charged particle, e 292 helper->RegisterProcess(new G4hMul 293 helper->RegisterProcess(new G4hIon 294 } 295 } 296 } 297 298 //....oooOO0OOooo........oooOO0OOooo........oo 299 300 void eRositaPhysicsList::ConstructGeneral() 301 { 302 auto *helper = G4PhysicsListHelper::GetPhy 303 304 // Add decay process 305 auto *decay = new G4Decay(); 306 307 auto particleIterator = GetParticleIterato 308 particleIterator->reset(); 309 310 while ((*particleIterator)()) { 311 auto *particle = particleIterator->val 312 313 if (decay->IsApplicable(*particle)) { 314 if (verboseLevel > 1) { 315 G4cout << "### Decays for " << 316 } 317 helper->RegisterProcess(decay, par 318 /* 319 // Set ordering for PostStepDoIt a 320 processManager->SetProcessOrdering 321 processManager->SetProcessOrdering 322 */ 323 } 324 } 325 } 326 327 //....oooOO0OOooo........oooOO0OOooo........oo 328 329 void eRositaPhysicsList::ConstructProcess() 330 { 331 AddTransportation(); 332 ConstructEM(); 333 ConstructGeneral(); 334 // AddStepMax(); 335 } 336 337 //....oooOO0OOooo........oooOO0OOooo........oo 338 339 void eRositaPhysicsList::SetCuts() 340 { 341 // Set the default cut value for all parti 342 SetCutsWithDefault(); 343 344 // Set the secondary production cut lower 345 constexpr auto ENERGY_LOW_LIMIT{250. * eV} 346 constexpr auto ENERGY_HIGH_LIMIT{100. * Ge 347 348 G4ProductionCutsTable::GetProductionCutsTa 349 350 if (verboseLevel > 0) { 351 DumpCutValuesTable(); 352 } 353 } 354 355 //....oooOO0OOooo........oooOO0OOooo........oo 356 357 /* 358 #include "G4StepLimiter.hh" 359 #include "G4UserSpecialCuts.hh" 360 361 void eRositaPhysicsList::AddStepMax() 362 { 363 auto *helper = G4PhysicsListHelper::GetPhy 364 365 // Step limitation seen as a process 366 // auto *stepLimiter = new G4StepLimiter() 367 // // auto *userCuts = new G4UserSpecialCu 368 369 particleIterator->reset(); 370 371 while ((*particleIterator)()){ 372 auto *particle = particleIterator->val 373 // auto *processManager = particle->Ge 374 375 if (particle->GetPDGCharge() != 0.0) { 376 helper->RegisterProcess(stepLimite 377 // helper->RegisterProcess(userCut 378 } 379 } 380 } 381 */ 382