Geant4  10.02.p01
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: PhysicsList.cc 84365 2014-10-14 12:43:52Z 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 {
158  theParticleIterator->reset();
160  G4AutoDelete::Register(fSync);
161  while( (*theParticleIterator)() ){
162  G4ParticleDefinition* particle = theParticleIterator->value();
163  G4ProcessManager* pmanager = particle->GetProcessManager();
164  G4String particleName = particle->GetParticleName();
165 
166  if (particleName == "gamma") {
167  // gamma
170  pmanager->AddDiscreteProcess(new G4GammaConversion);
172 
173  } else if (particleName == "e-") {
174  //electron
175  pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
176  pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
177  pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
178  if (fSRType) {
179  pmanager->AddProcess(fSync, -1,-1, 4);
180  } else {
181  pmanager->AddProcess(new G4SynchrotronRadiationInMat,-1,-1, 4);
182  }
183  pmanager->AddProcess(new G4StepLimiter, -1,-1, 5);
184 
185  } else if (particleName == "e+") {
186  //positron
187  pmanager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
188  pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
189  pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
190  pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4);
191  if (fSRType) {
192  pmanager->AddProcess(fSync, -1,-1, 5);
193  } else {
194  pmanager->AddProcess(new G4SynchrotronRadiationInMat, -1,-1, 5);
195  }
196  pmanager->AddProcess(new G4StepLimiter, -1,-1, 6);
197 
198  } else if( particleName == "mu+" ||
199  particleName == "mu-" ) {
200  //muon
201  pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1);
202  pmanager->AddProcess(new G4MuIonisation, -1, 2, 2);
203  pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
204  pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4);
205  pmanager->AddProcess(fSync, -1,-1, 5);
206  pmanager->AddProcess(new G4StepLimiter, -1,-1, 6);
207 
208  } else if( particleName == "proton") {
209  //proton
210  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
211  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
212  pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
213  pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
214  pmanager->AddProcess(fSync, -1,-1, 5);
215  pmanager->AddProcess(new G4StepLimiter, -1,-1, 6);
216  }
217  else if (particle->GetPDGCharge() != 0.0 && !particle->IsShortLived())
218  {
219  pmanager->AddProcess(fSync,-1,-1, 1);
220  }
221  }
222 }
223 
224 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
225 
226 #include "G4Decay.hh"
227 
229 {
230  // Add Decay Process
231  G4Decay* theDecayProcess = new G4Decay();
232  theParticleIterator->reset();
233  while ((*theParticleIterator)()){
234  G4ParticleDefinition* particle = theParticleIterator->value();
235  G4ProcessManager* pmanager = particle->GetProcessManager();
236  if (theDecayProcess->IsApplicable(*particle)) {
237  pmanager ->AddProcess(theDecayProcess);
238  // set ordering for PostStepDoIt and AtRestDoIt
239  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
240  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
241  }
242  }
243 }
244 
245 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
void SetDefaultCutValue(G4double newCutValue)
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4KaonPlus * KaonPlusDefinition()
Definition: G4KaonPlus.cc:108
static G4GenericIon * GenericIonDefinition()
Definition: G4GenericIon.cc:88
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
static G4KaonMinus * KaonMinusDefinition()
Definition: G4KaonMinus.cc:108
void ConstructBosons()
Definition: PhysicsList.cc:64
void ConstructLeptons()
Definition: PhysicsList.cc:71
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static G4AntiProton * AntiProtonDefinition()
Definition: G4AntiProton.cc:88
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
G4bool fSRType
Definition: PhysicsList.hh:67
void Register(T *inst)
Definition: G4AutoDelete.hh:65
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:93
PhysicsListMessenger * fMess
Definition: PhysicsList.hh:68
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
static const double km
Definition: G4SIunits.hh:132
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
static G4ChargedGeantino * ChargedGeantinoDefinition()
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
void ConstructProcess()
Definition: PhysicsList.cc:170
G4double GetPDGCharge() const
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
void ConstructGeneral()
Definition: PhysicsList.cc:287
void ConstructEM()
Definition: PhysicsList.cc:120
#define theParticleIterator
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81