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] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 //
  2 // ********************************************************************
  3 // * License and Disclaimer                                           *
  4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.                             *
 10 // *                                                                  *
 11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                                                  *
 18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // ********************************************************************
 25 //
 26 // This example is provided by the Geant4-DNA collaboration
 27 // dnadamage3 example is derived from the chem6 example
 28 // chem6 example authors: W. G. Shin and S. Incerti (CENBG, France)
 29 //
 30 // Any report or published results obtained using the Geant4-DNA software
 31 // shall cite the following Geant4-DNA collaboration publication:
 32 // J. Appl. Phys. 125 (2019) 104301
 33 // Med. Phys. 45 (2018) e722-e739
 34 // J. Comput. Phys. 274 (2014) 841-882
 35 // Med. Phys. 37 (2010) 4692-4708
 36 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157-178
 37 // The Geant4-DNA web site is available at http://geant4-dna.org
 38 //
 39 // Authors: J. Naoki D. Kondo (UCSF, US)
 40 //          J. Ramos-Mendez and B. Faddegon (UCSF, US)
 41 //
 42 /// \file PhysicsList.cc
 43 /// \brief Implementation of the PhysicsList class
 44 
 45 #include "PhysicsList.hh"
 46 
 47 #include "G4EmDNAChemistry.hh"
 48 #include "G4EmDNAChemistryForPlasmids.hh"
 49 #include "G4EmDNAChemistry_option1.hh"
 50 #include "G4EmDNAChemistry_option2.hh"
 51 #include "G4EmDNAChemistry_option3.hh"
 52 #include "G4EmDNAPhysics.hh"
 53 #include "G4EmDNAPhysics_option1.hh"
 54 #include "G4EmDNAPhysics_option2.hh"
 55 #include "G4EmDNAPhysics_option3.hh"
 56 #include "G4EmDNAPhysics_option4.hh"
 57 #include "G4EmDNAPhysics_option5.hh"
 58 #include "G4EmDNAPhysics_option6.hh"
 59 #include "G4EmDNAPhysics_option7.hh"
 60 #include "G4EmDNAPhysics_option8.hh"
 61 #include "G4EmParameters.hh"
 62 #include "G4PhysicsConstructorRegistry.hh"
 63 #include "G4SystemOfUnits.hh"
 64 
 65 #include <memory>
 66 
 67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 68 
 69 PhysicsList::PhysicsList() : G4VModularPhysicsList()
 70 {
 71   G4double currentDefaultCut = 1. * nanometer;
 72   // fixe lower limit for cut
 73   G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV);
 74   SetDefaultCutValue(currentDefaultCut);
 75   SetVerboseLevel(1);
 76 
 77   RegisterPhysicsConstructor("G4EmDNAPhysics_option2");
 78   RegisterChemistryConstructor("G4EmDNAChemistryForPlasmids");
 79 
 80   fpPhysicsUI = new G4UIcmdWithAString("/physics/SetPhysics", this);
 81   fpPhysicsUI->AvailableForStates(G4State_PreInit);
 82 
 83   fpChemistryUI = new G4UIcmdWithAString("/physics/SetChemistry", this);
 84   fpChemistryUI->AvailableForStates(G4State_PreInit);
 85 
 86   fpDMSOUI = new G4UIcmdWithADouble("/chem/scavenger/DMSO", this);
 87   fpDMSOUI->AvailableForStates(G4State_PreInit);
 88 
 89   fpOxygenUI = new G4UIcmdWithADouble("/chem/scavenger/Oxygen", this);
 90   fpOxygenUI->AvailableForStates(G4State_PreInit);
 91 }
 92 
 93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 94 
 95 void PhysicsList::ConstructParticle()
 96 {
 97   if (fEmDNAPhysicsList != nullptr) {
 98     fEmDNAPhysicsList->ConstructParticle();
 99   }
100   if (fEmDNAChemistryList != nullptr) {
101     fEmDNAChemistryList->ConstructParticle();
102   }
103 }
104 
105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
106 
107 void PhysicsList::ConstructProcess()
108 {
109   AddTransportation();
110   if (fEmDNAPhysicsList != nullptr) {
111     fEmDNAPhysicsList->ConstructProcess();
112   }
113   if (fEmDNAChemistryList != nullptr) {
114     fEmDNAChemistryList->ConstructProcess();
115   }
116 }
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119 
120 void PhysicsList::RegisterPhysicsConstructor(const G4String& name)
121 {
122   if (name == fPhysDNAName) {
123     return;
124   }
125   if (verboseLevel > 0) {
126     G4cout << "===== Register Physics constructor   ==== " << name << G4endl;
127   }
128   if (name == "G4EmDNAPhysics") {
129     delete fEmDNAPhysicsList;
130     fEmDNAPhysicsList = new G4EmDNAPhysics(verboseLevel);
131     fPhysDNAName = name;
132   }
133   else if (name == "G4EmDNAPhysics_option1") {
134     delete fEmDNAPhysicsList;
135     fEmDNAPhysicsList = new G4EmDNAPhysics_option1(verboseLevel);
136     fPhysDNAName = name;
137   }
138   else if (name == "G4EmDNAPhysics_option2") {
139     delete fEmDNAPhysicsList;
140     fEmDNAPhysicsList = new G4EmDNAPhysics_option2(verboseLevel);
141     fPhysDNAName = name;
142   }
143   else if (name == "G4EmDNAPhysics_option3") {
144     delete fEmDNAPhysicsList;
145     fEmDNAPhysicsList = new G4EmDNAPhysics_option3(verboseLevel);
146     fPhysDNAName = name;
147   }
148   else if (name == "G4EmDNAPhysics_option4") {
149     delete fEmDNAPhysicsList;
150     fEmDNAPhysicsList = new G4EmDNAPhysics_option4(verboseLevel);
151     fPhysDNAName = name;
152   }
153   else if (name == "G4EmDNAPhysics_option5") {
154     delete fEmDNAPhysicsList;
155     fEmDNAPhysicsList = new G4EmDNAPhysics_option5(verboseLevel);
156     fPhysDNAName = name;
157   }
158   else if (name == "G4EmDNAPhysics_option6") {
159     delete fEmDNAPhysicsList;
160     fEmDNAPhysicsList = new G4EmDNAPhysics_option6(verboseLevel);
161     fPhysDNAName = name;
162   }
163   else if (name == "G4EmDNAPhysics_option7") {
164     delete fEmDNAPhysicsList;
165     fEmDNAPhysicsList = new G4EmDNAPhysics_option7(verboseLevel);
166     fPhysDNAName = name;
167   }
168   else if (name == "G4EmDNAPhysics_option8") {
169     delete fEmDNAPhysicsList;
170     fEmDNAPhysicsList = new G4EmDNAPhysics_option8(verboseLevel);
171     fPhysDNAName = name;
172   }
173   else {
174     G4cout << "PhysicsList::RegisterPhysicsConstructor: <" << name << ">"
175            << " fails - name is not defined" << G4endl;
176   }
177 }
178 
179 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
180 
181 void PhysicsList::RegisterChemistryConstructor(const G4String& name)
182 {
183   if (verboseLevel > 0) {
184     G4cout << "===== Register Chemistry constructor ==== " << name << G4endl;
185   }
186   if (name == "G4EmDNAChemistry") {
187     delete fEmDNAChemistryList;
188     fEmDNAChemistryList = new G4EmDNAChemistry();
189     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
190     fChemDNAName = name;
191   }
192   else if (name == "G4EmDNAChemistry_option1") {
193     delete fEmDNAChemistryList;
194     fEmDNAChemistryList = new G4EmDNAChemistry_option1();
195     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
196     fChemDNAName = name;
197   }
198   else if (name == "G4EmDNAChemistry_option2") {
199     delete fEmDNAChemistryList;
200     fEmDNAChemistryList = new G4EmDNAChemistry_option2();
201     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
202     fChemDNAName = name;
203   }
204   else if (name == "G4EmDNAChemistry_option3") {
205     delete fEmDNAChemistryList;
206     fEmDNAChemistryList = new G4EmDNAChemistry_option3();
207     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
208     fChemDNAName = name;
209   }
210   else if (name == "G4EmDNAChemistryForPlasmids") {
211     delete fEmDNAChemistryList;
212     fEmDNAChemistryList = new G4EmDNAChemistryForPlasmids(fDMSO, fOxygen);
213     fEmDNAChemistryList->SetVerboseLevel(verboseLevel);
214     fChemDNAName = name;
215   }
216   else {
217     G4cout << "PhysicsList::RegisterChemistryConstructor: <" << name << ">"
218            << " fails - name is not defined" << G4endl;
219   }
220 }
221 
222 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
223 
224 void PhysicsList::SetNewValue(G4UIcommand* command, G4String newValue)
225 {
226   if (command == fpPhysicsUI) {
227     RegisterPhysicsConstructor(newValue);
228   }
229 
230   if (command == fpChemistryUI) {
231     RegisterChemistryConstructor(newValue);
232   }
233 
234   if (command == fpDMSOUI) {
235     fDMSO = fpDMSOUI->GetNewDoubleValue(newValue);
236   }
237 
238   else if (command == fpOxygenUI) {
239     fOxygen = fpOxygenUI->GetNewDoubleValue(newValue);
240   }
241 }
242 
243 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
244