Geant4  10.00.p02
Par01PhysicsList.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: Par01PhysicsList.cc 70911 2013-06-07 11:05:37Z mverderi $
28 //
29 //
30 
31 #include "Par01PhysicsList.hh"
32 
33 #include "globals.hh"
34 #include "G4ParticleDefinition.hh"
35 #include "G4ProcessManager.hh"
36 #include "G4ProcessVector.hh"
37 #include "G4ParticleTypes.hh"
38 #include "G4ParticleTable.hh"
39 #include "G4Material.hh"
40 #include "G4MaterialTable.hh"
41 #include "G4ios.hh"
42 #include <iomanip>
43 
45 
46 
48 {
49  SetVerboseLevel(1);
50 }
51 
53 {
54 }
55 
57 {
58  // In this method, static member functions should be called
59  // for all particles which you want to use.
60  // This ensures that objects of these particle types will be
61  // created in the program.
62 
67  ConstructIons();
68 }
69 
71 {
72  // pseudo-particles
75 
76  // gamma
78 
79  // optical photon
81 }
82 
83 #include "G4LeptonConstructor.hh"
85 {
86  // Construct all leptons
87  G4LeptonConstructor pConstructor;
88  pConstructor.ConstructParticle();
89 }
90 
91 #include "G4MesonConstructor.hh"
93 {
94  // Construct all mesons
95  G4MesonConstructor pConstructor;
96  pConstructor.ConstructParticle();
97 }
98 
99 #include "G4BaryonConstructor.hh"
101 {
102  // Construct all barions
103  G4BaryonConstructor pConstructor;
104  pConstructor.ConstructParticle();
105 }
106 
107 #include "G4IonConstructor.hh"
109 {
110  // Construct light ions
111  G4IonConstructor pConstructor;
112  pConstructor.ConstructParticle();
113 }
114 
116 {
119 
120  ConstructEM();
122 }
123 
125 {
127 }
128 
129 #include "G4ComptonScattering.hh"
130 #include "G4GammaConversion.hh"
131 #include "G4PhotoElectricEffect.hh"
132 
133 #include "G4eMultipleScattering.hh"
134 #include "G4MuMultipleScattering.hh"
135 #include "G4hMultipleScattering.hh"
136 
137 #include "G4eIonisation.hh"
138 #include "G4eBremsstrahlung.hh"
139 #include "G4eplusAnnihilation.hh"
140 
141 #include "G4MuIonisation.hh"
142 #include "G4MuBremsstrahlung.hh"
143 #include "G4MuPairProduction.hh"
144 
145 #include "G4hIonisation.hh"
147 {
148  theParticleIterator->reset();
149  while( (*theParticleIterator)() ){
150  G4ParticleDefinition* particle = theParticleIterator->value();
151  G4ProcessManager* pmanager = particle->GetProcessManager();
152  G4String particleName = particle->GetParticleName();
153 
154  if (particleName == "gamma") {
155  // gamma
156  // Construct processes for gamma
157  pmanager->AddDiscreteProcess(new G4GammaConversion());
158  pmanager->AddDiscreteProcess(new G4ComptonScattering());
159  pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
160 
161  } else if (particleName == "e-") {
162  //electron
163  // Construct processes for electron
164  G4VProcess* theeminusMultipleScattering = new G4eMultipleScattering();
165  G4VProcess* theeminusIonisation = new G4eIonisation();
166  G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
167  // add processes
168  pmanager->AddProcess(theeminusMultipleScattering);
169  pmanager->AddProcess(theeminusIonisation);
170  pmanager->AddProcess(theeminusBremsstrahlung);
171  // set ordering for AlongStepDoIt
172  pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep, 1);
173  pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep, 2);
174  // set ordering for PostStepDoIt
175  pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep, 1);
176  pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep, 2);
177  pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep, 3);
178 
179  } else if (particleName == "e+") {
180  //positron
181  // Construct processes for positron
182  G4VProcess* theeplusMultipleScattering = new G4eMultipleScattering();
183  G4VProcess* theeplusIonisation = new G4eIonisation();
184  G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung();
185  G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation();
186  // add processes
187  pmanager->AddProcess(theeplusMultipleScattering);
188  pmanager->AddProcess(theeplusIonisation);
189  pmanager->AddProcess(theeplusBremsstrahlung);
190  pmanager->AddProcess(theeplusAnnihilation);
191  // set ordering for AtRestDoIt
192  pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
193  // set ordering for AlongStepDoIt
194  pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep, 1);
195  pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep, 2);
196  // set ordering for PostStepDoIt
197  pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep, 1);
198  pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep, 2);
199  pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep, 3);
200  pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep, 4);
201 
202  } else if( particleName == "mu+" ||
203  particleName == "mu-" ) {
204  //muon
205  // Construct processes for muon+
206  G4VProcess* aMultipleScattering = new G4MuMultipleScattering();
207  G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
208  G4VProcess* aPairProduction = new G4MuPairProduction();
209  G4VProcess* anIonisation = new G4MuIonisation();
210  // add processes
211  pmanager->AddProcess(anIonisation);
212  pmanager->AddProcess(aMultipleScattering);
213  pmanager->AddProcess(aBremsstrahlung);
214  pmanager->AddProcess(aPairProduction);
215  // set ordering for AlongStepDoIt
216  pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1);
217  pmanager->SetProcessOrdering(anIonisation, idxAlongStep, 2);
218  // set ordering for PostStepDoIt
219  pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1);
220  pmanager->SetProcessOrdering(anIonisation, idxPostStep, 2);
221  pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep, 3);
222  pmanager->SetProcessOrdering(aPairProduction, idxPostStep, 4);
223 
224  } else if ((!particle->IsShortLived()) &&
225  (particle->GetPDGCharge() != 0.0) &&
226  (particle->GetParticleName() != "chargedgeantino")) {
227  // all others charged particles except geantino
228  G4VProcess* aMultipleScattering = new G4hMultipleScattering();
229  G4VProcess* anIonisation = new G4hIonisation();
230  // add processes
231  pmanager->AddProcess(anIonisation);
232  pmanager->AddProcess(aMultipleScattering);
233  // set ordering for AlongStepDoIt
234  pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1);
235  pmanager->SetProcessOrdering(anIonisation, idxAlongStep, 2);
236  // set ordering for PostStepDoIt
237  pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1);
238  pmanager->SetProcessOrdering(anIonisation, idxPostStep, 2);
239  }
240  }
241 }
242 
243 
244 #include "G4Decay.hh"
246 {
247  // Add Decay Process
248  G4Decay* theDecayProcess = new G4Decay();
249  theParticleIterator->reset();
250  while( (*theParticleIterator)() ){
251  G4ParticleDefinition* particle = theParticleIterator->value();
252  G4ProcessManager* pmanager = particle->GetProcessManager();
253  if (theDecayProcess->IsApplicable(*particle)) {
254  pmanager ->AddProcess(theDecayProcess);
255  // set ordering for PostStepDoIt and AtRestDoIt
256  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
257  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
258  }
259  }
260 }
261 
263 {
264  // -- Fast simulation manager process for "mass geometry":
266  fastSimProcess_massGeom = new G4FastSimulationManagerProcess("G4FSMP_massGeom");
267  // -- Fast simulation manager process for "parallel geometry":
269  fastSimProcess_parallelGeom = new G4FastSimulationManagerProcess("G4FSMP_parallelGeom",
270  "pionGhostWorld");
271  theParticleIterator->reset();
272  while( (*theParticleIterator)() )
273  {
274  G4ParticleDefinition* particle = theParticleIterator->value();
275  G4ProcessManager* pmanager = particle->GetProcessManager();
276  // -- For the mass geometry, G4FSMP is a PostStep process, ordering does not matter:
277  if (particle->GetParticleName() == "e+" ||
278  particle->GetParticleName() == "e-" ||
279  particle->GetParticleName() == "gamma") pmanager->
280  AddDiscreteProcess(fastSimProcess_massGeom);
281  // -- For the parallel geometry, G4FSMP is an Along+PostStep process, and ordering matters:
282  if (particle->GetParticleName() == "pi+" ||
283  particle->GetParticleName() == "pi-")
284  {
285  pmanager->AddProcess(fastSimProcess_parallelGeom);
286  pmanager->SetProcessOrdering(fastSimProcess_parallelGeom, idxAlongStep, 1);
287  pmanager->SetProcessOrdering(fastSimProcess_parallelGeom, idxPostStep);
288  }
289  }
290 }
291 
293 {
294  if (verboseLevel >1){
295  G4cout << "Par01PhysicsList::SetCuts:";
296  }
297  // " G4VUserPhysicsList::SetCutsWithDefault" method sets
298  // the default cut value for all particle types
300 }
301 
302 
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
void SetProcessOrderingToFirst(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
virtual void ConstructGeneral()
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
virtual void AddTransportation()
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
virtual void ConstructEM()
static void ConstructParticle()
static void ConstructParticle()
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
static void ConstructParticle()
virtual void SetCuts()
G4GLOB_DLL std::ostream G4cout
virtual void ConstructIons()
void SetVerboseLevel(G4int value)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
virtual void ConstructLeptons()
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static void ConstructParticle()
virtual void ConstructParticle()
virtual void ConstructBosons()
virtual void ConstructProcess()
virtual void ConstructBaryons()
static G4ChargedGeantino * ChargedGeantinoDefinition()
static G4OpticalPhoton * OpticalPhotonDefinition()
G4double GetPDGCharge() const
virtual void ConstructMesons()
virtual ~Par01PhysicsList()
#define theParticleIterator
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81