ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PhysicsList.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PhysicsList.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 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 publication:
29 // Med. Phys. 37 (2010) 4692-4708
30 // The Geant4-DNA web site is available at http://geant4-dna.org
31 //
32 // If you use this example, please cite the following publication:
33 // Rad. Prot. Dos. 133 (2009) 2-11
34 
35 #include "PhysicsList.hh"
36 #include "PhysicsListMessenger.hh"
37 
38 #include "G4SystemOfUnits.hh"
39 #include "StepMax.hh"
40 
41 #include "G4EmStandardPhysics.hh"
46 #include "G4EmLivermorePhysics.hh"
47 #include "G4EmPenelopePhysics.hh"
48 #include "G4DecayPhysics.hh"
49 
50 #include "G4ProcessManager.hh"
51 
52 #include "G4Gamma.hh"
53 #include "G4Electron.hh"
54 #include "G4Positron.hh"
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 
59 {
60  fMessenger = new PhysicsListMessenger(this);
61 
62  SetVerboseLevel(1);
63 
64  // EM physics
65  fEmName = G4String("emlivermore");
66 
68 
69  // Deacy physics and all particles
71 }
72 
73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74 
76 {
77  delete fMessenger;
78  delete fEmPhysicsList;
79  delete fDecPhysicsList;
80 }
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83 
85 {
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90 
92 {
93  // transportation
95 
96  // electromagnetic physics list
98 
99  // decay physics list
101 
102  // step limitation (as a full process)
103  AddStepMax();
104 
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108 
110 {
111  if (verboseLevel>1) {
112  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
113  }
114 
115  if (name == fEmName) return;
116 
117  if (name == "emstandard_opt0") {
118 
119  fEmName = name;
120  delete fEmPhysicsList;
122 
123  } else if (name == "emstandard_opt1") {
124 
125  fEmName = name;
126  delete fEmPhysicsList;
128 
129  } else if (name == "emstandard_opt2") {
130 
131  fEmName = name;
132  delete fEmPhysicsList;
134 
135  } else if (name == "emstandard_opt3") {
136 
137  fEmName = name;
138  delete fEmPhysicsList;
140 
141  } else if (name == "emstandard_opt4") {
142 
143  fEmName = name;
144  delete fEmPhysicsList;
146 
147  } else if (name == "emlivermore") {
148 
149  fEmName = name;
150  delete fEmPhysicsList;
152 
153  } else if (name == "empenelope") {
154 
155  fEmName = name;
156  delete fEmPhysicsList;
158 
159  }
160 }
161 
162 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
163 
165 {
166  // Step limitation seen as a process
167  StepMax* stepMaxProcess = new StepMax(fMessenger);
168 
170  particleIterator->reset();
171  while ((*particleIterator)()){
173  G4ProcessManager* pmanager = particle->GetProcessManager();
174 
175  if (stepMaxProcess->IsApplicable(*particle))
176  {
177  pmanager ->AddDiscreteProcess(stepMaxProcess);
178  }
179  }
180 }
181 
182 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......