Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PhysicsList.cc
Go to the documentation of this file.
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$
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 
59 
60 #include "G4StepLimiter.hh"
61 
62 #include "G4SystemOfUnits.hh"
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65 
68 {
69  defaultCutValue = 1.*km;
70 
71  fSRType = true;
72  fMess = new PhysicsListMessenger(this);
73 }
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76 
78 {
79  delete fMess;
80 }
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83 
85 {
86  // In this method, static member functions should be called
87  // for all particles which you want to use.
88  // This ensures that objects of these particle types will be
89  // created in the program.
90 
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96 
98 {
99  // pseudo-particles
102 
103  // gamma
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108 
110 {
111  // leptons
116 
121 }
122 
123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
124 
126 {
128  ConstructEM();
130 }
131 
132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
133 
134 void PhysicsList::ConstructEM()
135 {
137  while( (*theParticleIterator)() ){
139  G4ProcessManager* pmanager = particle->GetProcessManager();
140  G4String particleName = particle->GetParticleName();
141 
142  if (particleName == "gamma") {
143  // gamma
146  pmanager->AddDiscreteProcess(new G4GammaConversion);
148 
149  } else if (particleName == "e-") {
150  //electron
151  pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
152  pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
153  pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
154  if (fSRType) {
155  pmanager->AddProcess(new G4SynchrotronRadiation, -1,-1, 4);
156  } else {
157  pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1,-1, 4);
158  }
159  pmanager->AddProcess(new G4StepLimiter, -1,-1, 5);
160 
161  } else if (particleName == "e+") {
162  //positron
163  pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
164  pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
165  pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
166  pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4);
167  if (fSRType) {
168  pmanager->AddProcess(new G4SynchrotronRadiation, -1,-1, 5);
169  } else {
170  pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1,-1, 5);
171  }
172  pmanager->AddProcess(new G4StepLimiter, -1,-1, 6);
173 
174  } else if( particleName == "mu+" ||
175  particleName == "mu-" ) {
176  //muon
177  pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1);
178  pmanager->AddProcess(new G4MuIonisation, -1, 2, 2);
179  pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
180  pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4);
181 
182  }
183  }
184 }
185 
186 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
187 
188 #include "G4Decay.hh"
189 
191 {
192  // Add Decay Process
193  G4Decay* theDecayProcess = new G4Decay();
195  while ((*theParticleIterator)()){
197  G4ProcessManager* pmanager = particle->GetProcessManager();
198  if (theDecayProcess->IsApplicable(*particle)) {
199  pmanager ->AddProcess(theDecayProcess);
200  // set ordering for PostStepDoIt and AtRestDoIt
201  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
202  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
203  }
204  }
205 }
206 
207 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
208 
210 {
211  if (verboseLevel >0){
212  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
213  }
214 
215  // set cut values for gamma at first and for e- second and next for e+,
216  // because some processes for e+/e- need cut values for gamma
217  SetCutValue(defaultCutValue, "gamma");
220 
222 }
223 
224 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......