Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:20:54

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file electromagnetic/TestEm16/src/PhysicsList.cc
0027 /// \brief Implementation of the PhysicsList class
0028 //
0029 //
0030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 
0033 #include "PhysicsList.hh"
0034 
0035 #include "PhysicsListMessenger.hh"
0036 
0037 #include "G4ComptonScattering.hh"
0038 #include "G4DecayPhysics.hh"
0039 #include "G4GammaConversion.hh"
0040 #include "G4MuBremsstrahlung.hh"
0041 #include "G4MuIonisation.hh"
0042 #include "G4MuMultipleScattering.hh"
0043 #include "G4MuPairProduction.hh"
0044 #include "G4ParticleDefinition.hh"
0045 #include "G4ParticleTable.hh"
0046 #include "G4ParticleTypes.hh"
0047 #include "G4PhotoElectricEffect.hh"
0048 #include "G4ProcessManager.hh"
0049 #include "G4ProcessTable.hh"
0050 #include "G4RayleighScattering.hh"
0051 #include "G4StepLimiter.hh"
0052 #include "G4SynchrotronRadiation.hh"
0053 #include "G4SynchrotronRadiationInMat.hh"
0054 #include "G4SystemOfUnits.hh"
0055 #include "G4XrayReflection.hh"
0056 #include "G4eBremsstrahlung.hh"
0057 #include "G4eIonisation.hh"
0058 #include "G4eMultipleScattering.hh"
0059 #include "G4eplusAnnihilation.hh"
0060 #include "G4hBremsstrahlung.hh"
0061 #include "G4hIonisation.hh"
0062 #include "G4hMultipleScattering.hh"
0063 #include "G4hPairProduction.hh"
0064 
0065 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0066 
0067 PhysicsList::PhysicsList() : G4VUserPhysicsList(), fMess(0)
0068 {
0069   SetDefaultCutValue(1. * km);
0070 
0071   fSRType = true;
0072   fMess = new PhysicsListMessenger(this);
0073   fDecayPhysics = new G4DecayPhysics();
0074 }
0075 
0076 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0077 
0078 void PhysicsList::ConstructParticle()
0079 {
0080   fDecayPhysics->ConstructParticle();
0081 }
0082 
0083 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0084 
0085 void PhysicsList::ConstructProcess()
0086 {
0087   AddTransportation();
0088   ConstructEM();
0089   fDecayPhysics->ConstructProcess();
0090 }
0091 
0092 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0093 
0094 void PhysicsList::ConstructEM()
0095 {
0096   auto particleIterator = GetParticleIterator();
0097   particleIterator->reset();
0098   auto fSync = new G4SynchrotronRadiation();
0099   while ((*particleIterator)()) {
0100     G4ParticleDefinition* particle = particleIterator->value();
0101     G4ProcessManager* pmanager = particle->GetProcessManager();
0102     G4String particleName = particle->GetParticleName();
0103 
0104     if (particleName == "gamma") {
0105       // gamma
0106       pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
0107       pmanager->AddDiscreteProcess(new G4ComptonScattering);
0108       pmanager->AddDiscreteProcess(new G4GammaConversion);
0109       pmanager->AddDiscreteProcess(new G4RayleighScattering);
0110       pmanager->AddDiscreteProcess(new G4XrayReflection);
0111     }
0112     else if (particleName == "e-") {
0113       // electron
0114       pmanager->AddProcess(new G4eMultipleScattering, -1, 1, -1);
0115       pmanager->AddProcess(new G4eIonisation, -1, 2, 1);
0116       pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 2);
0117       if (fSRType) {
0118         pmanager->AddProcess(fSync, -1, -1, 3);
0119       }
0120       else {
0121         pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1, -1, 3);
0122       }
0123       pmanager->AddProcess(new G4StepLimiter, -1, -1, 4);
0124     }
0125     else if (particleName == "e+") {
0126       // positron
0127       pmanager->AddProcess(new G4eMultipleScattering, -1, 1, -1);
0128       pmanager->AddProcess(new G4eIonisation, -1, 2, 1);
0129       pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 2);
0130       pmanager->AddProcess(new G4eplusAnnihilation, 0, -1, 3);
0131       if (fSRType) {
0132         pmanager->AddProcess(fSync, -1, -1, 4);
0133       }
0134       else {
0135         pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1, -1, 4);
0136       }
0137       pmanager->AddProcess(new G4StepLimiter, -1, -1, 5);
0138     }
0139     else if (particleName == "mu+" || particleName == "mu-") {
0140       // muon
0141       pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, -1);
0142       pmanager->AddProcess(new G4MuIonisation, -1, 2, 1);
0143       pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 2);
0144       pmanager->AddProcess(new G4MuPairProduction, -1, 4, 3);
0145       pmanager->AddProcess(fSync, -1, -1, 4);
0146       pmanager->AddProcess(new G4StepLimiter, -1, -1, 5);
0147     }
0148     else if (particleName == "proton") {
0149       // proton
0150       pmanager->AddProcess(new G4hMultipleScattering, -1, 1, -1);
0151       pmanager->AddProcess(new G4hIonisation, -1, 2, 1);
0152       pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 2);
0153       pmanager->AddProcess(new G4hPairProduction, -1, 4, 3);
0154       pmanager->AddProcess(fSync, -1, -1, 4);
0155       pmanager->AddProcess(new G4StepLimiter, -1, -1, 5);
0156     }
0157     else if (particle->GetPDGCharge() != 0.0 && !particle->IsShortLived()) {
0158       pmanager->AddProcess(fSync, -1, -1, 1);
0159     }
0160   }
0161 }
0162 
0163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0164 
0165 void PhysicsList::SetXrayReflectionRoughness(G4double SurfaceRoughness)
0166 {
0167   G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
0168   G4XrayReflection* XrayReflectionProcess =
0169     (G4XrayReflection*)theProcessTable->FindProcess("XrayReflection", "gamma");
0170   if (XrayReflectionProcess)
0171     XrayReflectionProcess->SetSurfaceRoughness(SurfaceRoughness);
0172   else
0173     G4cout << "Warning. No process XrayReflection found, "
0174               "SetXrayReflectionRoughness ignored"
0175            << G4endl;
0176 }
0177 
0178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......