Geant4  10.03.p03
 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: PhysicsList.cc 100275 2016-10-17 08:29:19Z gcosmo $
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "PhysicsList.hh"
35 #include "PhysicsListMessenger.hh"
36 
37 #include "PhysListEmStandard.hh"
38 #include "PhysListEmLivermore.hh"
39 #include "PhysListEmPenelope.hh"
40 
41 #include "G4LossTableManager.hh"
42 #include "G4UnitsTable.hh"
43 #include "G4SystemOfUnits.hh"
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
48  fMessenger(0),
49  fEmPhysicsList(0)
50 {
52  fMessenger = new PhysicsListMessenger(this);
53 
54  // EM physics
55  fEmName = G4String("standard");
56  fEmPhysicsList = new PhysListEmStandard(fEmName);
57 
59 
60  SetVerboseLevel(1);
61 }
62 
63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
64 
66 {
67  delete fEmPhysicsList;
68  delete fMessenger;
69 }
70 
71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72 
74 {
75  if (verboseLevel>1) {
76  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
77  }
78 
79  if (name == fEmName) return;
80 
81  if (name == "standard") {
82 
83  fEmName = name;
84  delete fEmPhysicsList;
85  fEmPhysicsList = new PhysListEmStandard(name);
86 
87  } else if (name == "livermore") {
88 
89  fEmName = name;
90  delete fEmPhysicsList;
91  fEmPhysicsList = new PhysListEmLivermore(name);
92 
93  } else if (name == "penelope") {
94 
95  fEmName = name;
96  delete fEmPhysicsList;
97  fEmPhysicsList = new PhysListEmPenelope(name);
98 
99  } else {
100 
101  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
102  << " is not defined"
103  << G4endl;
104  }
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108 
109 // Bosons
110 #include "G4ChargedGeantino.hh"
111 #include "G4Geantino.hh"
112 #include "G4Gamma.hh"
113 
114 // leptons
115 #include "G4Electron.hh"
116 #include "G4Positron.hh"
117 
118 #include "G4MuonPlus.hh"
119 #include "G4MuonMinus.hh"
120 
121 // Mesons
122 #include "G4PionPlus.hh"
123 #include "G4PionMinus.hh"
124 
125 #include "G4KaonPlus.hh"
126 #include "G4KaonMinus.hh"
127 
128 // Baryons
129 #include "G4Proton.hh"
130 #include "G4AntiProton.hh"
131 #include "G4Neutron.hh"
132 #include "G4AntiNeutron.hh"
133 
134 // Nuclei
135 #include "G4Deuteron.hh"
136 #include "G4Triton.hh"
137 #include "G4Alpha.hh"
138 #include "G4GenericIon.hh"
139 
141 {
142 // pseudo-particles
145 
146 // gamma
148 
149 // leptons
154 
155 // mesons
160 
161 // baryons
166 
167 // ions
172 }
173 
174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
175 
177 {
179  fEmPhysicsList->ConstructProcess();
180  AddStepMax();
181 }
182 
183 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
184 
185 #include "G4ProcessManager.hh"
186 #include "StepMax.hh"
187 
189 {
190  // Step limitation seen as a process
191  StepMax* stepMaxProcess = new StepMax();
192 
194  particleIterator->reset();
195  while ((*particleIterator)()){
196  G4ParticleDefinition* particle = particleIterator->value();
197  G4ProcessManager* pmanager = particle->GetProcessManager();
198 
199  if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
200  {
201  pmanager ->AddDiscreteProcess(stepMaxProcess);
202  }
203  }
204 }
205 
206 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
void SetDefaultCutValue(G4double newCutValue)
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
const XML_Char * name
Definition: expat.h:151
static G4Triton * TritonDefinition()
Definition: G4Triton.cc:90
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
static G4LossTableManager * Instance()
static constexpr double mm
Definition: G4SIunits.hh:115
static G4KaonMinus * KaonMinusDefinition()
Definition: G4KaonMinus.cc:108
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static G4AntiProton * AntiProtonDefinition()
Definition: G4AntiProton.cc:88
static G4AntiNeutron * AntiNeutronDefinition()
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
G4GLOB_DLL std::ostream G4cout
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:93
void SetVerboseLevel(G4int value)
void AddStepMax()
Definition: PhysicsList.cc:172
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
G4ProcessManager * GetProcessManager() const
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
virtual void ConstructProcess()=0
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
static G4ChargedGeantino * ChargedGeantinoDefinition()
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
#define G4endl
Definition: G4ios.hh:61
void ConstructProcess()
Definition: PhysicsList.cc:170
static G4Deuteron * DeuteronDefinition()
Definition: G4Deuteron.cc:89
static G4Alpha * AlphaDefinition()
Definition: G4Alpha.cc:84
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81