Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 08:29:42

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 PhysicsList.cc
0027 /// \brief Implementation of the PhysicsList class
0028 
0029 #include "PhysicsList.hh"
0030 
0031 #include "PhysListEmLivermore.hh"
0032 #include "PhysListEmPenelope.hh"
0033 #include "PhysListEmStandard.hh"
0034 #include "PhysicsListMessenger.hh"
0035 
0036 #include "G4LossTableManager.hh"
0037 #include "G4SystemOfUnits.hh"
0038 #include "G4UnitsTable.hh"
0039 
0040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0041 
0042 PhysicsList::PhysicsList()
0043 {
0044   G4LossTableManager::Instance();
0045   fMessenger = new PhysicsListMessenger(this);
0046 
0047   // EM physics
0048   fEmName = G4String("standard");
0049   fEmPhysicsList = new PhysListEmStandard(fEmName);
0050 
0051   SetDefaultCutValue(1. * mm);
0052 
0053   SetVerboseLevel(1);
0054 }
0055 
0056 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0057 
0058 PhysicsList::~PhysicsList()
0059 {
0060   delete fEmPhysicsList;
0061   delete fMessenger;
0062 }
0063 
0064 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0065 
0066 void PhysicsList::AddPhysicsList(const G4String& name)
0067 {
0068   if (verboseLevel > 1) {
0069     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0070   }
0071 
0072   if (name == fEmName) return;
0073 
0074   if (name == "standard") {
0075     fEmName = name;
0076     delete fEmPhysicsList;
0077     fEmPhysicsList = new PhysListEmStandard(name);
0078   }
0079   else if (name == "livermore") {
0080     fEmName = name;
0081     delete fEmPhysicsList;
0082     fEmPhysicsList = new PhysListEmLivermore(name);
0083   }
0084   else if (name == "penelope") {
0085     fEmName = name;
0086     delete fEmPhysicsList;
0087     fEmPhysicsList = new PhysListEmPenelope(name);
0088   }
0089   else {
0090     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0091            << " is not defined" << G4endl;
0092   }
0093 }
0094 
0095 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0096 
0097 // Bosons
0098 #include "G4ChargedGeantino.hh"
0099 #include "G4Gamma.hh"
0100 #include "G4Geantino.hh"
0101 
0102 // leptons
0103 #include "G4Electron.hh"
0104 #include "G4MuonMinus.hh"
0105 #include "G4MuonPlus.hh"
0106 #include "G4Positron.hh"
0107 
0108 // Mesons
0109 #include "G4KaonMinus.hh"
0110 #include "G4KaonPlus.hh"
0111 #include "G4PionMinus.hh"
0112 #include "G4PionPlus.hh"
0113 
0114 // Baryons
0115 #include "G4AntiNeutron.hh"
0116 #include "G4AntiProton.hh"
0117 #include "G4Neutron.hh"
0118 #include "G4Proton.hh"
0119 
0120 // Nuclei
0121 #include "G4Alpha.hh"
0122 #include "G4Deuteron.hh"
0123 #include "G4GenericIon.hh"
0124 #include "G4Triton.hh"
0125 
0126 void PhysicsList::ConstructParticle()
0127 {
0128   // pseudo-particles
0129   G4Geantino::GeantinoDefinition();
0130   G4ChargedGeantino::ChargedGeantinoDefinition();
0131 
0132   // gamma
0133   G4Gamma::GammaDefinition();
0134 
0135   // leptons
0136   G4Electron::ElectronDefinition();
0137   G4Positron::PositronDefinition();
0138   G4MuonPlus::MuonPlusDefinition();
0139   G4MuonMinus::MuonMinusDefinition();
0140 
0141   // mesons
0142   G4PionPlus::PionPlusDefinition();
0143   G4PionMinus::PionMinusDefinition();
0144   G4KaonPlus::KaonPlusDefinition();
0145   G4KaonMinus::KaonMinusDefinition();
0146 
0147   // baryons
0148   G4Proton::ProtonDefinition();
0149   G4AntiProton::AntiProtonDefinition();
0150   G4Neutron::NeutronDefinition();
0151   G4AntiNeutron::AntiNeutronDefinition();
0152 
0153   // ions
0154   G4Deuteron::DeuteronDefinition();
0155   G4Triton::TritonDefinition();
0156   G4Alpha::AlphaDefinition();
0157   G4GenericIon::GenericIonDefinition();
0158 }
0159 
0160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0161 
0162 void PhysicsList::ConstructProcess()
0163 {
0164   AddTransportation();
0165   fEmPhysicsList->ConstructProcess();
0166   AddStepMax();
0167 }
0168 
0169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0170 
0171 #include "StepMax.hh"
0172 
0173 #include "G4ProcessManager.hh"
0174 
0175 void PhysicsList::AddStepMax()
0176 {
0177   // Step limitation seen as a process
0178   StepMax* stepMaxProcess = new StepMax();
0179 
0180   auto particleIterator = GetParticleIterator();
0181   particleIterator->reset();
0182   while ((*particleIterator)()) {
0183     G4ParticleDefinition* particle = particleIterator->value();
0184     G4ProcessManager* pmanager = particle->GetProcessManager();
0185 
0186     if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
0187       pmanager->AddDiscreteProcess(stepMaxProcess);
0188     }
0189   }
0190 }
0191 
0192 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......