Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
examples/extended/electromagnetic/TestEm12/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 102179 2017-01-09 13:27:32Z 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 #include "PhysListEmStandardSSM.hh"
39 
40 #include "G4EmStandardPhysics.hh"
46 #include "G4EmStandardPhysicsGS.hh"
47 #include "G4EmStandardPhysicsSS.hh"
48 #include "G4EmLivermorePhysics.hh"
49 #include "G4EmPenelopePhysics.hh"
50 #include "G4EmLowEPPhysics.hh"
51 #include "G4EmDNAPhysics.hh"
59 
60 #include "G4LossTableManager.hh"
61 #include "G4UnitsTable.hh"
62 #include "G4SystemOfUnits.hh"
63 
64 // particles
65 
66 #include "G4BosonConstructor.hh"
67 #include "G4LeptonConstructor.hh"
68 #include "G4MesonConstructor.hh"
69 #include "G4BosonConstructor.hh"
70 #include "G4BaryonConstructor.hh"
71 #include "G4IonConstructor.hh"
74 
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78 
80 {
81  fMessenger = new PhysicsListMessenger(this);
82 
83  SetVerboseLevel(1);
84 
85  // EM physics
86  fEmPhysicsList = new PhysListEmStandard(fEmName = "local");
87 
88  // Em options
89  //
91 
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96 
98 {
99  delete fMessenger;
100  delete fEmPhysicsList;
101 }
102 
103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
104 
106 {
107  G4BosonConstructor pBosonConstructor;
108  pBosonConstructor.ConstructParticle();
109 
110  G4LeptonConstructor pLeptonConstructor;
111  pLeptonConstructor.ConstructParticle();
112 
113  G4MesonConstructor pMesonConstructor;
114  pMesonConstructor.ConstructParticle();
115 
116  G4BaryonConstructor pBaryonConstructor;
117  pBaryonConstructor.ConstructParticle();
118 
119  G4IonConstructor pIonConstructor;
120  pIonConstructor.ConstructParticle();
121 
122  G4ShortLivedConstructor pShortLivedConstructor;
123  pShortLivedConstructor.ConstructParticle();
124 
125 // DNA
126  G4DNAGenericIonsManager* genericIonsManager;
127  genericIonsManager=G4DNAGenericIonsManager::Instance();
128  genericIonsManager->GetIon("alpha++");
129  genericIonsManager->GetIon("alpha+");
130  genericIonsManager->GetIon("helium");
131  genericIonsManager->GetIon("hydrogen");
132 }
133 
134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
135 
136 #include "G4ProcessManager.hh"
137 
139 {
140  // transportation
141  //
143 
144  // electromagnetic physics list
145  //
147 
148  // decay process
149  //
150  AddDecay();
151 
152  // step limitation (as a full process)
153  //
154  AddStepMax();
155 }
156 
157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
158 
160 {
161  if (verboseLevel>-1) {
162  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
163  }
164 
165  if (name == fEmName) return;
166 
167  if (name == "local") {
168 
169  fEmName = name;
170  delete fEmPhysicsList;
172 
173  } else if (name == "emstandard_opt0") {
174 
175  fEmName = name;
176  delete fEmPhysicsList;
178 
179  } else if (name == "emstandard_opt1") {
180 
181  fEmName = name;
182  delete fEmPhysicsList;
184 
185  } else if (name == "emstandard_opt2") {
186 
187  fEmName = name;
188  delete fEmPhysicsList;
190 
191  } else if (name == "emstandard_opt3") {
192 
193  fEmName = name;
194  delete fEmPhysicsList;
196 
197  } else if (name == "emstandard_opt4") {
198 
199  fEmName = name;
200  delete fEmPhysicsList;
202 
203  } else if (name == "emstandardSS") {
204 
205  fEmName = name;
206  delete fEmPhysicsList;
208 
209  } else if (name == "standardSSM") {
210 
211  fEmName = name;
212  delete fEmPhysicsList;
214 
215  } else if (name == "emstandardWVI") {
216 
217  fEmName = name;
218  delete fEmPhysicsList;
220 
221  } else if (name == "standardGS") {
222 
223  fEmName = name;
224  delete fEmPhysicsList;
226 
227  } else if (name == "emlivermore") {
228  fEmName = name;
229  delete fEmPhysicsList;
231 
232  } else if (name == "empenelope") {
233  fEmName = name;
234  delete fEmPhysicsList;
236 
237  } else if (name == "emlowenergy") {
238  fEmName = name;
239  delete fEmPhysicsList;
241 
242  } else if (name == "dna") {
243  fEmName = name;
244  delete fEmPhysicsList;
246 
247  } else if (name == "dna_opt1") {
248  fEmName = name;
249  delete fEmPhysicsList;
251 
252  } else if (name == "dna_opt2") {
253  fEmName = name;
254  delete fEmPhysicsList;
256 
257  } else if (name == "dna_opt3") {
258  fEmName = name;
259  delete fEmPhysicsList;
261 
262  } else if (name == "dna_opt4") {
263  fEmName = name;
264  delete fEmPhysicsList;
266 
267  } else if (name == "dna_opt5") {
268  fEmName = name;
269  delete fEmPhysicsList;
271 
272  } else if (name == "dna_opt6") {
273  fEmName = name;
274  delete fEmPhysicsList;
276 
277  } else if (name == "dna_opt7") {
278  fEmName = name;
279  delete fEmPhysicsList;
281 
282  } else {
283 
284  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
285  << " is not defined"
286  << G4endl;
287  }
289 }
290 
291 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
292 
293 #include "G4Decay.hh"
294 
296 {
297  // decay process
298  //
299  G4Decay* fDecayProcess = new G4Decay();
300 
302  particleIterator->reset();
303  while( (*particleIterator)() ){
304  G4ParticleDefinition* particle = particleIterator->value();
305  G4ProcessManager* pmanager = particle->GetProcessManager();
306 
307  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
308 
309  pmanager ->AddProcess(fDecayProcess);
310 
311  // set ordering for PostStepDoIt and AtRestDoIt
312  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
313  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
314 
315  }
316  }
317 }
318 
319 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
320 
321 #include "StepMax.hh"
322 
324 {
325  // Step limitation seen as a process
326  fStepMaxProcess = new StepMax();
327 
329  particleIterator->reset();
330  while ((*particleIterator)()){
331  G4ParticleDefinition* particle = particleIterator->value();
332  G4ProcessManager* pmanager = particle->GetProcessManager();
333 
334  if (fStepMaxProcess->IsApplicable(*particle))
335  {
337  }
338  }
339 }
340 
341 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const XML_Char * name
Definition: expat.h:151
static void ConstructParticle()
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static constexpr double mm
Definition: G4SIunits.hh:115
#define G4endl
Definition: G4ios.hh:61
static void ConstructParticle()
static void ConstructParticle()
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205
virtual G4bool IsApplicable(const G4ParticleDefinition &) override
Definition: G4Decay.cc:89
void SetBuildCSDARange(G4bool val)
#define G4ThreadLocal
Definition: tls.hh:69
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
virtual void ConstructProcess()=0
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
Definition of the PhysListEmStandardSSM class.
PhysicsList()
Implementation of the PhysicsList class.
static void ConstructParticle()
void SetDefaultCutValue(G4double newCutValue)
static void ConstructParticle()
G4ParticleDefinition * GetIon(const G4String &name)
G4ProcessManager * GetProcessManager() const
static G4DNAGenericIonsManager * Instance(void)
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4GLOB_DLL std::ostream G4cout
static G4EmParameters * Instance()
void SetVerboseLevel(G4int value)