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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 // Any report or published results obtained using the Geant4-DNA software
 28 // shall cite the following Geant4-DNA collaboration publications:
 29 // Med. Phys. 45, (2018) e722-e739
 30 // Phys. Med. 31 (2015) 861-874
 31 // Med. Phys. 37 (2010) 4692-4708
 32 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
 33 // The Geant4-DNA web site is available at http://geant4-dna.org
 34 //
 35 //
 36 /// \file PhysicsList.cc
 37 /// \brief Implementation of the PhysicsList class
 38 
 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 40 
 41 #include "PhysicsList.hh"
 42 
 43 #include "G4DecayPhysics.hh"
 44 #include "G4EmDNABuilder.hh"
 45 #include "G4EmDNAPhysics.hh"
 46 #include "G4EmDNAPhysicsActivator.hh"
 47 #include "G4EmDNAPhysics_option1.hh"
 48 #include "G4EmDNAPhysics_option2.hh"
 49 #include "G4EmDNAPhysics_option3.hh"
 50 #include "G4EmDNAPhysics_option4.hh"
 51 #include "G4EmDNAPhysics_option5.hh"
 52 #include "G4EmDNAPhysics_option6.hh"
 53 #include "G4EmDNAPhysics_option7.hh"
 54 #include "G4EmDNAPhysics_option8.hh"
 55 #include "G4EmLivermorePhysics.hh"
 56 #include "G4EmPenelopePhysics.hh"
 57 #include "G4EmStandardPhysics.hh"
 58 #include "G4EmStandardPhysics_option3.hh"
 59 #include "G4EmStandardPhysics_option4.hh"
 60 #include "G4GenericIon.hh"
 61 #include "G4RadioactiveDecayPhysics.hh"
 62 
 63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 64 
 65 PhysicsList::PhysicsList() : G4VModularPhysicsList()
 66 {
 67   SetDefaultCutValue(1.0 * micrometer);
 68   SetVerboseLevel(1);
 69 
 70   fEmPhysics = "emstandard_opt4";
 71   fEmPhysicsList = new G4EmStandardPhysics_option4();
 72   fDecayPhysicsList = new G4DecayPhysics();
 73   fEmDNAActivator = new G4EmDNAPhysicsActivator();
 74 
 75   G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV);
 76   G4EmParameters* param = G4EmParameters::Instance();
 77   param->SetMinEnergy(100 * eV);
 78   param->SetMaxEnergy(1 * GeV);
 79 }
 80 
 81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 82 
 83 PhysicsList::~PhysicsList()
 84 {
 85   delete fEmPhysicsList;
 86   delete fEmDNAActivator;
 87   delete fDecayPhysicsList;
 88   delete fRadDecayPhysicsList;
 89 }
 90 
 91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 92 
 93 void PhysicsList::ConstructParticle()
 94 {
 95   fEmPhysicsList->ConstructParticle();
 96   fDecayPhysicsList->ConstructParticle();
 97   fEmDNAActivator->ConstructParticle();
 98 }
 99 
100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101 
102 void PhysicsList::ConstructProcess()
103 {
104   AddTransportation();
105   fEmPhysicsList->ConstructProcess();
106   fDecayPhysicsList->ConstructProcess();
107 
108   if (nullptr != fRadDecayPhysicsList) {
109     fRadDecayPhysicsList->ConstructProcess();
110   }
111 
112   if (!fDNAPL) {
113     fEmDNAActivator->ConstructProcess();
114   }
115 
116   if (fIsTrackingCutSet) {
117     TrackingCut();
118   }
119 }
120 
121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
122 
123 void PhysicsList::AddPhysics(const G4String& name)
124 {
125   if (name == fEmPhysics) {
126     return;
127   }
128 
129   G4cout << "### PhysicsList::AddPhysics Warning: Physics List <" << name << "> is requested"
130          << G4endl;
131 
132   fEmPhysics = name;
133 
134   if (name == "emstandard_opt0") {
135     delete fEmPhysicsList;
136     fEmPhysicsList = new G4EmStandardPhysics();
137     fDNAPL = false;
138   }
139   else if (name == "emstandard_opt3") {
140     delete fEmPhysicsList;
141     fEmPhysicsList = new G4EmStandardPhysics_option3();
142     fDNAPL = false;
143   }
144   else if (name == "emstandard_opt4") {
145     delete fEmPhysicsList;
146     fEmPhysicsList = new G4EmStandardPhysics_option4();
147     fDNAPL = false;
148   }
149   else if (name == "raddecay") {
150     if (nullptr == fRadDecayPhysicsList) fRadDecayPhysicsList = new G4RadioactiveDecayPhysics();
151   }
152   else if (name == "emlivermore") {
153     delete fEmPhysicsList;
154     fEmPhysicsList = new G4EmLivermorePhysics();
155     fDNAPL = false;
156   }
157   else if (name == "empenelope") {
158     delete fEmPhysicsList;
159     fEmPhysicsList = new G4EmPenelopePhysics();
160     fDNAPL = false;
161   }
162   else if (name == "DNA_Opt0") {
163     delete fEmPhysicsList;
164     fEmPhysicsList = new G4EmDNAPhysics();
165     fDNAPL = true;
166   }
167   else if (name == "DNA_Opt1") {
168     delete fEmPhysicsList;
169     fEmPhysicsList = new G4EmDNAPhysics_option1();
170     fDNAPL = true;
171   }
172   else if (name == "DNA_Opt2") {
173     delete fEmPhysicsList;
174     fEmPhysicsList = new G4EmDNAPhysics_option2();
175     fDNAPL = true;
176   }
177   else if (name == "DNA_Opt3") {
178     delete fEmPhysicsList;
179     fEmPhysicsList = new G4EmDNAPhysics_option3();
180     fDNAPL = true;
181   }
182   else if (name == "DNA_Opt4") {
183     delete fEmPhysicsList;
184     fEmPhysicsList = new G4EmDNAPhysics_option4();
185     fDNAPL = true;
186   }
187   else if (name == "DNA_Opt5") {
188     delete fEmPhysicsList;
189     fEmPhysicsList = new G4EmDNAPhysics_option5();
190     fDNAPL = true;
191   }
192   else if (name == "DNA_Opt6") {
193     delete fEmPhysicsList;
194     fEmPhysicsList = new G4EmDNAPhysics_option6();
195     fDNAPL = true;
196   }
197   else if (name == "DNA_Opt7") {
198     delete fEmPhysicsList;
199     fEmPhysicsList = new G4EmDNAPhysics_option7();
200     fDNAPL = true;
201   }
202   else if (name == "DNA_Opt8") {
203     delete fEmPhysicsList;
204     fEmPhysicsList = new G4EmDNAPhysics_option8();
205     fDNAPL = true;
206   }
207   else {
208     G4cout << "### PhysicsList::AddPhysics Warning: Physics List <" << name
209            << "> is does not exist - the command ignored" << G4endl;
210   }
211 }
212 
213 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
214 
215 void PhysicsList::TrackingCut()
216 {
217   auto particle = G4GenericIon::GenericIon();  // DNA heavy ions
218   auto particleName = particle->GetParticleName();
219   auto capture = G4EmDNABuilder::FindOrBuildCapture(0.5 * CLHEP::MeV, particle);
220   capture->AddRegion("World");
221   capture->AddRegion("regionTarget");
222   capture->SetKinEnergyLimit(0.5 * CLHEP::MeV);  // 0.5 MeV/u
223 }
224 
225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
226 
227 void PhysicsList::SetTrackingCut(G4bool isCut)
228 {
229   fIsTrackingCutSet = isCut;
230 }
231