Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
examples/extended/electromagnetic/TestEm8/src/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 //
28 //
29 // $Id: PhysicsList.cc 106960 2017-10-31 08:35:19Z gcosmo $
30 //
31 //---------------------------------------------------------------------------
32 //
33 // ClassName: PhysicsList
34 //
35 // Description: EM physics with a possibility to add PAI model
36 //
37 // Author: V.Ivanchenko 01.09.2010
38 //
39 //----------------------------------------------------------------------------
40 //
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
45 #include "PhysicsList.hh"
46 #include "PhysicsListMessenger.hh"
47 
48 #include "G4EmStandardPhysics.hh"
53 #include "G4EmStandardPhysicsGS.hh"
54 #include "G4EmStandardPhysicsSS.hh"
56 #include "G4EmLivermorePhysics.hh"
57 #include "G4EmPenelopePhysics.hh"
58 #include "G4EmLowEPPhysics.hh"
59 #include "G4DecayPhysics.hh"
60 
61 #include "G4PAIModel.hh"
62 #include "G4PAIPhotModel.hh"
63 
64 #include "G4Gamma.hh"
65 #include "G4Electron.hh"
66 #include "G4Positron.hh"
67 #include "G4Proton.hh"
68 
69 #include "G4UnitsTable.hh"
70 #include "G4SystemOfUnits.hh"
71 #include "G4LossTableManager.hh"
72 #include "G4ProductionCutsTable.hh"
73 #include "G4EmConfigurator.hh"
74 #include "G4EmParameters.hh"
75 
76 #include "StepMax.hh"
77 
78 #include "G4ProcessManager.hh"
79 #include "G4ParticleTypes.hh"
80 #include "G4ParticleTable.hh"
81 #include "DetectorConstruction.hh"
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86  : G4VModularPhysicsList(), fDetectorConstruction(ptr)
87 {
88  // set verbosity for zero to avoid double printout
89  // on physics verbosity should be restored to 1 when cuts
90  // are set
92 
94 
95  fMessenger = new PhysicsListMessenger(this);
96 
97  // Decay Physics is always defined
99 
100  // EM physics
101  fEmName = G4String("emstandard_opt0");
103 
104  SetVerboseLevel(1);
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108 
110 {
111  delete fMessenger;
112  delete fDecayPhysicsList;
113  delete fEmPhysicsList;
114 }
115 
116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
117 
119 {
121 }
122 
123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
124 
126 {
130  AddStepMax();
131 }
132 
133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
134 
136 {
137  if (verboseLevel>1) {
138  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
139  }
140 
141  if (name == fEmName) {
142  return;
143 
144  } else if (name == "emstandard_opt0") {
145 
146  fEmName = name;
147  delete fEmPhysicsList;
149 
150  } else if (name == "emstandard_opt1") {
151 
152  fEmName = name;
153  delete fEmPhysicsList;
155 
156  } else if (name == "emstandard_opt2") {
157 
158  fEmName = name;
159  delete fEmPhysicsList;
161 
162  } else if (name == "emstandard_opt3") {
163 
164  fEmName = name;
165  delete fEmPhysicsList;
167 
168  } else if (name == "emstandard_opt4") {
169 
170  fEmName = name;
171  delete fEmPhysicsList;
173 
174  } else if (name == "emstandardWVI") {
175 
176  fEmName = name;
177  delete fEmPhysicsList;
179 
180  } else if (name == "emstandardSS") {
181 
182  fEmName = name;
183  delete fEmPhysicsList;
185 
186  } else if (name == "emstandardGS") {
187 
188  fEmName = name;
189  delete fEmPhysicsList;
191 
192  } else if (name == "pai") {
193  G4EmParameters::Instance()->AddPAIModel("all","world","pai");
194 
195  } else if (name == "pai_photon") {
196  G4EmParameters::Instance()->AddPAIModel("all","world","pai_photon");
197 
198  } else if (name == "emlivermore") {
199 
200  fEmName = name;
201  delete fEmPhysicsList;
203 
204  } else if (name == "empenelope") {
205 
206  fEmName = name;
207  delete fEmPhysicsList;
209 
210  } else if (name == "emlowenergy") {
211 
212  fEmName = name;
213  delete fEmPhysicsList;
215 
216  } else {
217 
218  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
219  << " is not defined"
220  << G4endl;
221  }
222 }
223 
224 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
225 
227 {
228  // Step limitation seen as a process
229  StepMax* stepMaxProcess = new StepMax(fDetectorConstruction);
230 
232  particleIterator->reset();
233  while ((*particleIterator)())
234  {
235  G4ParticleDefinition* particle = particleIterator->value();
236  G4ProcessManager* pmanager = particle->GetProcessManager();
237 
238  if (stepMaxProcess->IsApplicable(*particle))
239  {
240  pmanager->AddDiscreteProcess(stepMaxProcess);
241  }
242  }
243 }
244 
245 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
246 
248 {
250  if ( verboseLevel > 0 ) { DumpCutValuesTable(); }
251 }
252 
253 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
254 
const XML_Char * name
Definition: expat.h:151
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static constexpr double mm
Definition: G4SIunits.hh:115
#define G4endl
Definition: G4ios.hh:61
void SetVerbose(G4int val)
void AddPAIModel(const G4String &particle, const G4String &region, const G4String &type)
void SetEnergyRange(G4double lowedge, G4double highedge)
virtual void ConstructParticle()=0
virtual void ConstructProcess()=0
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
PhysicsList()
Implementation of the PhysicsList class.
static constexpr double eV
Definition: G4SIunits.hh:215
void SetDefaultCutValue(G4double newCutValue)
static G4ProductionCutsTable * GetProductionCutsTable()
virtual G4bool IsApplicable(const G4ParticleDefinition &)
G4ProcessManager * GetProcessManager() const
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4GLOB_DLL std::ostream G4cout
void DumpCutValuesTable(G4int flag=1)
static G4EmParameters * Instance()
Simple detector construction with a box volume placed in a world.
void SetVerboseLevel(G4int value)