Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
examples/extended/medical/electronScattering2/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 //
26 // $Id: PhysicsList.cc 100254 2016-10-17 07:53:29Z gcosmo $
27 //
30 
31 #include "PhysicsList.hh"
32 #include "PhysicsListMessenger.hh"
33 
34 #include "G4EmStandardPhysics.hh"
39 #include "G4EmStandardPhysicsSS.hh"
41 #include "G4EmStandardPhysicsGS.hh"
42 #include "G4EmLivermorePhysics.hh"
43 #include "G4EmPenelopePhysics.hh"
44 #include "G4EmLowEPPhysics.hh"
45 
46 #include "G4LossTableManager.hh"
47 #include "G4UnitsTable.hh"
48 
49 #include "G4ParticleDefinition.hh"
50 #include "G4ProcessManager.hh"
51 
52 // Bosons
53 #include "G4ChargedGeantino.hh"
54 #include "G4Geantino.hh"
55 #include "G4Gamma.hh"
56 #include "G4OpticalPhoton.hh"
57 
58 // leptons
59 #include "G4MuonPlus.hh"
60 #include "G4MuonMinus.hh"
61 #include "G4NeutrinoMu.hh"
62 #include "G4AntiNeutrinoMu.hh"
63 
64 #include "G4Electron.hh"
65 #include "G4Positron.hh"
66 #include "G4NeutrinoE.hh"
67 #include "G4AntiNeutrinoE.hh"
68 
69 // Hadrons
70 #include "G4MesonConstructor.hh"
71 #include "G4BaryonConstructor.hh"
72 #include "G4IonConstructor.hh"
73 #include "G4GenericIon.hh"
74 
75 #include "G4SystemOfUnits.hh"
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78 
80 : G4VModularPhysicsList(), fMessenger(0), fEmPhysicsList(0)
81 {
82  fMessenger = new PhysicsListMessenger(this);
83 
84  // EM physics
85  fEmName = G4String("emstandard_opt4");
86  fEmPhysicsList = new G4EmStandardPhysics_option4(1);
87  if (verboseLevel>-1) {
88  G4cout << "PhysicsList::Constructor with default list: <"
89  << fEmName << ">" << G4endl;
90  }
91 
93  SetVerboseLevel(1);
94 }
95 
96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
97 
99 {
100  delete fEmPhysicsList;
101  delete fMessenger;
102 }
103 
104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
105 
107 {
108  // pseudo-particles
111 
112  // gamma
114 
115  // optical photon
117 
118  // leptons
123 
128 
129  // mesons
130  G4MesonConstructor mConstructor;
131  mConstructor.ConstructParticle();
132 
133  // barions
134  G4BaryonConstructor bConstructor;
135  bConstructor.ConstructParticle();
136 
137  // ions
138  G4IonConstructor iConstructor;
139  iConstructor.ConstructParticle();
140 
141  // Required by MT even if ion physics not used
143 }
144 
145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146 
148 {
151  AddDecay();
152  AddStepMax();
153 }
154 
155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
156 
157 #include "G4Decay.hh"
158 
160 {
161  // Add Decay Process
162 
163  G4Decay* fDecayProcess = new G4Decay();
164 
166  particleIterator->reset();
167  while( (*particleIterator)() ){
168  G4ParticleDefinition* particle = particleIterator->value();
169  G4ProcessManager* pmanager = particle->GetProcessManager();
170 
171  if (fDecayProcess->IsApplicable(*particle) &&
172  !particle->IsShortLived()) {
173 
174  pmanager ->AddProcess(fDecayProcess);
175 
176  // set ordering for PostStepDoIt and AtRestDoIt
177  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
178  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
179 
180  }
181  }
182 }
183 
184 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
185 
186 #include "StepMax.hh"
187 
189 {
190  // Step limitation seen as a process
191  StepMax* stepMaxProcess = new StepMax();
192 
194  particleIterator->reset();
195  while ((*particleIterator)()){
196  G4ParticleDefinition* particle = particleIterator->value();
197  G4ProcessManager* pmanager = particle->GetProcessManager();
198 
199  if (stepMaxProcess->IsApplicable(*particle))
200  {
201  pmanager ->AddDiscreteProcess(stepMaxProcess);
202  }
203  }
204 }
205 
206 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
207 
209 {
210  if (verboseLevel>-1) {
211  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
212  }
213 
214  if (name == fEmName) return;
215 
216  if (name == "emstandard_opt0") {
217 
218  fEmName = name;
219  delete fEmPhysicsList;
221 
222  } else if (name == "emstandard_opt1") {
223 
224  fEmName = name;
225  delete fEmPhysicsList;
227 
228  } else if (name == "emstandard_opt2") {
229 
230  fEmName = name;
231  delete fEmPhysicsList;
233 
234  } else if (name == "emstandard_opt3") {
235 
236  fEmName = name;
237  delete fEmPhysicsList;
239 
240  } else if (name == "emstandard_opt4") {
241 
242  fEmName = name;
243  delete fEmPhysicsList;
245 
246  } else if (name == "emlowenergy") {
247  fEmName = name;
248  delete fEmPhysicsList;
250 
251  } else if (name == "emstandardSS") {
252  fEmName = name;
253  delete fEmPhysicsList;
255 
256  } else if (name == "emstandardWVI") {
257  fEmName = name;
258  delete fEmPhysicsList;
260 
261  } else if (name == "emstandardGS") {
262  fEmName = name;
263  delete fEmPhysicsList;
265 
266  } else if (name == "emlivermore") {
267  fEmName = name;
268  delete fEmPhysicsList;
270 
271  } else if (name == "empenelope") {
272  fEmName = name;
273  delete fEmPhysicsList;
275 
276  } else {
277 
278  G4ExceptionDescription description;
279  description
280  << " "
281  << "PhysicsList::AddPhysicsList: <" << name << "> is not defined";
282  G4Exception("PhysicsList::AddPhysicsList",
283  "electronScattering2_F001", FatalException, description);
284  }
285 }
286 
287 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const XML_Char * name
Definition: expat.h:151
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:45
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static G4ChargedGeantino * ChargedGeantinoDefinition()
#define G4endl
Definition: G4ios.hh:61
static void ConstructParticle()
static void ConstructParticle()
virtual G4bool IsApplicable(const G4ParticleDefinition &) override
Definition: G4Decay.cc:89
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
virtual void ConstructProcess()=0
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
PhysicsList()
Implementation of the PhysicsList class.
static G4OpticalPhoton * OpticalPhotonDefinition()
static void ConstructParticle()
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.hh:65
static G4GenericIon * GenericIonDefinition()
Definition: G4GenericIon.cc:88
virtual G4bool IsApplicable(const G4ParticleDefinition &)
G4ProcessManager * GetProcessManager() const
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4GLOB_DLL std::ostream G4cout
static G4LossTableManager * Instance()
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()