Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-16 07:42:38

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 // This example is provided by the Geant4-DNA collaboration
0030 // Any report or published results obtained using the Geant4-DNA software
0031 // shall cite the following Geant4-DNA collaboration publications:
0032 // Med. Phys. 45 (2018) e722-e739
0033 // Phys. Med. 31 (2015) 861-874
0034 // Med. Phys. 37 (2010) 4692-4708
0035 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
0036 //
0037 // The Geant4-DNA web site is available at http://geant4-dna.org
0038 //
0039 
0040 #include "PhysicsList.hh"
0041 
0042 #include "PhysicsListMessenger.hh"
0043 
0044 #include "G4EmDNAPhysics.hh"
0045 #include "G4EmDNAPhysics_option1.hh"
0046 #include "G4EmDNAPhysics_option2.hh"
0047 #include "G4EmDNAPhysics_option3.hh"
0048 #include "G4EmDNAPhysics_option4.hh"
0049 #include "G4EmDNAPhysics_option5.hh"
0050 #include "G4EmDNAPhysics_option6.hh"
0051 #include "G4EmDNAPhysics_option7.hh"
0052 #include "G4EmDNAPhysics_option8.hh"
0053 #include "G4EmStandardPhysics_option4.hh"
0054 #include "G4SystemOfUnits.hh"
0055 #include "G4UnitsTable.hh"
0056 #include "G4UserSpecialCuts.hh"
0057 
0058 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0059 
0060 PhysicsList::PhysicsList()
0061 {
0062   fMessenger = new PhysicsListMessenger(this);
0063 
0064   SetVerboseLevel(1);
0065 
0066   // EM physics
0067   fEmPhysicsList = new G4EmDNAPhysics();
0068 }
0069 
0070 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0071 
0072 PhysicsList::~PhysicsList()
0073 {
0074   delete fMessenger;
0075   delete fEmPhysicsList;
0076 }
0077 
0078 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0079 
0080 void PhysicsList::ConstructParticle()
0081 {
0082   fEmPhysicsList->ConstructParticle();
0083 }
0084 
0085 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0086 
0087 void PhysicsList::ConstructProcess()
0088 {
0089   // Transportation
0090   AddTransportation();
0091 
0092   // Electromagnetic physics list
0093   fEmPhysicsList->ConstructProcess();
0094 
0095   // Tracking cut
0096   AddTrackingCut();
0097 }
0098 
0099 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0100 
0101 void PhysicsList::AddPhysicsList(const G4String& name)
0102 {
0103   if (verboseLevel > -1) {
0104     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0105   }
0106 
0107   if (name == fEmName) return;
0108 
0109   if (name == "dna") {
0110     fEmName = name;
0111     delete fEmPhysicsList;
0112     fEmPhysicsList = new G4EmDNAPhysics();
0113   }
0114   else if (name == "dna_opt1") {
0115     fEmName = name;
0116     delete fEmPhysicsList;
0117     fEmPhysicsList = new G4EmDNAPhysics_option1();
0118   }
0119   else if (name == "dna_opt2") {
0120     fEmName = name;
0121     delete fEmPhysicsList;
0122     fEmPhysicsList = new G4EmDNAPhysics_option2();
0123   }
0124   else if (name == "dna_opt3") {
0125     fEmName = name;
0126     delete fEmPhysicsList;
0127     fEmPhysicsList = new G4EmDNAPhysics_option3();
0128   }
0129   else if (name == "dna_opt4") {
0130     fEmName = name;
0131     delete fEmPhysicsList;
0132     fEmPhysicsList = new G4EmDNAPhysics_option4();
0133   }
0134   else if (name == "dna_opt5") {
0135     fEmName = name;
0136     delete fEmPhysicsList;
0137     fEmPhysicsList = new G4EmDNAPhysics_option5();
0138   }
0139   else if (name == "dna_opt6") {
0140     fEmName = name;
0141     delete fEmPhysicsList;
0142     fEmPhysicsList = new G4EmDNAPhysics_option6();
0143   }
0144   else if (name == "dna_opt7") {
0145     fEmName = name;
0146     delete fEmPhysicsList;
0147     fEmPhysicsList = new G4EmDNAPhysics_option7();
0148   }
0149   else if (name == "dna_opt8") {
0150     fEmName = name;
0151     delete fEmPhysicsList;
0152     fEmPhysicsList = new G4EmDNAPhysics_option8();
0153   }
0154   else if (name == "std_opt4") {
0155     fEmName = name;
0156     delete fEmPhysicsList;
0157     fEmPhysicsList = new G4EmStandardPhysics_option4();
0158   }
0159   else {
0160     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0161            << " is not defined" << G4endl;
0162   }
0163 }
0164 
0165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0166 
0167 void PhysicsList::AddTrackingCut()
0168 {
0169   G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0170 
0171   auto particleIterator = GetParticleIterator();
0172   particleIterator->reset();
0173   while ((*particleIterator)()) {
0174     G4ParticleDefinition* particle = particleIterator->value();
0175     if (particle->GetPDGCharge() != 0.0 && !particle->IsShortLived()) {
0176       ph->RegisterProcess(new G4UserSpecialCuts(), particle);
0177     }
0178   }
0179 }