Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21: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 // This example is provided by the Geant4-DNA collaboration
0027 // Any report or published results obtained using the Geant4-DNA software
0028 // shall cite the following Geant4-DNA collaboration publications:
0029 // Med. Phys. 45, (2018) e722-e739
0030 // Phys. Med. 31 (2015) 861-874
0031 // Med. Phys. 37 (2010) 4692-4708
0032 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
0033 // The Geant4-DNA web site is available at http://geant4-dna.org
0034 //
0035 //
0036 /// \file PhysicsList.cc
0037 /// \brief Implementation of the PhysicsList class
0038 
0039 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0040 
0041 #include "PhysicsList.hh"
0042 
0043 #include "G4DecayPhysics.hh"
0044 #include "G4EmDNABuilder.hh"
0045 #include "G4EmDNAPhysics.hh"
0046 #include "G4EmDNAPhysicsActivator.hh"
0047 #include "G4EmDNAPhysics_option1.hh"
0048 #include "G4EmDNAPhysics_option2.hh"
0049 #include "G4EmDNAPhysics_option3.hh"
0050 #include "G4EmDNAPhysics_option4.hh"
0051 #include "G4EmDNAPhysics_option5.hh"
0052 #include "G4EmDNAPhysics_option6.hh"
0053 #include "G4EmDNAPhysics_option7.hh"
0054 #include "G4EmDNAPhysics_option8.hh"
0055 #include "G4EmLivermorePhysics.hh"
0056 #include "G4EmPenelopePhysics.hh"
0057 #include "G4EmStandardPhysics.hh"
0058 #include "G4EmStandardPhysics_option3.hh"
0059 #include "G4EmStandardPhysics_option4.hh"
0060 #include "G4GenericIon.hh"
0061 #include "G4RadioactiveDecayPhysics.hh"
0062 
0063 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0064 
0065 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0066 {
0067   SetDefaultCutValue(1.0 * micrometer);
0068   SetVerboseLevel(1);
0069 
0070   fEmPhysics = "emstandard_opt4";
0071   fEmPhysicsList = new G4EmStandardPhysics_option4();
0072   fDecayPhysicsList = new G4DecayPhysics();
0073   fEmDNAActivator = new G4EmDNAPhysicsActivator();
0074 
0075   G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV);
0076   G4EmParameters* param = G4EmParameters::Instance();
0077   param->SetMinEnergy(100 * eV);
0078   param->SetMaxEnergy(1 * GeV);
0079 }
0080 
0081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0082 
0083 PhysicsList::~PhysicsList()
0084 {
0085   delete fEmPhysicsList;
0086   delete fEmDNAActivator;
0087   delete fDecayPhysicsList;
0088   delete fRadDecayPhysicsList;
0089 }
0090 
0091 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0092 
0093 void PhysicsList::ConstructParticle()
0094 {
0095   fEmPhysicsList->ConstructParticle();
0096   fDecayPhysicsList->ConstructParticle();
0097   fEmDNAActivator->ConstructParticle();
0098 }
0099 
0100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0101 
0102 void PhysicsList::ConstructProcess()
0103 {
0104   AddTransportation();
0105   fEmPhysicsList->ConstructProcess();
0106   fDecayPhysicsList->ConstructProcess();
0107 
0108   if (nullptr != fRadDecayPhysicsList) {
0109     fRadDecayPhysicsList->ConstructProcess();
0110   }
0111 
0112   if (!fDNAPL) {
0113     fEmDNAActivator->ConstructProcess();
0114   }
0115 
0116   if (fIsTrackingCutSet) {
0117     TrackingCut();
0118   }
0119 }
0120 
0121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0122 
0123 void PhysicsList::AddPhysics(const G4String& name)
0124 {
0125   if (name == fEmPhysics) {
0126     return;
0127   }
0128 
0129   G4cout << "### PhysicsList::AddPhysics Warning: Physics List <" << name << "> is requested"
0130          << G4endl;
0131 
0132   fEmPhysics = name;
0133 
0134   if (name == "emstandard_opt0") {
0135     delete fEmPhysicsList;
0136     fEmPhysicsList = new G4EmStandardPhysics();
0137     fDNAPL = false;
0138   }
0139   else if (name == "emstandard_opt3") {
0140     delete fEmPhysicsList;
0141     fEmPhysicsList = new G4EmStandardPhysics_option3();
0142     fDNAPL = false;
0143   }
0144   else if (name == "emstandard_opt4") {
0145     delete fEmPhysicsList;
0146     fEmPhysicsList = new G4EmStandardPhysics_option4();
0147     fDNAPL = false;
0148   }
0149   else if (name == "raddecay") {
0150     if (nullptr == fRadDecayPhysicsList) fRadDecayPhysicsList = new G4RadioactiveDecayPhysics();
0151   }
0152   else if (name == "emlivermore") {
0153     delete fEmPhysicsList;
0154     fEmPhysicsList = new G4EmLivermorePhysics();
0155     fDNAPL = false;
0156   }
0157   else if (name == "empenelope") {
0158     delete fEmPhysicsList;
0159     fEmPhysicsList = new G4EmPenelopePhysics();
0160     fDNAPL = false;
0161   }
0162   else if (name == "DNA_Opt0") {
0163     delete fEmPhysicsList;
0164     fEmPhysicsList = new G4EmDNAPhysics();
0165     fDNAPL = true;
0166   }
0167   else if (name == "DNA_Opt1") {
0168     delete fEmPhysicsList;
0169     fEmPhysicsList = new G4EmDNAPhysics_option1();
0170     fDNAPL = true;
0171   }
0172   else if (name == "DNA_Opt2") {
0173     delete fEmPhysicsList;
0174     fEmPhysicsList = new G4EmDNAPhysics_option2();
0175     fDNAPL = true;
0176   }
0177   else if (name == "DNA_Opt3") {
0178     delete fEmPhysicsList;
0179     fEmPhysicsList = new G4EmDNAPhysics_option3();
0180     fDNAPL = true;
0181   }
0182   else if (name == "DNA_Opt4") {
0183     delete fEmPhysicsList;
0184     fEmPhysicsList = new G4EmDNAPhysics_option4();
0185     fDNAPL = true;
0186   }
0187   else if (name == "DNA_Opt5") {
0188     delete fEmPhysicsList;
0189     fEmPhysicsList = new G4EmDNAPhysics_option5();
0190     fDNAPL = true;
0191   }
0192   else if (name == "DNA_Opt6") {
0193     delete fEmPhysicsList;
0194     fEmPhysicsList = new G4EmDNAPhysics_option6();
0195     fDNAPL = true;
0196   }
0197   else if (name == "DNA_Opt7") {
0198     delete fEmPhysicsList;
0199     fEmPhysicsList = new G4EmDNAPhysics_option7();
0200     fDNAPL = true;
0201   }
0202   else if (name == "DNA_Opt8") {
0203     delete fEmPhysicsList;
0204     fEmPhysicsList = new G4EmDNAPhysics_option8();
0205     fDNAPL = true;
0206   }
0207   else {
0208     G4cout << "### PhysicsList::AddPhysics Warning: Physics List <" << name
0209            << "> is does not exist - the command ignored" << G4endl;
0210   }
0211 }
0212 
0213 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0214 
0215 void PhysicsList::TrackingCut()
0216 {
0217   auto particle = G4GenericIon::GenericIon();  // DNA heavy ions
0218   auto particleName = particle->GetParticleName();
0219   auto capture = G4EmDNABuilder::FindOrBuildCapture(0.5 * CLHEP::MeV, particle);
0220   capture->AddRegion("World");
0221   capture->AddRegion("regionTarget");
0222   capture->SetKinEnergyLimit(0.5 * CLHEP::MeV);  // 0.5 MeV/u
0223 }
0224 
0225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0226 
0227 void PhysicsList::SetTrackingCut(G4bool isCut)
0228 {
0229   fIsTrackingCutSet = isCut;
0230 }