Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
examples/extended/electromagnetic/TestEm16/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 100276 2016-10-17 08:31:11Z gcosmo $
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "PhysicsList.hh"
35 #include "PhysicsListMessenger.hh"
36 
37 #include "G4ParticleDefinition.hh"
38 #include "G4ProcessManager.hh"
39 #include "G4ParticleTypes.hh"
40 #include "G4ParticleTable.hh"
41 
42 #include "G4ComptonScattering.hh"
43 #include "G4GammaConversion.hh"
44 #include "G4PhotoElectricEffect.hh"
45 #include "G4RayleighScattering.hh"
46 
47 #include "G4eMultipleScattering.hh"
48 #include "G4eIonisation.hh"
49 #include "G4eBremsstrahlung.hh"
50 #include "G4eplusAnnihilation.hh"
51 
53 #include "G4MuIonisation.hh"
54 #include "G4MuBremsstrahlung.hh"
55 #include "G4MuPairProduction.hh"
56 
57 #include "G4hMultipleScattering.hh"
58 #include "G4hIonisation.hh"
59 #include "G4hBremsstrahlung.hh"
60 #include "G4hPairProduction.hh"
61 
64 
65 #include "G4StepLimiter.hh"
66 
67 #include "G4SystemOfUnits.hh"
68 #include "G4AutoDelete.hh"
69 
70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
71 
74  fMess(0)
75 {
77 
78  fSRType = true;
79  fMess = new PhysicsListMessenger(this);
80 }
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83 
85 {
86  delete fMess;
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90 
92 {
93  // In this method, static member functions should be called
94  // for all particles which you want to use.
95  // This ensures that objects of these particle types will be
96  // created in the program.
97 
100 
101 // charged mesons
106 
107 // charged baryons
110 
111 // ions
112  //G4Deuteron::DeuteronDefinition();
113  //G4Triton::TritonDefinition();
114  //G4Alpha::AlphaDefinition();
116 }
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119 
121 {
122  // pseudo-particles
125 
126  // gamma
128 }
129 
130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
131 
133 {
134  // leptons
139 
144 }
145 
146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
147 
149 {
151  ConstructEM();
153 }
154 
155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
157 {
159  particleIterator->reset();
161  G4AutoDelete::Register(fSync);
162  while( (*particleIterator)() ){
163  G4ParticleDefinition* particle = particleIterator->value();
164  G4ProcessManager* pmanager = particle->GetProcessManager();
165  G4String particleName = particle->GetParticleName();
166 
167  if (particleName == "gamma") {
168  // gamma
171  pmanager->AddDiscreteProcess(new G4GammaConversion);
173 
174  } else if (particleName == "e-") {
175  //electron
176  pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
177  pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
178  pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
179  if (fSRType) {
180  pmanager->AddProcess(fSync, -1,-1, 4);
181  } else {
182  pmanager->AddProcess(new G4SynchrotronRadiationInMat,-1,-1, 4);
183  }
184  pmanager->AddProcess(new G4StepLimiter, -1,-1, 5);
185 
186  } else if (particleName == "e+") {
187  //positron
188  pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
189  pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
190  pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
191  pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4);
192  if (fSRType) {
193  pmanager->AddProcess(fSync, -1,-1, 5);
194  } else {
195  pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1,-1, 5);
196  }
197  pmanager->AddProcess(new G4StepLimiter, -1,-1, 6);
198 
199  } else if( particleName == "mu+" ||
200  particleName == "mu-" ) {
201  //muon
202  pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1);
203  pmanager->AddProcess(new G4MuIonisation, -1, 2, 2);
204  pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
205  pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4);
206  pmanager->AddProcess(fSync, -1,-1, 5);
207  pmanager->AddProcess(new G4StepLimiter, -1,-1, 6);
208 
209  } else if( particleName == "proton") {
210  //proton
211  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
212  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
213  pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
214  pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
215  pmanager->AddProcess(fSync, -1,-1, 5);
216  pmanager->AddProcess(new G4StepLimiter, -1,-1, 6);
217  }
218  else if (particle->GetPDGCharge() != 0.0 && !particle->IsShortLived())
219  {
220  pmanager->AddProcess(fSync,-1,-1, 1);
221  }
222  }
223 }
224 
225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
226 
227 #include "G4Decay.hh"
228 
230 {
231  // Add Decay Process
232  G4Decay* theDecayProcess = new G4Decay();
234  particleIterator->reset();
235  while ((*particleIterator)()){
236  G4ParticleDefinition* particle = particleIterator->value();
237  G4ProcessManager* pmanager = particle->GetProcessManager();
238  if (theDecayProcess->IsApplicable(*particle)) {
239  pmanager ->AddProcess(theDecayProcess);
240  // set ordering for PostStepDoIt and AtRestDoIt
241  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
242  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
243  }
244  }
245 }
246 
247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static G4ChargedGeantino * ChargedGeantinoDefinition()
const G4String & GetParticleName() const
G4double GetPDGCharge() const
virtual G4bool IsApplicable(const G4ParticleDefinition &) override
Definition: G4Decay.cc:89
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:93
void Register(T *inst)
Definition: G4AutoDelete.hh:65
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
PhysicsList()
Implementation of the PhysicsList class.
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
void SetDefaultCutValue(G4double newCutValue)
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
static G4KaonMinus * KaonMinusDefinition()
Definition: G4KaonMinus.cc:108
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81
static G4GenericIon * GenericIonDefinition()
Definition: G4GenericIon.cc:88
G4ProcessManager * GetProcessManager() const
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
static G4KaonPlus * KaonPlusDefinition()
Definition: G4KaonPlus.cc:108
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
static G4AntiProton * AntiProtonDefinition()
Definition: G4AntiProton.cc:88
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
static constexpr double km
Definition: G4SIunits.hh:133