Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
environments/g4py/site-modules/physics_lists/ExN03pl/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 //
26 //
27 // $Id: PhysicsList.cc 66892 2013-01-17 10:57:59Z gunter $
28 //
29 //
30 
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "PhysicsList.hh"
35 #include "G4SystemOfUnits.hh"
36 
37 #include "G4ProcessManager.hh"
38 
39 #include "G4BosonConstructor.hh"
40 #include "G4LeptonConstructor.hh"
41 #include "G4MesonConstructor.hh"
42 #include "G4BosonConstructor.hh"
43 #include "G4BaryonConstructor.hh"
44 #include "G4IonConstructor.hh"
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47 
49 {
50  defaultCutValue = 1.0*mm;
51  SetVerboseLevel(1);
52 }
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55 
57 {}
58 
59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60 
62 {
63  // In this method, static member functions should be called
64  // for all particles which you want to use.
65  // This ensures that objects of these particle types will be
66  // created in the program.
67 
68  G4BosonConstructor pBosonConstructor;
69  pBosonConstructor.ConstructParticle();
70 
71  G4LeptonConstructor pLeptonConstructor;
72  pLeptonConstructor.ConstructParticle();
73 
74  G4MesonConstructor pMesonConstructor;
75  pMesonConstructor.ConstructParticle();
76 
77  G4BaryonConstructor pBaryonConstructor;
78  pBaryonConstructor.ConstructParticle();
79 
80  G4IonConstructor pIonConstructor;
81  pIonConstructor.ConstructParticle();
82 }
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85 
87 {
89  ConstructEM();
90  ConstructDecay();
91 }
92 
93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
94 
95 #include "G4PhysicsListHelper.hh"
96 
97 #include "G4ComptonScattering.hh"
98 #include "G4GammaConversion.hh"
99 #include "G4PhotoElectricEffect.hh"
100 
101 #include "G4eMultipleScattering.hh"
102 #include "G4eIonisation.hh"
103 #include "G4eBremsstrahlung.hh"
104 #include "G4eplusAnnihilation.hh"
105 
106 #include "G4MuMultipleScattering.hh"
107 #include "G4MuIonisation.hh"
108 #include "G4MuBremsstrahlung.hh"
109 #include "G4MuPairProduction.hh"
110 
111 #include "G4hMultipleScattering.hh"
112 #include "G4hIonisation.hh"
113 #include "G4hBremsstrahlung.hh"
114 #include "G4hPairProduction.hh"
115 
116 #include "G4ionIonisation.hh"
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119 
120 void PhysicsList::ConstructEM()
121 {
123 
124  theParticleIterator->reset();
125  while( (*theParticleIterator)() ){
126  G4ParticleDefinition* particle = theParticleIterator->value();
127  G4String particleName = particle->GetParticleName();
128 
129  if (particleName == "gamma") {
130  // gamma
131  ph->RegisterProcess(new G4PhotoElectricEffect, particle);
132  ph->RegisterProcess(new G4ComptonScattering, particle);
133  ph->RegisterProcess(new G4GammaConversion, particle);
134 
135  } else if (particleName == "e-") {
136  //electron
137  ph->RegisterProcess(new G4eMultipleScattering, particle);
138  ph->RegisterProcess(new G4eIonisation, particle);
139  //ph->RegisterProcess(new G4eBremsstrahlung, particle);
140 
141  } else if (particleName == "e+") {
142  //positron
143  ph->RegisterProcess(new G4eMultipleScattering, particle);
144  ph->RegisterProcess(new G4eIonisation, particle);
145  //ph->RegisterProcess(new G4eBremsstrahlung, particle);
146  ph->RegisterProcess(new G4eplusAnnihilation, particle);
147 
148  } else if( particleName == "mu+" ||
149  particleName == "mu-" ) {
150  //muon
151  ph->RegisterProcess(new G4MuMultipleScattering, particle);
152  ph->RegisterProcess(new G4MuIonisation, particle);
153  ph->RegisterProcess(new G4MuBremsstrahlung, particle);
154  ph->RegisterProcess(new G4MuPairProduction, particle);
155 
156  } else if( particleName == "proton" ||
157  particleName == "pi-" ||
158  particleName == "pi+" ) {
159  //proton
160  ph->RegisterProcess(new G4hMultipleScattering, particle);
161  ph->RegisterProcess(new G4hIonisation, particle);
162  ph->RegisterProcess(new G4hBremsstrahlung, particle);
163  ph->RegisterProcess(new G4hPairProduction, particle);
164 
165  } else if( particleName == "alpha" ||
166  particleName == "He3" ) {
167  //alpha
168  ph->RegisterProcess(new G4hMultipleScattering, particle);
169  ph->RegisterProcess(new G4ionIonisation, particle);
170 
171  } else if( particleName == "GenericIon" ) {
172  //Ions
173  ph->RegisterProcess(new G4hMultipleScattering, particle);
174  ph->RegisterProcess(new G4ionIonisation, particle);
175 
176  } else if ((!particle->IsShortLived()) &&
177  (particle->GetPDGCharge() != 0.0) &&
178  (particle->GetParticleName() != "chargedgeantino")) {
179  //all others charged particles except geantino
180  ph->RegisterProcess(new G4hMultipleScattering, particle);
181  ph->RegisterProcess(new G4hIonisation, particle);
182  }
183  }
184 }
185 
186 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
187 
188 #include "G4Decay.hh"
189 
190 void PhysicsList::ConstructDecay()
191 {
193 
194  // Add Decay Process
195  G4Decay* theDecayProcess = new G4Decay();
196  theParticleIterator->reset();
197  while( (*theParticleIterator)() ){
198  G4ParticleDefinition* particle = theParticleIterator->value();
199  if (theDecayProcess->IsApplicable(*particle)) {
200  ph->RegisterProcess(theDecayProcess, particle);
201  }
202  }
203 }
204 
205 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
206 
208 {
209  if (verboseLevel >0){
210  G4cout << "PhysicsList::SetCuts:";
211  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
212  }
213 
214  // set cut values for gamma at first and for e- second and next for e+,
215  // because some processes for e+/e- need cut values for gamma
216  //
217  SetCutValue(defaultCutValue, "gamma");
220  SetCutValue(defaultCutValue, "proton");
221 
223 }
224 
225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
226 
void SetCutValue(G4double aCut, const G4String &pname)
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static void ConstructParticle()
static void ConstructParticle()
const G4String & GetParticleName() const
static void ConstructParticle()
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
static void ConstructParticle()
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)
void SetVerboseLevel(G4int value)
static void ConstructParticle()
static G4PhysicsListHelper * GetPhysicsListHelper()
#define G4endl
Definition: G4ios.hh:61
G4double GetPDGCharge() const
#define theParticleIterator