Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
examples/extended/electromagnetic/TestEm2/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 109103 2018-03-27 07:39:04Z 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 "PhysListEm5DStandard.hh"
39 
40 #include "G4EmStandardPhysics.hh"
46 #include "G4EmStandardPhysicsGS.hh"
47 #include "G4EmStandardPhysicsSS.hh"
48 
49 #include "G4EmLivermorePhysics.hh"
50 #include "G4EmPenelopePhysics.hh"
51 #include "G4EmLowEPPhysics.hh"
52 
53 #include "G4EmDNAPhysics.hh"
57 
59 
60 #include "G4DecayPhysics.hh"
61 #include "StepMax.hh"
62 
63 #include "G4UnitsTable.hh"
64 #include "G4SystemOfUnits.hh"
65 
66 #include "G4ParticleDefinition.hh"
67 #include "G4ProcessManager.hh"
68 
69 // particles
70 
71 #include "G4BosonConstructor.hh"
72 #include "G4LeptonConstructor.hh"
73 #include "G4MesonConstructor.hh"
74 #include "G4BosonConstructor.hh"
75 #include "G4BaryonConstructor.hh"
76 #include "G4IonConstructor.hh"
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
83  fHadPhysicsList(nullptr)
84 {
85  fMessenger = new PhysicsListMessenger(this);
86  SetVerboseLevel(1);
87 
88  // EM physics
89  fEmName = G4String("emstandard_opt4");
91 
92  // Decay physics
94 
96 }
97 
98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
99 
101 {
102  delete fEmPhysicsList;
103  delete fMessenger;
104 }
105 
106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107 
109 {
110  G4BosonConstructor pBosonConstructor;
111  pBosonConstructor.ConstructParticle();
112 
113  G4LeptonConstructor pLeptonConstructor;
114  pLeptonConstructor.ConstructParticle();
115 
116  G4MesonConstructor pMesonConstructor;
117  pMesonConstructor.ConstructParticle();
118 
119  G4BaryonConstructor pBaryonConstructor;
120  pBaryonConstructor.ConstructParticle();
121 
122  G4IonConstructor pIonConstructor;
123  pIonConstructor.ConstructParticle();
124 
125  G4ShortLivedConstructor sLivedConstructor;
126  sLivedConstructor.ConstructParticle();
127 
128  // Geant4-DNA
129 
130  G4DNAGenericIonsManager* genericIonsManager;
131  genericIonsManager=G4DNAGenericIonsManager::Instance();
132  genericIonsManager->GetIon("alpha++");
133  genericIonsManager->GetIon("alpha+");
134  genericIonsManager->GetIon("helium");
135  genericIonsManager->GetIon("hydrogen");
136 }
137 
138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
139 
141 {
146  AddStepMax();
147 }
148 
149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
150 
152 {
153  // Step limitation seen as a process
154  StepMax* stepMaxProcess = new StepMax(fMessenger);
155 
157  particleIterator->reset();
158  while ((*particleIterator)()){
159  G4ParticleDefinition* particle = particleIterator->value();
160  G4ProcessManager* pmanager = particle->GetProcessManager();
161 
162  if (stepMaxProcess->IsApplicable(*particle))
163  {
164  pmanager ->AddDiscreteProcess(stepMaxProcess);
165  }
166  }
167 }
168 
169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
170 
172 {
173  if (verboseLevel>-1) {
174  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
175  }
176 
177  if (name == fEmName) return;
178 
179  if (name == "local") {
180 
181  fEmName = name;
182  delete fEmPhysicsList;
184 
185  } else if (name == "emstandard_opt0") {
186 
187  fEmName = name;
188  delete fEmPhysicsList;
190 
191  } else if (name == "emstandard_opt1") {
192 
193  fEmName = name;
194  delete fEmPhysicsList;
196 
197  } else if (name == "emstandard_opt2") {
198 
199  fEmName = name;
200  delete fEmPhysicsList;
202 
203  } else if (name == "emstandard_opt3") {
204 
205  fEmName = name;
206  delete fEmPhysicsList;
208 
209  } else if (name == "emstandard_opt4") {
210 
211  fEmName = name;
212  delete fEmPhysicsList;
214 
215  } else if (name == "emstandardSS") {
216 
217  fEmName = name;
218  delete fEmPhysicsList;
220 
221  } else if (name == "emstandard5D") {
222 
223  fEmName = name;
224  delete fEmPhysicsList;
226 
227  } else if (name == "emstandardWVI") {
228 
229  fEmName = name;
230  delete fEmPhysicsList;
232 
233  } else if (name == "emstandardGS") {
234 
235  fEmName = name;
236  delete fEmPhysicsList;
238 
239  } else if (name == "empenelope") {
240  fEmName = name;
241  delete fEmPhysicsList;
243 
244  } else if (name == "emlowenergy") {
245  fEmName = name;
246  delete fEmPhysicsList;
248 
249  } else if (name == "emlivermore") {
250  fEmName = name;
251  delete fEmPhysicsList;
253 
254  } else if (name == "dna") {
255  fEmName = name;
256  delete fEmPhysicsList;
258 
259  } else if (name == "dna_opt2") {
260  fEmName = name;
261  delete fEmPhysicsList;
263 
264  } else if (name == "dna_opt4") {
265  fEmName = name;
266  delete fEmPhysicsList;
268 
269  } else if (name == "dna_opt6") {
270  fEmName = name;
271  delete fEmPhysicsList;
273 
274  } else if (name == "had_elastic" && !fHadPhysicsList) {
276 
277  } else {
278 
279  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
280  << " is not defined"
281  << G4endl;
282  }
283 }
284 
285 //....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 void ConstructProcess()=0
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
PhysicsList()
Implementation of the PhysicsList class.
static void ConstructParticle()
void SetDefaultCutValue(G4double newCutValue)
static void ConstructParticle()
G4ParticleDefinition * GetIon(const G4String &name)
virtual G4bool IsApplicable(const G4ParticleDefinition &)
G4ProcessManager * GetProcessManager() const
static G4DNAGenericIonsManager * Instance(void)
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4GLOB_DLL std::ostream G4cout
void SetVerboseLevel(G4int value)