Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 08:30:36

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 "G4UserSpecialCuts.hh"
0054 
0055 // particles
0056 
0057 #include "G4BaryonConstructor.hh"
0058 #include "G4BosonConstructor.hh"
0059 #include "G4DNAGenericIonsManager.hh"
0060 #include "G4IonConstructor.hh"
0061 #include "G4LeptonConstructor.hh"
0062 #include "G4MesonConstructor.hh"
0063 #include "G4ShortLivedConstructor.hh"
0064 
0065 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0066 
0067 PhysicsList::PhysicsList() : G4VModularPhysicsList(), fEmPhysicsList(0), fMessenger(0)
0068 {
0069   fMessenger = new PhysicsListMessenger(this);
0070 
0071   SetVerboseLevel(1);
0072 
0073   fEmPhysicsList = new G4EmDNAPhysics_option2();
0074 }
0075 
0076 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0077 
0078 PhysicsList::~PhysicsList()
0079 {
0080   delete fMessenger;
0081   delete fEmPhysicsList;
0082 }
0083 
0084 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0085 
0086 void PhysicsList::ConstructParticle()
0087 {
0088   G4BosonConstructor pBosonConstructor;
0089   pBosonConstructor.ConstructParticle();
0090 
0091   G4LeptonConstructor pLeptonConstructor;
0092   pLeptonConstructor.ConstructParticle();
0093 
0094   G4MesonConstructor pMesonConstructor;
0095   pMesonConstructor.ConstructParticle();
0096 
0097   G4BaryonConstructor pBaryonConstructor;
0098   pBaryonConstructor.ConstructParticle();
0099 
0100   G4IonConstructor pIonConstructor;
0101   pIonConstructor.ConstructParticle();
0102 
0103   G4ShortLivedConstructor pShortLivedConstructor;
0104   pShortLivedConstructor.ConstructParticle();
0105 
0106   G4DNAGenericIonsManager* genericIonsManager;
0107   genericIonsManager = G4DNAGenericIonsManager::Instance();
0108   genericIonsManager->GetIon("alpha++");
0109   genericIonsManager->GetIon("alpha+");
0110   genericIonsManager->GetIon("helium");
0111   genericIonsManager->GetIon("hydrogen");
0112 }
0113 
0114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0115 
0116 void PhysicsList::ConstructProcess()
0117 {
0118   // Transportation
0119   AddTransportation();
0120 
0121   // Electromagnetic physics list
0122   fEmPhysicsList->ConstructProcess();
0123 
0124   // Tracking cut
0125   AddTrackingCut();
0126 }
0127 
0128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0129 
0130 void PhysicsList::AddPhysicsList(const G4String& name)
0131 {
0132   if (verboseLevel > -1) {
0133     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0134   }
0135 
0136   if (name == fEmName) return;
0137 
0138   if (name == "dna") {
0139     fEmName = name;
0140     delete fEmPhysicsList;
0141     fEmPhysicsList = new G4EmDNAPhysics();
0142   }
0143   else if (name == "dna_opt1") {
0144     fEmName = name;
0145     delete fEmPhysicsList;
0146     fEmPhysicsList = new G4EmDNAPhysics_option1();
0147   }
0148   else if (name == "dna_opt2") {
0149     fEmName = name;
0150     delete fEmPhysicsList;
0151     fEmPhysicsList = new G4EmDNAPhysics_option2();
0152   }
0153   else if (name == "dna_opt3") {
0154     fEmName = name;
0155     delete fEmPhysicsList;
0156     fEmPhysicsList = new G4EmDNAPhysics_option3();
0157   }
0158   else if (name == "dna_opt4") {
0159     fEmName = name;
0160     delete fEmPhysicsList;
0161     fEmPhysicsList = new G4EmDNAPhysics_option4();
0162   }
0163   else if (name == "dna_opt5") {
0164     fEmName = name;
0165     delete fEmPhysicsList;
0166     fEmPhysicsList = new G4EmDNAPhysics_option5();
0167   }
0168   else if (name == "dna_opt6") {
0169     fEmName = name;
0170     delete fEmPhysicsList;
0171     fEmPhysicsList = new G4EmDNAPhysics_option6();
0172   }
0173   else if (name == "dna_opt7") {
0174     fEmName = name;
0175     delete fEmPhysicsList;
0176     fEmPhysicsList = new G4EmDNAPhysics_option7();
0177   }
0178   else if (name == "dna_opt8") {
0179     fEmName = name;
0180     delete fEmPhysicsList;
0181     fEmPhysicsList = new G4EmDNAPhysics_option8();
0182   }
0183   else {
0184     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0185            << " is not defined" << G4endl;
0186   }
0187 }
0188 
0189 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0190 
0191 void PhysicsList::AddTrackingCut()
0192 {
0193   G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0194 
0195   auto particleIterator = GetParticleIterator();
0196   particleIterator->reset();
0197   while ((*particleIterator)()) {
0198     G4ParticleDefinition* particle = particleIterator->value();
0199     G4String particleName = particle->GetParticleName();
0200 
0201     if (particleName == "e-") {
0202       ph->RegisterProcess(new G4UserSpecialCuts(), particle);
0203     }
0204   }
0205 }
0206 
0207 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......