Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/extended/medical/dna/dnaphysics/src/PhysicsList.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 //
0034 // The Geant4-DNA web site is available at http://geant4-dna.org
0035 //
0036 /// \file PhysicsList.cc
0037 /// \brief Implementation of the PhysicsList class
0038 
0039 #include "PhysicsList.hh"
0040 
0041 #include "G4DecayPhysics.hh"
0042 #include "G4EmDNABuilder.hh"
0043 #include "G4EmDNAPhysics.hh"
0044 #include "G4EmDNAPhysics_option1.hh"
0045 #include "G4EmDNAPhysics_option2.hh"
0046 #include "G4EmDNAPhysics_option3.hh"
0047 #include "G4EmDNAPhysics_option4.hh"
0048 #include "G4EmDNAPhysics_option5.hh"
0049 #include "G4EmDNAPhysics_option6.hh"
0050 #include "G4EmDNAPhysics_option7.hh"
0051 #include "G4EmDNAPhysics_option8.hh"
0052 #include "G4EmLivermorePhysics.hh"
0053 #include "G4EmParameters.hh"
0054 #include "G4EmPenelopePhysics.hh"
0055 #include "G4EmStandardPhysics.hh"
0056 #include "G4EmStandardPhysics_option3.hh"
0057 #include "G4EmStandardPhysics_option4.hh"
0058 #include "G4GenericIon.hh"
0059 #include "G4RadioactiveDecayPhysics.hh"
0060 #include "G4SystemOfUnits.hh"
0061 #include "G4NuclideTable.hh"
0062 
0063 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0064 
0065 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0066 {
0067   SetDefaultCutValue(1.0 * micrometer);
0068   SetVerboseLevel(1);
0069 
0070   fEmPhysics = "DNA_Opt2";
0071   fEmPhysicsList = new G4EmDNAPhysics_option2();
0072   fDecayPhysicsList = new G4DecayPhysics();
0073 
0074   G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV);
0075   G4EmParameters* param = G4EmParameters::Instance();
0076   param->SetMinEnergy(100 * eV);
0077   param->SetMaxEnergy(1 * GeV);
0078 
0079   // Limits in G4NuclideTable
0080   G4NuclideTable::GetInstance()->SetThresholdOfHalfLife(0.1 * picosecond);
0081   G4NuclideTable::GetInstance()->SetLevelTolerance(1.0 * eV);
0082 }
0083 
0084 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0085 
0086 PhysicsList::~PhysicsList()
0087 {
0088   delete fEmPhysicsList;
0089   delete fDecayPhysicsList;
0090   delete fRadDecayPhysicsList;
0091 }
0092 
0093 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0094 
0095 void PhysicsList::ConstructParticle()
0096 {
0097   fEmPhysicsList->ConstructParticle();
0098   fDecayPhysicsList->ConstructParticle();
0099 }
0100 
0101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0102 
0103 void PhysicsList::ConstructProcess()
0104 {
0105   AddTransportation();
0106   fEmPhysicsList->ConstructProcess();
0107   fDecayPhysicsList->ConstructProcess();
0108   if (nullptr != fRadDecayPhysicsList) {
0109     fRadDecayPhysicsList->ConstructProcess();
0110   }
0111   if (fIsTrackingCutSet) {
0112     TrackingCut();
0113   }
0114 }
0115 
0116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0117 
0118 void PhysicsList::AddPhysics(const G4String& name)
0119 {
0120   if (name == fEmPhysics) {
0121     return;
0122   }
0123 
0124   G4cout << "### PhysicsList::AddPhysics Warning: Physics List <" << name << "> is requested"
0125          << G4endl;
0126 
0127   fEmPhysics = name;
0128 
0129   if (name == "emstandard_opt0") {
0130     delete fEmPhysicsList;
0131     fEmPhysicsList = new G4EmStandardPhysics();
0132   }
0133   else if (name == "emstandard_opt3") {
0134     delete fEmPhysicsList;
0135     fEmPhysicsList = new G4EmStandardPhysics_option3();
0136   }
0137   else if (name == "emstandard_opt4") {
0138     delete fEmPhysicsList;
0139     fEmPhysicsList = new G4EmStandardPhysics_option4();
0140   }
0141   else if (name == "raddecay") {
0142     if (nullptr == fRadDecayPhysicsList) fRadDecayPhysicsList = new G4RadioactiveDecayPhysics();
0143   }
0144   else if (name == "emlivermore") {
0145     delete fEmPhysicsList;
0146     fEmPhysicsList = new G4EmLivermorePhysics();
0147   }
0148   else if (name == "empenelope") {
0149     delete fEmPhysicsList;
0150     fEmPhysicsList = new G4EmPenelopePhysics();
0151   }
0152   else if (name == "DNA_Opt0") {
0153     delete fEmPhysicsList;
0154     fEmPhysicsList = new G4EmDNAPhysics();
0155   }
0156   else if (name == "DNA_Opt1") {
0157     delete fEmPhysicsList;
0158     fEmPhysicsList = new G4EmDNAPhysics_option1();
0159   }
0160   else if (name == "DNA_Opt2") {
0161     delete fEmPhysicsList;
0162     fEmPhysicsList = new G4EmDNAPhysics_option2();
0163   }
0164   else if (name == "DNA_Opt3") {
0165     delete fEmPhysicsList;
0166     fEmPhysicsList = new G4EmDNAPhysics_option3();
0167   }
0168   else if (name == "DNA_Opt4") {
0169     delete fEmPhysicsList;
0170     fEmPhysicsList = new G4EmDNAPhysics_option4();
0171   }
0172   else if (name == "DNA_Opt5") {
0173     delete fEmPhysicsList;
0174     fEmPhysicsList = new G4EmDNAPhysics_option5();
0175   }
0176   else if (name == "DNA_Opt6") {
0177     delete fEmPhysicsList;
0178     fEmPhysicsList = new G4EmDNAPhysics_option6();
0179   }
0180   else if (name == "DNA_Opt7") {
0181     delete fEmPhysicsList;
0182     fEmPhysicsList = new G4EmDNAPhysics_option7();
0183   }
0184   else if (name == "DNA_Opt8") {
0185     delete fEmPhysicsList;
0186     fEmPhysicsList = new G4EmDNAPhysics_option8();
0187   }
0188   else {
0189     G4cout << "### PhysicsList::AddPhysics Warning: Physics List <" << name
0190            << "> is does not exist - the command ignored" << G4endl;
0191   }
0192 }
0193 
0194 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0195 
0196 void PhysicsList::TrackingCut()
0197 {
0198   auto particle = G4GenericIon::GenericIon();  // DNA heavy ions
0199   auto particleName = particle->GetParticleName();
0200   auto capture = G4EmDNABuilder::FindOrBuildCapture(0.5 * CLHEP::MeV, particle);
0201   capture->AddRegion("World");
0202   capture->SetKinEnergyLimit(0.5 * CLHEP::MeV);  // 0.5 MeV/u
0203 }
0204 
0205 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0206 
0207 void PhysicsList::SetTrackingCut(G4bool isCut)
0208 {
0209   fIsTrackingCutSet = isCut;
0210 }