Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-01 07:51:12

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 "PhysListEmStandard_GS.hh"
0032 #include "PhysListEmStandard_SS.hh"
0033 #include "PhysListEmStandard_WVI.hh"
0034 #include "PhysListEmStandard_option0.hh"
0035 #include "PhysListEmStandard_option3.hh"
0036 #include "PhysListEmStandard_option4.hh"
0037 #include "PhysicsListMessenger.hh"
0038 #include "StepMax.hh"
0039 
0040 #include "G4LossTableManager.hh"
0041 #include "G4ParticleDefinition.hh"
0042 #include "G4ProcessManager.hh"
0043 
0044 // Bosons
0045 #include "G4ChargedGeantino.hh"
0046 #include "G4Gamma.hh"
0047 #include "G4Geantino.hh"
0048 
0049 // leptons
0050 #include "G4Electron.hh"
0051 #include "G4Positron.hh"
0052 
0053 // Hadrons
0054 #include "G4Proton.hh"
0055 #include "G4SystemOfUnits.hh"
0056 
0057 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0058 
0059 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0060 {
0061   G4LossTableManager::Instance();
0062   fMessenger = new PhysicsListMessenger(this);
0063 
0064   // EM physics
0065   fEmName = G4String("standard_opt3");
0066   fEmPhysicsList = new PhysListEmStandard_option3(fEmName);
0067 
0068   defaultCutValue = 10 * km;
0069 
0070   SetVerboseLevel(1);
0071 }
0072 
0073 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0074 
0075 PhysicsList::~PhysicsList()
0076 {
0077   delete fEmPhysicsList;
0078   delete fMessenger;
0079 }
0080 
0081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0082 
0083 void PhysicsList::ConstructParticle()
0084 {
0085   // pseudo-particles
0086   G4Geantino::GeantinoDefinition();
0087   G4ChargedGeantino::ChargedGeantinoDefinition();
0088 
0089   // gamma
0090   G4Gamma::GammaDefinition();
0091 
0092   // leptons
0093   G4Electron::ElectronDefinition();
0094   G4Positron::PositronDefinition();
0095 
0096   // baryons
0097   G4Proton::ProtonDefinition();
0098 }
0099 
0100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0101 
0102 void PhysicsList::ConstructProcess()
0103 {
0104   AddTransportation();
0105   fEmPhysicsList->ConstructProcess();
0106 
0107   AddStepMax();
0108 }
0109 
0110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0111 
0112 void PhysicsList::AddStepMax()
0113 {
0114   // Step limitation seen as a process
0115   StepMax* stepMaxProcess = new StepMax();
0116 
0117   auto particleIterator = GetParticleIterator();
0118   particleIterator->reset();
0119   while ((*particleIterator)()) {
0120     G4ParticleDefinition* particle = particleIterator->value();
0121     G4ProcessManager* pmanager = particle->GetProcessManager();
0122 
0123     if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
0124       pmanager->AddDiscreteProcess(stepMaxProcess);
0125     }
0126   }
0127 }
0128 
0129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0130 
0131 void PhysicsList::AddPhysicsList(const G4String& name)
0132 {
0133   if (verboseLevel > 0) {
0134     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0135   }
0136 
0137   if (name == fEmName) return;
0138 
0139   if (name == "standard_opt0") {
0140     fEmName = name;
0141     delete fEmPhysicsList;
0142     fEmPhysicsList = new PhysListEmStandard_option0(name);
0143   }
0144   else if (name == "standard_opt3") {
0145     fEmName = name;
0146     delete fEmPhysicsList;
0147     fEmPhysicsList = new PhysListEmStandard_option3(name);
0148   }
0149   else if (name == "standard_opt4") {
0150     fEmName = name;
0151     delete fEmPhysicsList;
0152     fEmPhysicsList = new PhysListEmStandard_option4(name);
0153   }
0154   else if (name == "standard_GS") {
0155     fEmName = name;
0156     delete fEmPhysicsList;
0157     fEmPhysicsList = new PhysListEmStandard_GS(name);
0158   }
0159   else if (name == "standard_WVI") {
0160     fEmName = name;
0161     delete fEmPhysicsList;
0162     fEmPhysicsList = new PhysListEmStandard_WVI(name);
0163   }
0164   else if (name == "standard_SS") {
0165     fEmName = name;
0166     delete fEmPhysicsList;
0167     fEmPhysicsList = new PhysListEmStandard_SS(name);
0168   }
0169   else {
0170     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0171            << " is not defined" << G4endl;
0172   }
0173 }
0174 
0175 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......