Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:53

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 // dnadamage3 example is derived from the chem6 example
0028 // chem6 example authors: W. G. Shin and S. Incerti (CENBG, France)
0029 //
0030 // Any report or published results obtained using the Geant4-DNA software
0031 // shall cite the following Geant4-DNA collaboration publication:
0032 // J. Appl. Phys. 125 (2019) 104301
0033 // Med. Phys. 45 (2018) e722-e739
0034 // J. Comput. Phys. 274 (2014) 841-882
0035 // Med. Phys. 37 (2010) 4692-4708
0036 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157-178
0037 // The Geant4-DNA web site is available at http://geant4-dna.org
0038 //
0039 // Authors: J. Naoki D. Kondo (UCSF, US)
0040 //          J. Ramos-Mendez and B. Faddegon (UCSF, US)
0041 //
0042 /// \file PhysicsList.cc
0043 /// \brief Implementation of the PhysicsList class
0044 
0045 #include "PhysicsList.hh"
0046 
0047 #include "G4EmDNAChemistry.hh"
0048 #include "G4EmDNAChemistryForPlasmids.hh"
0049 #include "G4EmDNAChemistry_option1.hh"
0050 #include "G4EmDNAChemistry_option2.hh"
0051 #include "G4EmDNAChemistry_option3.hh"
0052 #include "G4EmDNAPhysics.hh"
0053 #include "G4EmDNAPhysics_option1.hh"
0054 #include "G4EmDNAPhysics_option2.hh"
0055 #include "G4EmDNAPhysics_option3.hh"
0056 #include "G4EmDNAPhysics_option4.hh"
0057 #include "G4EmDNAPhysics_option5.hh"
0058 #include "G4EmDNAPhysics_option6.hh"
0059 #include "G4EmDNAPhysics_option7.hh"
0060 #include "G4EmDNAPhysics_option8.hh"
0061 #include "G4EmParameters.hh"
0062 #include "G4PhysicsConstructorRegistry.hh"
0063 #include "G4SystemOfUnits.hh"
0064 
0065 #include <memory>
0066 
0067 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0068 
0069 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0070 {
0071   G4double currentDefaultCut = 1. * nanometer;
0072   // fixe lower limit for cut
0073   G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV);
0074   SetDefaultCutValue(currentDefaultCut);
0075   SetVerboseLevel(1);
0076 
0077   RegisterPhysicsConstructor("G4EmDNAPhysics_option2");
0078   RegisterChemistryConstructor("G4EmDNAChemistryForPlasmids");
0079 
0080   fpPhysicsUI = new G4UIcmdWithAString("/physics/SetPhysics", this);
0081   fpPhysicsUI->AvailableForStates(G4State_PreInit);
0082 
0083   fpChemistryUI = new G4UIcmdWithAString("/physics/SetChemistry", this);
0084   fpChemistryUI->AvailableForStates(G4State_PreInit);
0085 
0086   fpDMSOUI = new G4UIcmdWithADouble("/chem/scavenger/DMSO", this);
0087   fpDMSOUI->AvailableForStates(G4State_PreInit);
0088 
0089   fpOxygenUI = new G4UIcmdWithADouble("/chem/scavenger/Oxygen", this);
0090   fpOxygenUI->AvailableForStates(G4State_PreInit);
0091 }
0092 
0093 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0094 
0095 void PhysicsList::ConstructParticle()
0096 {
0097   if (fEmDNAPhysicsList != nullptr) {
0098     fEmDNAPhysicsList->ConstructParticle();
0099   }
0100   if (fEmDNAChemistryList != nullptr) {
0101     fEmDNAChemistryList->ConstructParticle();
0102   }
0103 }
0104 
0105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0106 
0107 void PhysicsList::ConstructProcess()
0108 {
0109   AddTransportation();
0110   if (fEmDNAPhysicsList != nullptr) {
0111     fEmDNAPhysicsList->ConstructProcess();
0112   }
0113   if (fEmDNAChemistryList != nullptr) {
0114     fEmDNAChemistryList->ConstructProcess();
0115   }
0116 }
0117 
0118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0119 
0120 void PhysicsList::RegisterPhysicsConstructor(const G4String& name)
0121 {
0122   if (name == fPhysDNAName) {
0123     return;
0124   }
0125   if (verboseLevel > 0) {
0126     G4cout << "===== Register Physics constructor   ==== " << name << G4endl;
0127   }
0128   if (name == "G4EmDNAPhysics") {
0129     delete fEmDNAPhysicsList;
0130     fEmDNAPhysicsList = new G4EmDNAPhysics(verboseLevel);
0131     fPhysDNAName = name;
0132   }
0133   else if (name == "G4EmDNAPhysics_option1") {
0134     delete fEmDNAPhysicsList;
0135     fEmDNAPhysicsList = new G4EmDNAPhysics_option1(verboseLevel);
0136     fPhysDNAName = name;
0137   }
0138   else if (name == "G4EmDNAPhysics_option2") {
0139     delete fEmDNAPhysicsList;
0140     fEmDNAPhysicsList = new G4EmDNAPhysics_option2(verboseLevel);
0141     fPhysDNAName = name;
0142   }
0143   else if (name == "G4EmDNAPhysics_option3") {
0144     delete fEmDNAPhysicsList;
0145     fEmDNAPhysicsList = new G4EmDNAPhysics_option3(verboseLevel);
0146     fPhysDNAName = name;
0147   }
0148   else if (name == "G4EmDNAPhysics_option4") {
0149     delete fEmDNAPhysicsList;
0150     fEmDNAPhysicsList = new G4EmDNAPhysics_option4(verboseLevel);
0151     fPhysDNAName = name;
0152   }
0153   else if (name == "G4EmDNAPhysics_option5") {
0154     delete fEmDNAPhysicsList;
0155     fEmDNAPhysicsList = new G4EmDNAPhysics_option5(verboseLevel);
0156     fPhysDNAName = name;
0157   }
0158   else if (name == "G4EmDNAPhysics_option6") {
0159     delete fEmDNAPhysicsList;
0160     fEmDNAPhysicsList = new G4EmDNAPhysics_option6(verboseLevel);
0161     fPhysDNAName = name;
0162   }
0163   else if (name == "G4EmDNAPhysics_option7") {
0164     delete fEmDNAPhysicsList;
0165     fEmDNAPhysicsList = new G4EmDNAPhysics_option7(verboseLevel);
0166     fPhysDNAName = name;
0167   }
0168   else if (name == "G4EmDNAPhysics_option8") {
0169     delete fEmDNAPhysicsList;
0170     fEmDNAPhysicsList = new G4EmDNAPhysics_option8(verboseLevel);
0171     fPhysDNAName = name;
0172   }
0173   else {
0174     G4cout << "PhysicsList::RegisterPhysicsConstructor: <" << name << ">"
0175            << " fails - name is not defined" << G4endl;
0176   }
0177 }
0178 
0179 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0180 
0181 void PhysicsList::RegisterChemistryConstructor(const G4String& name)
0182 {
0183   if (verboseLevel > 0) {
0184     G4cout << "===== Register Chemistry constructor ==== " << name << G4endl;
0185   }
0186   if (name == "G4EmDNAChemistry") {
0187     delete fEmDNAChemistryList;
0188     fEmDNAChemistryList = new G4EmDNAChemistry();
0189     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0190     fChemDNAName = name;
0191   }
0192   else if (name == "G4EmDNAChemistry_option1") {
0193     delete fEmDNAChemistryList;
0194     fEmDNAChemistryList = new G4EmDNAChemistry_option1();
0195     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0196     fChemDNAName = name;
0197   }
0198   else if (name == "G4EmDNAChemistry_option2") {
0199     delete fEmDNAChemistryList;
0200     fEmDNAChemistryList = new G4EmDNAChemistry_option2();
0201     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0202     fChemDNAName = name;
0203   }
0204   else if (name == "G4EmDNAChemistry_option3") {
0205     delete fEmDNAChemistryList;
0206     fEmDNAChemistryList = new G4EmDNAChemistry_option3();
0207     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0208     fChemDNAName = name;
0209   }
0210   else if (name == "G4EmDNAChemistryForPlasmids") {
0211     delete fEmDNAChemistryList;
0212     fEmDNAChemistryList = new G4EmDNAChemistryForPlasmids(fDMSO, fOxygen);
0213     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
0214     fChemDNAName = name;
0215   }
0216   else {
0217     G4cout << "PhysicsList::RegisterChemistryConstructor: <" << name << ">"
0218            << " fails - name is not defined" << G4endl;
0219   }
0220 }
0221 
0222 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0223 
0224 void PhysicsList::SetNewValue(G4UIcommand* command, G4String newValue)
0225 {
0226   if (command == fpPhysicsUI) {
0227     RegisterPhysicsConstructor(newValue);
0228   }
0229 
0230   if (command == fpChemistryUI) {
0231     RegisterChemistryConstructor(newValue);
0232   }
0233 
0234   if (command == fpDMSOUI) {
0235     fDMSO = fpDMSOUI->GetNewDoubleValue(newValue);
0236   }
0237 
0238   else if (command == fpOxygenUI) {
0239     fOxygen = fpOxygenUI->GetNewDoubleValue(newValue);
0240   }
0241 }
0242 
0243 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......