Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IORTPhysicsList.cc
Go to the documentation of this file.
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 is the *BASIC* version of IORT, a Geant4-based application
27 //
28 // Main Authors: G.Russo(a,b), C.Casarino*(c), G.C. Candiano(c), G.A.P. Cirrone(d), F.Romano(d)
29 // Contributor Authors: S.Guatelli(e)
30 // Past Authors: G.Arnetta(c), S.E.Mazzaglia(d)
31 //
32 // (a) Fondazione Istituto San Raffaele G.Giglio, Cefalù, Italy
33 // (b) IBFM-CNR , Segrate (Milano), Italy
34 // (c) LATO (Laboratorio di Tecnologie Oncologiche), Cefalù, Italy
35 // (d) Laboratori Nazionali del Sud of the INFN, Catania, Italy
36 // (e) University of Wallongong, Australia
37 //
38 // *Corresponding author, email to carlo.casarino@polooncologicocefalu.it
39 //////////////////////////////////////////////////////////////////////////////////////////////
40 //
41 // Physics models in IORT, following the Geant4 organisation, can be definided using three different approaches:
42 // 1. Activating one of the 'Reference Physics Lists' that are already prepared by
43 // the Geant4 Collaboration and are contained in the $G4INSTALL/source/physics_lists/lists folder
44 // The 'Reference Physics Lists' can be activated setting a specific enviroment variable to the name
45 // of the physics. For example if the QGSP_BIC Reference Physics Lists must be activated the User
46 // must set export PHYSLIST=QGSP_BIC (or setenv PHYSLIST QGSP_BIC).
47 // A 'Reference Physics Lists' contains all the physics process necessary to a particle transport
48 // If the User set the PHYSLIST variable IORT will start with the defaultMacroWithReferencePhysicsList.mac
49 // macro. See this macro file for more details
50 //
51 // 2. Activating the 'Builders' already prepared by
52 // the Geant4 Collaboration and contained in the $G4INSTALL/source/physics_lists/builder folder.
53 // Each builder is specific of a given model. There are builders for the electromagnetic processes, for the
54 // hadronic one, etc.
55 // If the PHYSLIST variable is not defined IORT starts with the defaultMacro.mac where the single builders
56 // are activated for the various processes of interest.
57 // Each builder is activated with the /Physics/addPhysics <nome builder> command
58 //
59 // ****** SUGGESTED PHYSICS *********
60 //
61 // AT MOMENT, IF ACCURATE RESULTS ARE NEDED, WE STRONGLY RECOMMEND:
62 // 1. The use of the emstandard_opt3, or
63 // 2. the QGSP_BIC_EMY Reference Physics Lists (define the PHYSLIST eviroment variable):
64 // export PHYSLIST=QGSP_BIC_EMY
65 
66 #include "G4SystemOfUnits.hh"
67 #include "G4RunManager.hh"
68 #include "G4Region.hh"
69 #include "G4RegionStore.hh"
70 #include "IORTPhysicsList.hh"
72 #include "IORTStepMax.hh"
73 #include "G4PhysListFactory.hh"
74 #include "G4VPhysicsConstructor.hh"
75 
76 // Local physic directly implemented in the Hadronthrapy directory
77 //#include "LocalIonIonInelasticPhysic.hh" // Physic dedicated to the ion-ion inelastic processes
78 //#include "LocalINCLIonIonInelasticPhysic.hh" // Physic dedicated to the ion-ion inelastic processes using ////INCL/ABLA
79 
80 // #include "LocalStandardICRU73EmPhysic.hh" // This permits the use of the ICRU73 tables for stopping powers of ions. AGGIUNTO da eliot_geant4.9.3p01_version
81 
82 // Physic lists (contained inside the Geant4 source code, in the 'physicslists folder')
84 #include "G4EmLivermorePhysics.hh"
85 #include "G4EmPenelopePhysics.hh"
86 #include "G4EmExtraPhysics.hh"
87 
88 #include "G4StoppingPhysics.hh"
89 #include "G4DecayPhysics.hh"
94 #include "G4HadronInelasticQBBC.hh"
96 #include "G4Decay.hh"
97 #include "G4DecayPhysics.hh"
98 #include "G4NeutronTrackingCut.hh"
99 #include "G4LossTableManager.hh"
100 #include "G4UnitsTable.hh"
101 #include "G4ProcessManager.hh"
102 #include "G4HadronPhysicsQGSP_BIC.hh"
103 #include "G4IonFluctuations.hh"
105 #include "G4EmProcessOptions.hh"
106 
108 
109 /////////////////////////////////////////////////////////////////////////////
111 {
113  defaultCutValue = 0.01 *mm; //1.*mm;
114  cutForGamma = defaultCutValue;
115  cutForElectron = defaultCutValue;
116  cutForPositron = defaultCutValue;
117 
118  helIsRegistered = false;
119  bicIsRegistered = false;
120  biciIsRegistered = false;
121  locIonIonInelasticIsRegistered = false;
122  radioactiveDecayIsRegistered = false;
123 
124  stepMaxProcess = 0;
125 
126  pMessenger = new IORTPhysicsListMessenger(this);
127 
128  SetVerboseLevel(1);
129 
130  // EM physics
131  emPhysicsList = new G4EmStandardPhysics_option3(1);
132  emName = G4String("emstandard_opt3");
133 
134  // Decay physics and all particles
135  decPhysicsList = new G4DecayPhysics();
136 }
137 
138 /////////////////////////////////////////////////////////////////////////////
140 {
141  delete pMessenger;
142  delete emPhysicsList;
143  delete decPhysicsList;
144  for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];}
145 }
146 
147 /////////////////////////////////////////////////////////////////////////////
149 {
150  decPhysicsList->ConstructParticle();
151 }
152 
153 /////////////////////////////////////////////////////////////////////////////
155 {
156  // transportation
158 
159  // electromagnetic physics list
160  emPhysicsList->ConstructProcess();
161  em_config.AddModels();
162 
163  // decay physics list
164  decPhysicsList->ConstructProcess();
165 
166  // hadronic physics lists
167  for(size_t i=0; i<hadronPhys.size(); i++) {
168  hadronPhys[i] -> ConstructProcess();
169  }
170 
171  // step limitation (as a full process)
172  //
173  AddStepMax();
174 }
175 
176 /////////////////////////////////////////////////////////////////////////////
178 {
179 
180  if (verboseLevel>1) {
181  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
182  }
183  if (name == emName) return;
184 
185  /////////////////////////////////////////////////////////////////////////////
186  // ELECTROMAGNETIC MODELS
187  /////////////////////////////////////////////////////////////////////////////
188  if (name == "standard_opt3") {
189  emName = name;
190  delete emPhysicsList;
191  emPhysicsList = new G4EmStandardPhysics_option3();
192  G4RunManager::GetRunManager() -> PhysicsHasBeenModified();
193  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
194 
195 
196  } else if (name == "LowE_Livermore") {
197  emName = name;
198  delete emPhysicsList;
199  emPhysicsList = new G4EmLivermorePhysics();
200  G4RunManager::GetRunManager()-> PhysicsHasBeenModified();
201  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
202 
203  } else if (name == "LowE_Penelope") {
204  emName = name;
205  delete emPhysicsList;
206  emPhysicsList = new G4EmPenelopePhysics();
207  G4RunManager::GetRunManager()-> PhysicsHasBeenModified();
208  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmPenelopePhysics" << G4endl;
209 
210  /////////////////////////////////////////////////////////////////////////////
211  // HADRONIC MODELS
212  /////////////////////////////////////////////////////////////////////////////
213  } else if (name == "Elastic")
214  {
215  if(!helIsRegistered)
216  {
217  G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronElasticPhysics()" << G4endl;
218  hadronPhys.push_back( new G4HadronElasticPhysics());
219  helIsRegistered = true;
220  }
221  else G4cout << "AN ELASTIC PHYSICS HAS BEEN ALREADY ACTIVATED!" << G4endl;
222  }
223  else if (name == "DElastic")
224  {
225  if(!helIsRegistered)
226  {
227  hadronPhys.push_back( new G4HadronDElasticPhysics());
228  helIsRegistered = true;
229  }
230  else G4cout << "AN ELASTIC PHYSICS HAS BEEN ALREADY ACTIVATED!" << G4endl;
231 
232  }
233  else if (name == "HElastic")
234  {
235  if(!helIsRegistered)
236  {
237  hadronPhys.push_back( new G4HadronHElasticPhysics());
238  helIsRegistered = true;
239  }
240  else G4cout << "AN ELASTIC PHYSICS HAS BEEN ALREADY ACTIVATED!" << G4endl;
241 
242  }
243  else if (name == "Em_extra_physics")
244  {
245  hadronPhys.push_back( new G4EmExtraPhysics());
246  }
247  else if (name == "Stopping_physics")
248  {
249  hadronPhys.push_back( new G4StoppingPhysics());
250  }
251  else if (name == "Neutron_tracking_cut")
252  {
253  hadronPhys.push_back( new G4NeutronTrackingCut());
254  }
255  else if (name == "Hadron_QGSP_BIC")
256  {
257  hadronPhys.push_back( new G4HadronPhysicsQGSP_BIC());
258  // helIsRegistered = true;
259  }
260  else if (name == "Hadron_QBBC")
261  {
262  hadronPhys.push_back(new G4HadronInelasticQBBC());
263  //bicIsRegistered = true;
264  G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronInelasticQBBC()" << G4endl;
265  }
266 
267  else if (name == "binary")
268  {
269  hadronPhys.push_back(new G4HadronInelasticQBBC());
270  //bicIsRegisted = true;
271  G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronInelasticQBBC()" << G4endl;
272  }
273 
274  else if (name == "binary_ion")
275  {
276  hadronPhys.push_back(new G4IonBinaryCascadePhysics());
277  //biciIsRegistered = true;
278  }
279 /*
280  else if (name == "local_ion_ion_inelastic")
281  {
282  hadronPhys.push_back(new LocalIonIonInelasticPhysic());
283  locIonIonInelasticIsRegistered = true;
284  }
285  else if (name == "local_incl_ion_ion_inelastic")
286  {
287  hadronPhys.push_back(new LocalINCLIonIonInelasticPhysic());
288  locIonIonInelasticIsRegistered = true;
289  }
290 */
291  else if (name == "decay")
292  {
293  hadronPhys.push_back(new G4DecayPhysics());
294  //radioactiveDecayIsRegistered = true;
295  }
296  else if (name == "radioactive_decay" && !radioactiveDecayIsRegistered )
297  {
298  hadronPhys.push_back(new G4RadioactiveDecayPhysics());
299  radioactiveDecayIsRegistered = true;
300 
301  // The following is the construction of the QGSP_BIC_EMY Reference physics list
302  // reconstructed here like a builder: it should be identical to the
303  // one contained inside the $G4INSTALL/physics_lists/lists folder
304  }
305  else if (name == "QGSP_BIC_EMY")
306  {
307  AddPhysicsList("emstandard_opt3");
308  hadronPhys.push_back( new G4EmExtraPhysics());
309  hadronPhys.push_back( new G4HadronElasticPhysics());
310  hadronPhys.push_back( new G4StoppingPhysics());
311  hadronPhys.push_back( new G4IonBinaryCascadePhysics());
312  hadronPhys.push_back( new G4NeutronTrackingCut());
313  hadronPhys.push_back( new G4HadronPhysicsQGSP_BIC());
314  hadronPhys.push_back( new G4DecayPhysics());
315 
316  }
317  else {
318 
319  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
320  << " is not defined"
321  << G4endl;
322  }
323 }
324 
325 /////////////////////////////////////////////////////////////////////////////
327 {
328  // Step limitation seen as a process
329  stepMaxProcess = new IORTStepMax();
330 
331  theParticleIterator->reset();
332  while ((*theParticleIterator)()){
333  G4ParticleDefinition* particle = theParticleIterator->value();
334  G4ProcessManager* pmanager = particle->GetProcessManager();
335 
336  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
337  {
338  pmanager ->AddDiscreteProcess(stepMaxProcess);
339  }
340  }
341 }
342 
343 /////////////////////////////////////////////////////////////////////////////
345 {
346 
347  if (verboseLevel >0){
348  G4cout << "PhysicsList::SetCuts:";
349  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
350  }
351 
352  // set cut values for gamma at first and for e- second and next for e+,
353  // because some processes for e+/e- need cut values for gamma
354  SetCutValue(cutForGamma, "gamma");
355  SetCutValue(cutForElectron, "e-");
356  SetCutValue(cutForPositron, "e+");
357 
358  // Set cuts for detector
361 }
362 
363 /////////////////////////////////////////////////////////////////////////////
365 {
366  cutForGamma = cut;
367  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
368 }
369 
370 /////////////////////////////////////////////////////////////////////////////
372 {
373  cutForElectron = cut;
374  SetParticleCuts(cutForElectron, G4Electron::Electron());
375 }
376 
377 /////////////////////////////////////////////////////////////////////////////
379 {
380  cutForPositron = cut;
381  SetParticleCuts(cutForPositron, G4Positron::Positron());
382 }
383 
385 {
386  G4String regionName = "DetectorLog";
387  G4Region* region = G4RegionStore::GetInstance()->GetRegion(regionName);
388 
389  G4ProductionCuts* cuts = new G4ProductionCuts ;
390  cuts -> SetProductionCut(cut,G4ProductionCuts::GetIndex("gamma"));
391  cuts -> SetProductionCut(cut,G4ProductionCuts::GetIndex("e-"));
392  cuts -> SetProductionCut(cut,G4ProductionCuts::GetIndex("e+"));
393  region -> SetProductionCuts(cuts);
394 }
395 
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
static G4LossTableManager * Instance()
static G4int GetIndex(const G4String &name)
void SetCutValue(G4double aCut, const G4String &pname)
void AddPhysicsList(const G4String &name)
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
const XML_Char * name
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4ProcessManager * GetProcessManager() const
void SetCutForPositron(G4double)
static G4RegionStore * GetInstance()
virtual void ConstructParticle()=0
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
void SetCutForElectron(G4double)
void SetDetectorCut(G4double cut)
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
static G4Positron * Positron()
Definition: G4Positron.cc:94
void SetCutForGamma(G4double)
virtual void ConstructProcess()=0
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4bool IsApplicable(const G4ParticleDefinition &)
Definition: IORTStepMax.cc:55
virtual ~IORTPhysicsList()
#define theParticleIterator