Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TSPhysicsList.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 //
30 // $Id: TSPhysicsList.cc 93110 2015-11-05 08:37:42Z jmadsen $
31 //
32 //
38 //
39 //
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 
43 
44 #include "TSPhysicsList.hh"
45 
46 #include "G4RunManager.hh"
47 #include "G4ParticleDefinition.hh"
48 #include "G4ProcessManager.hh"
49 #include "G4ParticleTypes.hh"
50 
51 // Hadrons
52 #include "G4BaryonConstructor.hh"
53 #include "G4IonConstructor.hh"
54 #include "G4MesonConstructor.hh"
55 
56 // Bosons
57 #include "G4BosonConstructor.hh"
58 
59 // Leptons
60 #include "G4LeptonConstructor.hh"
61 
62 // Other Particles
64 
65 // Process options
66 #include "G4LossTableManager.hh"
67 #include "G4EmProcessOptions.hh"
68 
69 // Physics List Helper
70 #include "G4PhysicsListHelper.hh"
71 
72 #include "G4StepLimiter.hh"
73 
74 #include <set>
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
78 TSPhysicsList* TSPhysicsList::fgInstance = 0;
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
83 {
84  return fgInstance;
85 }
86 
87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88 
90 : fEmPhysics_opt4(new G4EmStandardPhysics_option4),
91  fDecayPhysics(new G4DecayPhysics),
92  fRadDecayPhysics(new G4RadioactiveDecayPhysics),
93  fHadronInelasticPhysics(new G4HadronPhysicsQGSP_BERT_HP),
94  fHadronElasticPhysics(new G4HadronElasticPhysicsHP),
95  fIonElasticPhysics(new G4IonElasticPhysics),
96  fIonBinaryCascadePhysics(new G4IonBinaryCascadePhysics),
97  fDefaultCutValue(1.*CLHEP::mm)
98 {
99  fgInstance = this;
100 
101  fConstructors.push_back(fEmPhysics_opt4);
102  fConstructors.push_back(fDecayPhysics);
103  fConstructors.push_back(fRadDecayPhysics);
104  fConstructors.push_back(fHadronInelasticPhysics);
105  fConstructors.push_back(fHadronElasticPhysics);
106  fConstructors.push_back(fIonElasticPhysics);
107  fConstructors.push_back(fIonBinaryCascadePhysics);
108 
109 
110 }
111 
112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
113 
115 {
116  for(auto ite : fConstructors)
117  delete ite;
118 
119  fgInstance = 0;
120 }
121 
122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
123 
125 {
126  for(auto c : fConstructors)
127  {
128  c->ConstructParticle();
129  }
130 }
131 
132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
133 
135 {
136  // Transportation
137  //
139 
140  for(auto c : fConstructors)
141  {
142  c->ConstructProcess();
143  }
144 
145  std::set<G4String> step_limit_particles;
146  // standard particles
147  step_limit_particles.insert("e-");
148  step_limit_particles.insert("e+");
149  step_limit_particles.insert("alpha");
150  step_limit_particles.insert("He3");
151  step_limit_particles.insert("GenericIon");
152  step_limit_particles.insert("proton");
153  step_limit_particles.insert("neutron");
154  // more ~exotic particles
155  step_limit_particles.insert("pi+");
156  step_limit_particles.insert("pi-");
157  step_limit_particles.insert("mu+");
158  step_limit_particles.insert("mu-");
159 
161  particleIterator->reset();
162 
164 
165  while( (*particleIterator)() )
166  {
167  G4ParticleDefinition* particle = particleIterator->value();
168  G4String pname = particle->GetParticleName();
169 
170  if(step_limit_particles.find(pname) != step_limit_particles.end() ||
171  particle->GetPDGCharge())
172  {
173  ph->RegisterProcess(new G4StepLimiter, particle);
174  }
175  }
176 }
177 
178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
179 
181 {
182  SetCutValue(fDefaultCutValue, "e-");
183  SetCutValue(fDefaultCutValue, "e+");
184  SetCutValue(fDefaultCutValue, "gamma");
185  SetCutValue(fDefaultCutValue, "proton");
186 }
187 
188 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
189 
static constexpr double mm
Definition: G4SIunits.hh:115
void SetCutValue(G4double aCut, const G4String &pname)
static TSPhysicsList * Instance()
void ConstructProcess()
const G4String & GetParticleName() const
virtual ~TSPhysicsList()
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)
string pname
Definition: eplot.py:33
static G4PhysicsListHelper * GetPhysicsListHelper()
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
void ConstructParticle()
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
tuple c
Definition: test.py:13
G4double GetPDGCharge() const
Definition of the TSPhysicsList class.