Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-07 07:52:32

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 publication:
0032 // Med. Phys. 37 (2010) 4692-4708
0033 // and papers
0034 // M. Batmunkh et al. J Radiat Res Appl Sci 8 (2015) 498-507
0035 // O. Belov et al. Physica Medica 32 (2016) 1510-1520
0036 // The Geant4-DNA web site is available at http://geant4-dna.org
0037 //
0038 // -------------------------------------------------------------------
0039 // November 2016
0040 // -------------------------------------------------------------------
0041 //
0042 //
0043 
0044 #include "PhysicsList.hh"
0045 
0046 #include "CommandLineParser.hh"
0047 
0048 #include "G4EmParameters.hh"
0049 #include "G4SystemOfUnits.hh"
0050 // for discrete physics constructors!
0051 #include "G4EmDNAChemistry.hh"
0052 #include "G4EmDNAChemistry_option1.hh"
0053 #include "G4EmDNAPhysics.hh"
0054 #include "G4EmDNAPhysics_option1.hh"
0055 #include "G4EmDNAPhysics_option2.hh"
0056 #include "G4EmDNAPhysics_option3.hh"
0057 #include "G4EmDNAPhysics_option4.hh"
0058 #include "G4EmDNAPhysics_option5.hh"
0059 #include "G4EmDNAPhysics_option6.hh"
0060 #include "G4EmDNAPhysics_option7.hh"
0061 #include "G4EmDNAPhysics_option8.hh"
0062 // for condensed physics constructors!
0063 #include "G4EmLivermorePhysics.hh"
0064 #include "G4EmPenelopePhysics.hh"
0065 #include "G4EmStandardPhysics.hh"
0066 #include "G4EmStandardPhysics_option3.hh"
0067 #include "G4EmStandardPhysics_option4.hh"
0068 // for hadronic physics constructors!
0069 #include "G4DecayPhysics.hh"
0070 #include "G4EmDNAPhysicsActivator.hh"
0071 #include "G4EmExtraPhysics.hh"
0072 #include "G4HadronElasticPhysics.hh"
0073 #include "G4HadronPhysicsQGSP_BIC.hh"
0074 #include "G4IonPhysics.hh"
0075 #include "G4NeutronTrackingCut.hh"
0076 #include "G4RadioactiveDecayPhysics.hh"
0077 #include "G4StoppingPhysics.hh"
0078 
0079 using namespace G4DNAPARSER;
0080 
0081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0082 
0083 PhysicsList::PhysicsList()
0084   : G4VModularPhysicsList(),
0085     fEmPhysicsList(nullptr),
0086     fDNAActivator(nullptr),
0087     fEmDNAChemistryList(nullptr),
0088     fEmDNAChemistryList1(nullptr),
0089     fEmName(""),
0090     fHadronic(false)
0091 {
0092   G4double currentDefaultCut = 1. * micrometer;
0093   SetDefaultCutValue(currentDefaultCut);
0094   SetVerboseLevel(1);
0095   // fixe lower limit for cut
0096   G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV);
0097 
0098   // Options of combination Geant4-DNA processes (Physics/Chemistry)
0099   // with Standard and Hadronic Physics:
0100 
0101   // a) DNAphysics and Livermore physics inside and outside neuron
0102   G4cout << "Livermore + DNAphysics is activated!" << G4endl;
0103   RegisterConstructor("emlivermore");
0104 
0105   // 'G4EmParameters' works together with 'G4EmDNAPhysicsActivator'
0106   // VI: in this example Livermore is a default in any way
0107   //     DNA option4 is the default configuration as well
0108   fDNAActivator = new G4EmDNAPhysicsActivator();
0109   /*
0110   G4EmParameters::Instance()->AddDNA("Soma","Opt4");
0111   G4EmParameters::Instance()->AddDNA("Dendrites","Opt4");
0112   G4EmParameters::Instance()->AddDNA("Axon","Opt4");
0113   */
0114   //  b) Livermore + DNAPhysics + DNAChemistry
0115   if (CommandLineParser::GetParser()->GetCommandIfActive("-dnachemON")) {
0116     G4cout << "DNAChemistry is activated!" << G4endl;
0117     RegisterPhysics(new G4EmDNAChemistry());
0118   }
0119 
0120   //  d) "QGSP_BIC_EMY" package from hadrontherapy advanced example
0121   if (CommandLineParser::GetParser()->GetCommandIfActive("-dnahad")) {
0122     G4cout << "QGSP_BIC is activated!" << G4endl;
0123     RegisterConstructor("QGSP_BIC");
0124     fHadronic = true;
0125   }
0126 }
0127 
0128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0129 
0130 PhysicsList::~PhysicsList() {}
0131 
0132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0133 
0134 void PhysicsList::ConstructParticle()
0135 {
0136   if (fEmPhysicsList) {
0137     fEmPhysicsList->ConstructParticle();
0138   }
0139   if (fDNAActivator) {
0140     fDNAActivator->ConstructParticle();
0141   }
0142   if (fEmDNAChemistryList) {
0143     fEmDNAChemistryList->ConstructParticle();
0144   }
0145   if (fEmDNAChemistryList1) {
0146     fEmDNAChemistryList1->ConstructParticle();
0147   }
0148   G4VModularPhysicsList::ConstructParticle();
0149 }
0150 
0151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0152 
0153 void PhysicsList::ConstructProcess()
0154 {
0155   if (fEmPhysicsList) {
0156     fEmPhysicsList->ConstructProcess();
0157   }
0158   if (fDNAActivator) {
0159     fDNAActivator->ConstructProcess();
0160   }
0161   if (fEmDNAChemistryList) {
0162     fEmDNAChemistryList->ConstructProcess();
0163   }
0164   if (fEmDNAChemistryList1) {
0165     fEmDNAChemistryList1->ConstructProcess();
0166   }
0167   G4VModularPhysicsList::ConstructProcess();
0168 }
0169 
0170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0171 
0172 void PhysicsList::RegisterConstructor(const G4String& name)
0173 {
0174   if (name == fEmName) {
0175     return;
0176   }
0177   if (name == "emstandard_opt0") {
0178     fEmName = name;
0179     delete fEmPhysicsList;
0180     fEmPhysicsList = new G4EmStandardPhysics();
0181   }
0182   else if (name == "emstandard_opt3") {
0183     fEmName = name;
0184     delete fEmPhysicsList;
0185     fEmPhysicsList = new G4EmStandardPhysics_option3();
0186   }
0187   else if (name == "emstandard_opt4") {
0188     fEmName = name;
0189     delete fEmPhysicsList;
0190     fEmPhysicsList = new G4EmStandardPhysics_option4();
0191   }
0192   else if (name == "empenelope") {
0193     fEmName = name;
0194     delete fEmPhysicsList;
0195     fEmPhysicsList = new G4EmPenelopePhysics();
0196   }
0197   else if (name == "emlivermore") {
0198     fEmName = name;
0199     delete fEmPhysicsList;
0200     fEmPhysicsList = new G4EmLivermorePhysics();
0201   }
0202   else if (name == "G4EmDNAPhysics") {
0203     delete fEmPhysicsList;
0204     fEmPhysicsList = new G4EmDNAPhysics(verboseLevel);
0205     fEmName = name;
0206   }
0207   else if (name == "G4EmDNAPhysics_option1") {
0208     delete fEmPhysicsList;
0209     fEmPhysicsList = new G4EmDNAPhysics_option1(verboseLevel);
0210     fEmName = name;
0211   }
0212   else if (name == "G4EmDNAPhysics_option2") {
0213     delete fEmPhysicsList;
0214     fEmPhysicsList = new G4EmDNAPhysics_option2(verboseLevel);
0215     fEmName = name;
0216   }
0217   else if (name == "G4EmDNAPhysics_option3") {
0218     delete fEmPhysicsList;
0219     fEmPhysicsList = new G4EmDNAPhysics_option3(verboseLevel);
0220     fEmName = name;
0221   }
0222   else if (name == "G4EmDNAPhysics_option4") {
0223     delete fEmPhysicsList;
0224     fEmPhysicsList = new G4EmDNAPhysics_option4(verboseLevel);
0225     fEmName = name;
0226   }
0227   else if (name == "G4EmDNAPhysics_option5") {
0228     delete fEmPhysicsList;
0229     fEmPhysicsList = new G4EmDNAPhysics_option5(verboseLevel);
0230     fEmName = name;
0231   }
0232   else if (name == "G4EmDNAPhysics_option6") {
0233     delete fEmPhysicsList;
0234     fEmPhysicsList = new G4EmDNAPhysics_option6(verboseLevel);
0235     fEmName = name;
0236   }
0237   else if (name == "G4EmDNAPhysics_option7") {
0238     delete fEmPhysicsList;
0239     fEmPhysicsList = new G4EmDNAPhysics_option7(verboseLevel);
0240     fEmName = name;
0241   }
0242   else if (name == "G4EmDNAPhysics_option8") {
0243     delete fEmPhysicsList;
0244     fEmPhysicsList = new G4EmDNAPhysics_option8(verboseLevel);
0245     fEmName = name;
0246   }
0247   else if (name == "QGSP_BIC") {
0248     if (fHadronic) {
0249       return;
0250     }
0251     // Hadron Elastic Physics
0252     RegisterConstructor("G4HadronElasticPhysics");
0253     // Hadron Inelastic Physics
0254     RegisterConstructor("G4HadronPhysicsQGSP_BIC");
0255     // Stopping
0256     RegisterConstructor("G4StoppingPhysics");
0257     // Ion Physics
0258     RegisterConstructor("G4IonBinaryCascadePhysics");
0259     // Gamma-Lepto nuclear
0260     RegisterConstructor("G4EmExtraPhysics");
0261     // Limiters
0262     RegisterConstructor("G4NeutronTrackingCut");
0263     // Decay
0264     RegisterConstructor("G4DecayPhysics");
0265     // Radioactive decay
0266     RegisterConstructor("G4RadioactiveDecayPhysics");
0267   }
0268   else if (name == "G4EmDNAChemistry") {
0269     if (fEmDNAChemistryList || fEmDNAChemistryList1) {
0270       return;
0271     }
0272     fEmDNAChemistryList = new G4EmDNAChemistry();
0273   }
0274   else if (name == "G4EmDNAChemistry_option1") {
0275     if (fEmDNAChemistryList || fEmDNAChemistryList1) {
0276       return;
0277     }
0278     fEmDNAChemistryList1 = new G4EmDNAChemistry_option1();
0279   }
0280   else {
0281     G4cout << "PhysicsList::RegisterConstructor: <" << name << ">"
0282            << " fails - name is not defined" << G4endl;
0283   }
0284 }
0285 
0286 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......