Geant4  9.6.p02
 All Classes 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
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 "G4QStoppingPhysics.hh"
89 #include "G4DecayPhysics.hh"
95 #include "G4HadronInelasticQBBC.hh"
97 #include "G4Decay.hh"
98 #include "G4DecayPhysics.hh"
99 #include "G4NeutronTrackingCut.hh"
100 #include "G4LossTableManager.hh"
101 #include "G4UnitsTable.hh"
102 #include "G4ProcessManager.hh"
103 #include "HadronPhysicsQGSP_BIC.hh"
104 #include "G4IonFluctuations.hh"
106 #include "G4EmProcessOptions.hh"
107 
109 
112 {
114  defaultCutValue = 0.01 *mm; //1.*mm;
115  cutForGamma = defaultCutValue;
116  cutForElectron = defaultCutValue;
117  cutForPositron = defaultCutValue;
118 
119  helIsRegistered = false;
120  bicIsRegistered = false;
121  biciIsRegistered = false;
122  locIonIonInelasticIsRegistered = false;
123  radioactiveDecayIsRegistered = false;
124 
125  stepMaxProcess = 0;
126 
127  pMessenger = new IORTPhysicsListMessenger(this);
128 
129  SetVerboseLevel(1);
130 
131  // EM physics
132  emPhysicsList = new G4EmStandardPhysics_option3(1);
133  emName = G4String("emstandard_opt3");
134 
135  // Decay physics and all particles
136  decPhysicsList = new G4DecayPhysics();
137 }
138 
141 {
142  delete pMessenger;
143  delete emPhysicsList;
144  delete decPhysicsList;
145  for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];}
146 }
147 
150 {
151  decPhysicsList->ConstructParticle();
152 }
153 
156 {
157  // transportation
159 
160  // electromagnetic physics list
161  emPhysicsList->ConstructProcess();
162  em_config.AddModels();
163 
164  // decay physics list
165  decPhysicsList->ConstructProcess();
166 
167  // hadronic physics lists
168  for(size_t i=0; i<hadronPhys.size(); i++) {
169  hadronPhys[i] -> ConstructProcess();
170  }
171 
172  // step limitation (as a full process)
173  //
174  AddStepMax();
175 }
176 
179 {
180 
181  if (verboseLevel>1) {
182  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
183  }
184  if (name == emName) return;
185 
187  // ELECTROMAGNETIC MODELS
189  if (name == "standard_opt3") {
190  emName = name;
191  delete emPhysicsList;
192  emPhysicsList = new G4EmStandardPhysics_option3();
193  G4RunManager::GetRunManager() -> PhysicsHasBeenModified();
194  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
195 
196 
197  } else if (name == "LowE_Livermore") {
198  emName = name;
199  delete emPhysicsList;
200  emPhysicsList = new G4EmLivermorePhysics();
201  G4RunManager::GetRunManager()-> PhysicsHasBeenModified();
202  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
203 
204  } else if (name == "LowE_Penelope") {
205  emName = name;
206  delete emPhysicsList;
207  emPhysicsList = new G4EmPenelopePhysics();
208  G4RunManager::GetRunManager()-> PhysicsHasBeenModified();
209  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmPenelopePhysics" << G4endl;
210 
212  // HADRONIC MODELS
214  } else if (name == "Elastic")
215  {
216  if(!helIsRegistered)
217  {
218  G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronElasticPhysics()" << G4endl;
219  hadronPhys.push_back( new G4HadronElasticPhysics());
220  helIsRegistered = true;
221  }
222  else G4cout << "AN ELASTIC PHYSICS HAS BEEN ALREADY ACTIVATED!" << G4endl;
223  }
224  else if (name == "DElastic")
225  {
226  if(!helIsRegistered)
227  {
228  hadronPhys.push_back( new G4HadronDElasticPhysics());
229  helIsRegistered = true;
230  }
231  else G4cout << "AN ELASTIC PHYSICS HAS BEEN ALREADY ACTIVATED!" << G4endl;
232 
233  }
234  else if (name == "HElastic")
235  {
236  if(!helIsRegistered)
237  {
238  hadronPhys.push_back( new G4HadronHElasticPhysics());
239  helIsRegistered = true;
240  }
241  else G4cout << "AN ELASTIC PHYSICS HAS BEEN ALREADY ACTIVATED!" << G4endl;
242 
243  }
244  else if (name == "QElastic")
245  {
246  if(!helIsRegistered)
247  {
248  hadronPhys.push_back( new G4HadronQElasticPhysics());
249  helIsRegistered = true;
250  }
251  else G4cout << "AN ELASTIC PHYSICS HAS BEEN ALREADY ACTIVATED!" << G4endl;
252 
253  }
254  else if (name == "Em_extra_physics")
255  {
256  hadronPhys.push_back( new G4EmExtraPhysics());
257  }
258  else if (name == "Stopping_physics")
259  {
260  hadronPhys.push_back( new G4QStoppingPhysics());
261  }
262  else if (name == "Neutron_tracking_cut")
263  {
264  hadronPhys.push_back( new G4NeutronTrackingCut());
265  }
266  else if (name == "Hadron_QGSP_BIC")
267  {
268  hadronPhys.push_back( new HadronPhysicsQGSP_BIC());
269  // helIsRegistered = true;
270  }
271  else if (name == "Hadron_QBBC")
272  {
273  hadronPhys.push_back(new G4HadronInelasticQBBC());
274  //bicIsRegistered = true;
275  G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronInelasticQBBC()" << G4endl;
276  }
277 
278  else if (name == "binary")
279  {
280  hadronPhys.push_back(new G4HadronInelasticQBBC());
281  //bicIsRegisted = true;
282  G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronInelasticQBBC()" << G4endl;
283  }
284 
285  else if (name == "binary_ion")
286  {
287  hadronPhys.push_back(new G4IonBinaryCascadePhysics());
288  //biciIsRegistered = true;
289  }
290 /*
291  else if (name == "local_ion_ion_inelastic")
292  {
293  hadronPhys.push_back(new LocalIonIonInelasticPhysic());
294  locIonIonInelasticIsRegistered = true;
295  }
296  else if (name == "local_incl_ion_ion_inelastic")
297  {
298  hadronPhys.push_back(new LocalINCLIonIonInelasticPhysic());
299  locIonIonInelasticIsRegistered = true;
300  }
301 */
302  else if (name == "decay")
303  {
304  hadronPhys.push_back(new G4DecayPhysics());
305  //radioactiveDecayIsRegistered = true;
306  }
307  else if (name == "radioactive_decay" && !radioactiveDecayIsRegistered )
308  {
309  hadronPhys.push_back(new G4RadioactiveDecayPhysics());
310  radioactiveDecayIsRegistered = true;
311 
312  // The following is the construction of the QGSP_BIC_EMY Reference physics list
313  // reconstructed here like a builder: it should be identical to the
314  // one contained inside the $G4INSTALL/physics_lists/lists folder
315  }
316  else if (name == "QGSP_BIC_EMY")
317  {
318  AddPhysicsList("emstandard_opt3");
319  hadronPhys.push_back( new G4EmExtraPhysics());
320  hadronPhys.push_back( new G4HadronElasticPhysics());
321  hadronPhys.push_back( new G4QStoppingPhysics());
322  hadronPhys.push_back( new G4IonBinaryCascadePhysics());
323  hadronPhys.push_back( new G4NeutronTrackingCut());
324  hadronPhys.push_back( new HadronPhysicsQGSP_BIC());
325  hadronPhys.push_back( new G4DecayPhysics());
326 
327  }
328  else {
329 
330  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
331  << " is not defined"
332  << G4endl;
333  }
334 }
335 
338 {
339  // Step limitation seen as a process
340  stepMaxProcess = new IORTStepMax();
341 
343  while ((*theParticleIterator)()){
345  G4ProcessManager* pmanager = particle->GetProcessManager();
346 
347  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
348  {
349  pmanager ->AddDiscreteProcess(stepMaxProcess);
350  }
351  }
352 }
353 
356 {
357 
358  if (verboseLevel >0){
359  G4cout << "PhysicsList::SetCuts:";
360  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
361  }
362 
363  // set cut values for gamma at first and for e- second and next for e+,
364  // because some processes for e+/e- need cut values for gamma
365  SetCutValue(cutForGamma, "gamma");
366  SetCutValue(cutForElectron, "e-");
367  SetCutValue(cutForPositron, "e+");
368 
369  // Set cuts for detector
372 }
373 
376 {
377  cutForGamma = cut;
378  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
379 }
380 
383 {
384  cutForElectron = cut;
385  SetParticleCuts(cutForElectron, G4Electron::Electron());
386 }
387 
390 {
391  cutForPositron = cut;
392  SetParticleCuts(cutForPositron, G4Positron::Positron());
393 }
394 
396 {
397  G4String regionName = "DetectorLog";
398  G4Region* region = G4RegionStore::GetInstance()->GetRegion(regionName);
399 
400  G4ProductionCuts* cuts = new G4ProductionCuts ;
401  cuts -> SetProductionCut(cut,G4ProductionCuts::GetIndex("gamma"));
402  cuts -> SetProductionCut(cut,G4ProductionCuts::GetIndex("e-"));
403  cuts -> SetProductionCut(cut,G4ProductionCuts::GetIndex("e+"));
404  region -> SetProductionCuts(cuts);
405 }
406