Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-30 07:50:41

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 // J. Comput. Phys. 274 (2014) 841-882
0034 // Phys. Med. Biol. 63(10) (2018) 105014-12pp
0035 // The Geant4-DNA web site is available at http://geant4-dna.org
0036 //
0037 //
0038 
0039 #include "PhysicsList.hh"
0040 
0041 #include "CommandLineParser.hh"
0042 
0043 #include "G4EmDNAChemistry.hh"
0044 #include "G4EmDNAChemistry_option1.hh"
0045 #include "G4EmDNAPhysics.hh"
0046 #include "G4EmDNAPhysics_option1.hh"
0047 #include "G4EmDNAPhysics_option2.hh"
0048 #include "G4EmDNAPhysics_option3.hh"
0049 #include "G4EmDNAPhysics_option4.hh"
0050 #include "G4EmDNAPhysics_option5.hh"
0051 #include "G4EmDNAPhysics_option6.hh"
0052 #include "G4EmDNAPhysics_option7.hh"
0053 #include "G4EmDNAPhysics_option8.hh"
0054 #include "G4EmParameters.hh"
0055 #include "G4SystemOfUnits.hh"
0056 
0057 using namespace G4DNAPARSER;
0058 
0059 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0060 
0061 PhysicsList::PhysicsList(): G4VModularPhysicsList()
0062 {
0063   auto currentDefaultCut = 1. * nanometer;
0064   // fixe lower limit for cut
0065   G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV);
0066   SetDefaultCutValue(currentDefaultCut);
0067   SetVerboseLevel(1);
0068 
0069   RegisterConstructor("G4EmDNAPhysics_option8");
0070   if (CommandLineParser::GetParser()->GetCommandIfActive("-chemOFF") == nullptr) {
0071     RegisterConstructor("G4EmDNAChemistry_option1");
0072   }
0073   G4EmParameters::Instance()->SetDNAeSolvationSubType(fRitchie1994eSolvation);
0074   G4EmParameters::Instance()->Dump();
0075 }
0076 
0077 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0078 
0079 PhysicsList::~PhysicsList()
0080 {
0081   delete fEmDNAPhysicsList;
0082   delete fEmDNAChemistryList;
0083   delete fEmDNAChemistryList1;
0084 }
0085 
0086 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0087 
0088 void PhysicsList::ConstructParticle()
0089 {
0090   if (fEmDNAPhysicsList) {
0091     fEmDNAPhysicsList->ConstructParticle();
0092   }
0093   if (fEmDNAChemistryList) {
0094     fEmDNAChemistryList->ConstructParticle();
0095   }
0096   if (fEmDNAChemistryList1) {
0097     fEmDNAChemistryList1->ConstructParticle();
0098   }
0099 }
0100 
0101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0102 
0103 void PhysicsList::ConstructProcess()
0104 {
0105   AddTransportation();
0106   if (fEmDNAPhysicsList) {
0107     fEmDNAPhysicsList->ConstructProcess();
0108   }
0109   if (fEmDNAChemistryList) {
0110     fEmDNAChemistryList->ConstructProcess();
0111   }
0112   if (fEmDNAChemistryList1) {
0113     fEmDNAChemistryList1->ConstructProcess();
0114   }
0115 }
0116 
0117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0118 
0119 void PhysicsList::RegisterConstructor(const G4String& name)
0120 {
0121   if (name == fPhysDNAName) {
0122     return;
0123   }
0124   if (verboseLevel > 0) {
0125     G4cout << "===== Register constructor ==== " << name << G4endl;
0126   }
0127   if (name == "G4EmDNAPhysics") {
0128     delete fEmDNAPhysicsList;
0129     fEmDNAPhysicsList = new G4EmDNAPhysics(verboseLevel);
0130     fPhysDNAName = name;
0131   }
0132   else if (name == "G4EmDNAPhysics_option1") {
0133     delete fEmDNAPhysicsList;
0134     fEmDNAPhysicsList = new G4EmDNAPhysics_option1(verboseLevel);
0135     fPhysDNAName = name;
0136   }
0137   else if (name == "G4EmDNAPhysics_option2") {
0138     delete fEmDNAPhysicsList;
0139     fEmDNAPhysicsList = new G4EmDNAPhysics_option2(verboseLevel);
0140     fPhysDNAName = name;
0141   }
0142   else if (name == "G4EmDNAPhysics_option3") {
0143     delete fEmDNAPhysicsList;
0144     fEmDNAPhysicsList = new G4EmDNAPhysics_option3(verboseLevel);
0145     fPhysDNAName = name;
0146   }
0147   else if (name == "G4EmDNAPhysics_option4") {
0148     delete fEmDNAPhysicsList;
0149     fEmDNAPhysicsList = new G4EmDNAPhysics_option4(verboseLevel);
0150     fPhysDNAName = name;
0151   }
0152   else if (name == "G4EmDNAPhysics_option5") {
0153     delete fEmDNAPhysicsList;
0154     fEmDNAPhysicsList = new G4EmDNAPhysics_option5(verboseLevel);
0155     fPhysDNAName = name;
0156   }
0157   else if (name == "G4EmDNAPhysics_option6") {
0158     delete fEmDNAPhysicsList;
0159     fEmDNAPhysicsList = new G4EmDNAPhysics_option6(verboseLevel);
0160     fPhysDNAName = name;
0161   }
0162   else if (name == "G4EmDNAPhysics_option7") {
0163     delete fEmDNAPhysicsList;
0164     fEmDNAPhysicsList = new G4EmDNAPhysics_option7(verboseLevel);
0165     fPhysDNAName = name;
0166   }
0167   else if (name == "G4EmDNAPhysics_option8") {
0168     delete fEmDNAPhysicsList;
0169     fEmDNAPhysicsList = new G4EmDNAPhysics_option8(verboseLevel);
0170     fPhysDNAName = name;
0171   }
0172   else if (name == "G4EmDNAChemistry") {
0173     if (fEmDNAChemistryList || fEmDNAChemistryList1) {
0174       return;
0175     }
0176     fEmDNAChemistryList = new G4EmDNAChemistry();
0177     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0178   }
0179   else if (name == "G4EmDNAChemistry_option1") {
0180     if (fEmDNAChemistryList || fEmDNAChemistryList1) {
0181       return;
0182     }
0183     fEmDNAChemistryList1 = new G4EmDNAChemistry_option1();
0184     fEmDNAChemistryList1->SetVerboseLevel(verboseLevel);
0185   }
0186   else {
0187     G4cout << "PhysicsList::RegisterConstructor: <" << name << ">"
0188            << " fails - name is not defined" << G4endl;
0189   }
0190 }
0191 
0192 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......