Back to home page

EIC code displayed by LXR

 
 

    


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

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