ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IORTPhysicsList.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file IORTPhysicsList.cc
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 Wollongong, Australia
37 //
38 // *Corresponding author, email to carlo.casarino@polooncologicocefalu.it
40 //
41 
42 #include "G4SystemOfUnits.hh"
43 #include "G4RunManager.hh"
44 #include "G4Region.hh"
45 #include "G4RegionStore.hh"
46 #include "IORTPhysicsList.hh"
48 #include "IORTStepMax.hh"
49 #include "G4VPhysicsConstructor.hh"
50 
51 // Physic lists (contained inside the Geant4 source code, in the 'physicslists folder')
54 #include "G4EmLivermorePhysics.hh"
55 #include "G4EmPenelopePhysics.hh"
56 #include "G4EmExtraPhysics.hh"
57 #include "G4EmProcessOptions.hh"
58 #include "G4ParticleDefinition.hh"
59 #include "G4ProductionCutsTable.hh"
60 #include "G4ProcessManager.hh"
61 #include "globals.hh"
62 #include "G4Electron.hh"
63 #include "G4Gamma.hh"
64 #include "G4Positron.hh"
65 #include "G4UnitsTable.hh"
66 #include "G4DecayPhysics.hh"
67 
69 {
70  defaultCutValue = 0.1 *mm;
74 
75  stepMaxProcess = 0;
76 
78 
79  SetVerboseLevel(1);
80 
81  // EM physics
83  emName = G4String("emstandard_opt4");
85 }
86 
88 {
89  delete pMessenger;
90  delete emPhysicsList;
91  delete decPhysicsList;
92 }
93 
95 {
97 }
98 
100 {
101  // transportation
103 
104  // electromagnetic physics list
107 
108  // step limitation (as a full process)
109  //
110  AddStepMax();
111 }
112 
114 {
115 
116  if (verboseLevel>1) {
117  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
118  }
119  if (name == emName) return;
120 
121  if (name == "standard_opt3") {
122  emName = name;
123  delete emPhysicsList;
125  G4RunManager::GetRunManager() -> PhysicsHasBeenModified();
126  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
127 
128 
129  } else if (name == "livermore") {
130  emName = name;
131  delete emPhysicsList;
133  G4RunManager::GetRunManager()-> PhysicsHasBeenModified();
134  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
135 
136  } else if (name == "penelope") {
137  emName = name;
138  delete emPhysicsList;
140  G4RunManager::GetRunManager()-> PhysicsHasBeenModified();
141  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmPenelopePhysics" << G4endl;}
142 
143  else if (name == "standard_opt4") {
144  emName = name;
145  delete emPhysicsList;
147  G4RunManager::GetRunManager() -> PhysicsHasBeenModified();
148  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option4" << G4endl;
149  }
150 
151  else {
152 
153  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
154  << " is not defined"
155  << G4endl;
156  }
157 }
158 
160 {
161  // Step limitation seen as a process
162  stepMaxProcess = new IORTStepMax();
163 
165  particleIterator->reset();
166  while ((*particleIterator)()){
168  G4ProcessManager* pmanager = particle->GetProcessManager();
169 
170  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
171  {
173  }
174  }
175 }
176 
178 {
179 
180  if (verboseLevel >0){
181  G4cout << "PhysicsList::SetCuts:";
182  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
183  }
184 
185  // set cut values for gamma at first and for e- second and next for e+,
186  // because some processes for e+/e- need cut values for gamma
187  SetCutValue(cutForGamma, "gamma");
190 
191  // Set cuts for detector
194 }
195 
197 {
198  cutForGamma = cut;
200 }
201 
203 {
204  cutForElectron = cut;
206 }
207 
209 {
210  cutForPositron = cut;
212 }
213 
215 {
216  G4String regionName = "DetectorLog";
217  G4Region* region = G4RegionStore::GetInstance()->GetRegion(regionName);
218 
219  G4ProductionCuts* cuts = new G4ProductionCuts ;
220  cuts -> SetProductionCut(cut,G4ProductionCuts::GetIndex("gamma"));
221  cuts -> SetProductionCut(cut,G4ProductionCuts::GetIndex("e-"));
222  cuts -> SetProductionCut(cut,G4ProductionCuts::GetIndex("e+"));
223  region -> SetProductionCuts(cuts);
224 }
225