Geant4  10.01
PhysicsList.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 //
28 //
29 // $Id: PhysicsList.cc 82293 2014-06-13 15:23:19Z gcosmo $
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "PhysicsList.hh"
35 #include "PhysicsListMessenger.hh"
36 
37 #include "PhysListEmStandard.hh"
38 
39 #include "G4EmStandardPhysics.hh"
44 #include "G4EmLivermorePhysics.hh"
45 #include "G4EmPenelopePhysics.hh"
46 #include "G4EmLowEPPhysics.hh"
47 
48 #include "G4DecayPhysics.hh"
49 #include "StepMax.hh"
50 
51 #include "G4LossTableManager.hh"
52 #include "G4ProcessManager.hh"
53 
54 #include "G4UnitsTable.hh"
55 #include "G4SystemOfUnits.hh"
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 
60  : G4VModularPhysicsList(),fEmPhysicsList(0),fDecay(0),fMessenger(0)
61 {
62  SetVerboseLevel(1);
63  fMessenger = new PhysicsListMessenger(this);
64 
65  // EM physics
66  fEmName = "emstandard_opt0";
68  fDecay = new G4DecayPhysics();
69 
72 }
73 
74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
75 
77 {
78  delete fMessenger;
79  delete fEmPhysicsList;
80  delete fDecay;
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86 {
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92 
94 {
95  if (verboseLevel > -1) {
96  G4cout << "PhysicsList::ConstructProcess start" << G4endl;
97  }
98  // transportation
99  //
101 
102  // electromagnetic physics list
103  //
105 
106  // decay process
107  //
109 
110  // step limitation (as a full process)
111  //
112  AddStepMax();
113 }
114 
115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
116 
118 {
119  if (verboseLevel>0) {
120  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
121  }
122 
123  if (name == fEmName) return;
124 
125  if (name == "local") {
126 
127  fEmName = name;
128  delete fEmPhysicsList;
130 
131  } else if (name == "emstandard_opt0") {
132 
133  fEmName = name;
134  delete fEmPhysicsList;
136 
137  } else if (name == "emstandard_opt1") {
138 
139  fEmName = name;
140  delete fEmPhysicsList;
142 
143  } else if (name == "emstandard_opt2") {
144 
145  fEmName = name;
146  delete fEmPhysicsList;
148 
149  } else if (name == "emstandard_opt3") {
150 
151  fEmName = name;
152  delete fEmPhysicsList;
154 
155  } else if (name == "emstandard_opt4") {
156 
157  fEmName = name;
158  delete fEmPhysicsList;
160 
161  } else if (name == "empenelope"){
162  fEmName = name;
163  delete fEmPhysicsList;
165 
166  } else if (name == "emlivermore"){
167  fEmName = name;
168  delete fEmPhysicsList;
170 
171  } else if (name == "emlowenergy"){
172  fEmName = name;
173  delete fEmPhysicsList;
175 
176  } else {
177 
178  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
179  << " is not defined"
180  << G4endl;
181  }
182 }
183 
184 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
185 
187 {
188  // Step limitation seen as a process
189  StepMax* stepMaxProcess = new StepMax();
190 
191  theParticleIterator->reset();
192  while ((*theParticleIterator)()){
193  G4ParticleDefinition* particle = theParticleIterator->value();
194  G4ProcessManager* pmanager = particle->GetProcessManager();
195 
196  if (stepMaxProcess->IsApplicable(*particle))
197  {
198  pmanager ->AddDiscreteProcess(stepMaxProcess);
199  }
200  }
201 }
202 
203 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetDefaultCutValue(G4double newCutValue)
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
G4String name
Definition: TRTMaterials.hh:40
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4VPhysicsConstructor * fDecay
Definition: PhysicsList.hh:66
G4ProcessManager * GetProcessManager() const
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
virtual void ConstructParticle()=0
G4GLOB_DLL std::ostream G4cout
void SetVerboseLevel(G4int value)
void AddStepMax()
Definition: PhysicsList.cc:172
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
#define G4endl
Definition: G4ios.hh:61
G4String fEmName
Definition: PhysicsList.hh:72
void ConstructProcess()
Definition: PhysicsList.cc:170
static const double mm
Definition: G4SIunits.hh:102
#define theParticleIterator