Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
examples/extended/medical/electronScattering/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 100262 2016-10-17 08:08: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 "PhysListEmStandardSS.hh"
39 #include "PhysListEmStandardGS.hh"
40 #include "PhysListEmStandardWVI.hh"
41 
42 #include "G4EmStandardPhysics.hh"
46 
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 
74 #include "G4SystemOfUnits.hh"
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79  fMessenger(0), fEmName("local"), fEmPhysicsList(0)
80 {
81  fMessenger = new PhysicsListMessenger(this);
82 
83  // EM physics
84  fEmName = G4String("local");
85  fEmPhysicsList = new PhysListEmStandard(fEmName);
86 
87  SetDefaultCutValue(1.*mm);
88  SetVerboseLevel(1);
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92 
94 {
95  delete fEmPhysicsList;
96  delete fMessenger;
97 }
98 
99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
100 
102 {
103 // pseudo-particles
106 
107 // gamma
109 
110 // optical photon
112 
113 // leptons
118 
123 
124 // mesons
125  G4MesonConstructor mConstructor;
126  mConstructor.ConstructParticle();
127 
128 // barions
129  G4BaryonConstructor bConstructor;
130  bConstructor.ConstructParticle();
131 
132 // ions
133  G4IonConstructor iConstructor;
134  iConstructor.ConstructParticle();
135 }
136 
137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138 
140 {
143  AddDecay();
144  AddStepMax();
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
148 
149 #include "G4Decay.hh"
150 
152 {
153  // Add Decay Process
154 
155  G4Decay* fDecayProcess = new G4Decay();
156 
158  particleIterator->reset();
159  while( (*particleIterator)() ){
160  G4ParticleDefinition* particle = particleIterator->value();
161  G4ProcessManager* pmanager = particle->GetProcessManager();
162 
163  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
164 
165  pmanager ->AddProcess(fDecayProcess);
166 
167  // set ordering for PostStepDoIt and AtRestDoIt
168  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
169  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
170 
171  }
172  }
173 }
174 
175 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
176 
177 #include "StepMax.hh"
178 
180 {
181  // Step limitation seen as a process
182  StepMax* stepMaxProcess = new StepMax();
183 
185  particleIterator->reset();
186  while ((*particleIterator)()){
187  G4ParticleDefinition* particle = particleIterator->value();
188  G4ProcessManager* pmanager = particle->GetProcessManager();
189 
190  if (stepMaxProcess->IsApplicable(*particle))
191  {
192  pmanager ->AddDiscreteProcess(stepMaxProcess);
193  }
194  }
195 }
196 
197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
198 
200 {
201  if (verboseLevel>-1) {
202  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
203  }
204 
205  if (name == fEmName) return;
206 
207  if (name == "local") {
208 
209  fEmName = name;
210  delete fEmPhysicsList;
212 
213  } else if (name == "emstandard_opt0") {
214 
215  fEmName = name;
216  delete fEmPhysicsList;
218 
219  } else if (name == "emstandard_opt1") {
220 
221  fEmName = name;
222  delete fEmPhysicsList;
224 
225  } else if (name == "emstandard_opt2") {
226 
227  fEmName = name;
228  delete fEmPhysicsList;
230 
231  } else if (name == "emstandard_opt3") {
232 
233  fEmName = name;
234  delete fEmPhysicsList;
236 
237  } else if (name == "standardSS") {
238 
239  fEmName = name;
240  delete fEmPhysicsList;
242 
243  } else if (name == "standardGS") {
244 
245  fEmName = name;
246  delete fEmPhysicsList;
248 
249  } else if (name == "standardWVI") {
250 
251  fEmName = name;
252  delete fEmPhysicsList;
254 
255  } else {
256 
257  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
258  << " is not defined"
259  << G4endl;
260  }
261 }
262 
263 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const XML_Char * name
Definition: expat.h:151
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static G4ChargedGeantino * ChargedGeantinoDefinition()
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 &) 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
Definition of the PhysListEmStandardWVI class.
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
Definition of the PhysListEmStandardSS class.
Definition of the PhysListEmStandardGS class.
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
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 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()