Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:17:11

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 // ClassName: G4EmStandardPhysics_SpacePhysics
0027 //
0028 // Authors: P.Dondero (paolo.dondero@cern.ch)
0029 //
0030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 
0033 
0034 #include "G4EmStandardPhysics_SpacePhysics.hh"
0035 
0036 #include "G4SystemOfUnits.hh"
0037 #include "G4ParticleDefinition.hh"
0038 #include "G4LossTableManager.hh"
0039 #include "G4EmParameters.hh"
0040 #include "G4EmBuilder.hh"
0041 
0042 #include "G4ComptonScattering.hh"
0043 #include "G4GammaConversion.hh"
0044 #include "G4PhotoElectricEffect.hh"
0045 #include "G4RayleighScattering.hh"
0046 #include "G4PEEffectFluoModel.hh"
0047 #include "G4KleinNishinaModel.hh"
0048 #include "G4BetheHeitler5DModel.hh"
0049 #include "G4LivermorePhotoElectricModel.hh"
0050 #include "G4LivermorePolarizedRayleighModel.hh"
0051 #include "G4PhotoElectricAngularGeneratorPolarized.hh"
0052 #include "G4LowEPComptonModel.hh"
0053 #include "G4LowEPPolarizedComptonModel.hh"
0054 
0055 #include "G4eMultipleScattering.hh"
0056 #include "G4hMultipleScattering.hh"
0057 #include "G4MscStepLimitType.hh"
0058 #include "G4UrbanMscModel.hh"
0059 #include "G4GoudsmitSaundersonMscModel.hh"
0060 #include "G4DummyModel.hh"
0061 #include "G4WentzelVIModel.hh"
0062 #include "G4CoulombScattering.hh"
0063 #include "G4eCoulombScatteringModel.hh"
0064 
0065 #include "G4eIonisation.hh"
0066 #include "G4eBremsstrahlung.hh"
0067 #include "G4Generator2BS.hh"
0068 #include "G4Generator2BN.hh"
0069 #include "G4SeltzerBergerModel.hh"
0070 #include "G4ePairProduction.hh"
0071 #include "G4LivermoreIonisationModel.hh"
0072 #include "G4PenelopeIonisationModel.hh"
0073 #include "G4UniversalFluctuation.hh"
0074 #include "G4UrbanFluctuation.hh"
0075 
0076 #include "G4eplusAnnihilation.hh"
0077 #include "G4hIonisation.hh"
0078 #include "G4ionIonisation.hh"
0079 #include "G4IonParametrisedLossModel.hh"
0080 #include "G4NuclearStopping.hh"
0081 #include "G4Gamma.hh"
0082 #include "G4Electron.hh"
0083 #include "G4Positron.hh"
0084 #include "G4GenericIon.hh"
0085 #include "G4PhysicsListHelper.hh"
0086 #include "G4BuilderType.hh"
0087 #include "G4EmModelActivator.hh"
0088 #include "G4GammaGeneralProcess.hh"
0089 
0090 // factory
0091 #include "G4PhysicsConstructorFactory.hh"
0092 
0093 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0094 
0095 G4EmStandardPhysics_SpacePhysics::G4EmStandardPhysics_SpacePhysics(G4int ver, const G4String&)
0096   : G4VPhysicsConstructor("G4EmStandard_SpacePhysics"), fVerbose(ver)
0097 {
0098   G4cout << "---> Using G4EmStandard_SpacePhysics v. 11.03 " << G4endl;
0099   G4EmParameters* param = G4EmParameters::Instance();
0100   param->SetDefaults();
0101   param->SetVerbose(ver);
0102   param->SetMinEnergy(100*CLHEP::eV);
0103   param->SetLowestElectronEnergy(50*CLHEP::eV);
0104   param->SetNumberOfBinsPerDecade(20);
0105   param->ActivateAngularGeneratorForIonisation(true);
0106   param->SetStepFunction(0.2, 10*CLHEP::um);
0107   param->SetStepFunctionMuHad(0.05, 0.01*CLHEP::um);
0108   param->SetStepFunctionLightIons(0.1, 20*CLHEP::um);
0109   param->SetStepFunctionIons(0.1, 1*CLHEP::um);
0110   param->SetUseMottCorrection(true); // use Mott-correction for e-/e+ msc gs
0111   param->SetMscStepLimitType(fUseSafetyPlus); // for e-/e+ msc gs
0112   param->SetMscSkin(3);              // error-free stepping for e-/e+ msc gs
0113   param->SetMscRangeFactor(0.08);    // error-free stepping for e-/e+ msc gs
0114   param->SetMuHadLateralDisplacement(true);
0115   param->SetFluo(true);
0116   param->SetUseICRU90Data(true);
0117   param->SetMaxNIELEnergy(1*CLHEP::MeV);
0118   SetPhysicsType(bElectromagnetic);
0119 }
0120 
0121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0122 
0123 void G4EmStandardPhysics_SpacePhysics::ConstructParticle()
0124 {
0125   // minimal set of particles for EM physics
0126   G4EmBuilder::ConstructMinimalEmSet();
0127 }
0128 
0129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0130 
0131 void G4EmStandardPhysics_SpacePhysics::ConstructProcess()
0132 {
0133   if(fVerbose > 1)
0134   {
0135     G4cout << "### " << GetPhysicsName() << " Construct Space Physics Processes " << G4endl;
0136   }
0137   G4EmBuilder::PrepareEMPhysics();
0138 
0139   G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0140   G4EmParameters* param = G4EmParameters::Instance();
0141 
0142   // processes used by several particles
0143   G4hMultipleScattering* hmsc = new G4hMultipleScattering("ionmsc");
0144 
0145   // nuclear stopping is enabled if the energy limit above zero
0146   G4double nielEnergyLimit = param->MaxNIELEnergy();
0147   G4NuclearStopping* pnuc = nullptr;
0148   if(nielEnergyLimit > 0.0)
0149   {
0150     pnuc = new G4NuclearStopping();
0151     pnuc->SetMaxKinEnergy(nielEnergyLimit);
0152   }
0153 
0154   // high energy limit for e+- scattering models and bremsstrahlung
0155   G4double highEnergyLimit = param->MscEnergyLimit();
0156 
0157   // Add gamma EM Processes
0158   G4ParticleDefinition* particle = G4Gamma::Gamma();
0159   G4bool polar = param->EnablePolarisation();
0160 
0161   // Photoelectric
0162   G4PhotoElectricEffect* pe = new G4PhotoElectricEffect();
0163   G4VEmModel* peModel = new G4LivermorePhotoElectricModel();
0164   pe->SetEmModel(peModel);
0165   if(polar)
0166   {
0167     peModel->SetAngularDistribution(new G4PhotoElectricAngularGeneratorPolarized());
0168   }
0169 
0170   // Compton scattering
0171   G4ComptonScattering* cs = new G4ComptonScattering;
0172   cs->SetEmModel(new G4KleinNishinaModel());
0173   G4VEmModel* cModel = nullptr;
0174   if(polar)
0175   {
0176     cModel = new G4LowEPPolarizedComptonModel();
0177   }
0178   else
0179   {
0180     cModel = new G4LowEPComptonModel();
0181   }
0182   cModel->SetHighEnergyLimit(20*CLHEP::MeV);
0183   cs->AddEmModel(0, cModel);
0184 
0185   // Gamma conversion
0186   G4GammaConversion* gc = new G4GammaConversion();
0187   G4VEmModel* conv = new G4BetheHeitler5DModel();
0188   gc->SetEmModel(conv);
0189 
0190   // default Rayleigh scattering is Livermore
0191   G4RayleighScattering* rl = new G4RayleighScattering();
0192   if(polar)
0193   {
0194     rl->SetEmModel(new G4LivermorePolarizedRayleighModel());
0195   }
0196 
0197   if(param->GeneralProcessActive())
0198   {
0199     G4GammaGeneralProcess* sp = new G4GammaGeneralProcess();
0200     sp->AddEmProcess(pe);
0201     sp->AddEmProcess(cs);
0202     sp->AddEmProcess(gc);
0203     sp->AddEmProcess(rl);
0204     G4LossTableManager::Instance()->SetGammaGeneralProcess(sp);
0205     ph->RegisterProcess(sp, particle);
0206   }
0207   else
0208   {
0209     ph->RegisterProcess(pe, particle);
0210     ph->RegisterProcess(cs, particle);
0211     ph->RegisterProcess(gc, particle);
0212     ph->RegisterProcess(rl, particle);
0213   }
0214 
0215   // e-
0216   particle = G4Electron::Electron();
0217 
0218   // multiple scattering
0219   G4eMultipleScattering* msc = new G4eMultipleScattering();
0220   // e-/e+ msc gs with Mott-correction
0221   // (Mott-correction is set through G4EmParameters)
0222   G4GoudsmitSaundersonMscModel* msc1 = new G4GoudsmitSaundersonMscModel();
0223   G4WentzelVIModel* msc2 = new G4WentzelVIModel();
0224   msc1->SetHighEnergyLimit(highEnergyLimit);
0225   msc2->SetLowEnergyLimit(highEnergyLimit);
0226   msc->SetEmModel(msc1);
0227   msc->SetEmModel(msc2);
0228 
0229   auto *ssm = new G4eCoulombScatteringModel();
0230   G4CoulombScattering* ss = new G4CoulombScattering();
0231   ss->SetEmModel(ssm);
0232   ss->SetMinKinEnergy(highEnergyLimit);
0233   ssm->SetLowEnergyLimit(highEnergyLimit);
0234   ssm->SetActivationLowEnergyLimit(highEnergyLimit);
0235 
0236   // ionisation
0237   G4eIonisation* eioni = new G4eIonisation();
0238   G4VEmModel* theIoniLiv = new G4LivermoreIonisationModel();
0239   eioni->SetFluctModel(new G4UrbanFluctuation());
0240   theIoniLiv->SetHighEnergyLimit(0.1*CLHEP::MeV);
0241   eioni->AddEmModel(0, theIoniLiv, new G4UniversalFluctuation() );
0242 
0243   // bremsstrahlung
0244   G4eBremsstrahlung* brem = new G4eBremsstrahlung();
0245   G4SeltzerBergerModel* br1 = new G4SeltzerBergerModel();
0246   G4eBremsstrahlungRelModel* br2 = new G4eBremsstrahlungRelModel();
0247   br1->SetAngularDistribution(new G4Generator2BS());
0248   br2->SetAngularDistribution(new G4Generator2BS());
0249   brem->SetEmModel(br1);
0250   brem->SetEmModel(br2);
0251   br1->SetHighEnergyLimit(CLHEP::GeV);
0252 
0253   G4ePairProduction* ee = new G4ePairProduction();
0254 
0255   // register processes
0256   ph->RegisterProcess(msc, particle);
0257   ph->RegisterProcess(eioni, particle);
0258   ph->RegisterProcess(brem, particle);
0259   ph->RegisterProcess(ee, particle);
0260   ph->RegisterProcess(ss, particle);
0261 
0262   // e+
0263   particle = G4Positron::Positron();
0264 
0265   // multiple scattering
0266   msc = new G4eMultipleScattering();
0267   // e-/e+ msc gs with Mott-correction
0268   // (Mott-correction is set through G4EmParameters)
0269   msc1 = new G4GoudsmitSaundersonMscModel();
0270   msc2 = new G4WentzelVIModel();
0271   msc1->SetHighEnergyLimit(highEnergyLimit);
0272   msc2->SetLowEnergyLimit(highEnergyLimit);
0273   msc->SetEmModel(msc1);
0274   msc->SetEmModel(msc2);
0275 
0276   ssm = new G4eCoulombScatteringModel();
0277   ss = new G4CoulombScattering();
0278   ss->SetEmModel(ssm);
0279   ss->SetMinKinEnergy(highEnergyLimit);
0280   ssm->SetLowEnergyLimit(highEnergyLimit);
0281   ssm->SetActivationLowEnergyLimit(highEnergyLimit);
0282 
0283   // ionisation
0284   eioni = new G4eIonisation();
0285   eioni->SetFluctModel(new G4UrbanFluctuation());
0286   G4VEmModel* pen = new G4PenelopeIonisationModel();
0287   pen->SetHighEnergyLimit(0.1*CLHEP::MeV);
0288   eioni->AddEmModel(0, pen, new G4UniversalFluctuation());
0289 
0290   // bremsstrahlung
0291   brem = new G4eBremsstrahlung();
0292   br1 = new G4SeltzerBergerModel();
0293   br2 = new G4eBremsstrahlungRelModel();
0294   br1->SetAngularDistribution(new G4Generator2BS());
0295   br2->SetAngularDistribution(new G4Generator2BS());
0296   brem->SetEmModel(br1);
0297   brem->SetEmModel(br2);
0298   br1->SetHighEnergyLimit(CLHEP::GeV);
0299 
0300   // register processes
0301   ph->RegisterProcess(msc, particle);
0302   ph->RegisterProcess(eioni, particle);
0303   ph->RegisterProcess(brem, particle);
0304   ph->RegisterProcess(ee, particle);
0305   ph->RegisterProcess(new G4eplusAnnihilation(), particle);
0306   ph->RegisterProcess(ss, particle);
0307 
0308   // generic ion
0309   particle = G4GenericIon::GenericIon();
0310   G4ionIonisation* ionIoni = new G4ionIonisation();
0311   ionIoni->SetEmModel(new G4IonParametrisedLossModel());
0312   ph->RegisterProcess(hmsc, particle);
0313   ph->RegisterProcess(ionIoni, particle);
0314   if(nullptr != pnuc)
0315   {
0316     ph->RegisterProcess(pnuc, particle);
0317   }
0318 
0319   // muons, hadrons, ions
0320   G4EmBuilder::ConstructCharged(hmsc, pnuc);
0321 
0322   // extra configuration
0323   G4EmModelActivator mact(GetPhysicsName());
0324 }
0325 
0326 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......