source: trunk/examples/extended/electromagnetic/TestEm14/src/PhysicsList.cc@ 1036

Last change on this file since 1036 was 807, checked in by garnier, 17 years ago

update

File size: 7.4 KB
Line 
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,v 1.4 2006/10/24 16:54:16 maire Exp $
28// GEANT4 tag $Name: $
29//
30//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
33#include "PhysicsList.hh"
34#include "PhysicsListMessenger.hh"
35
36#include "PhysListEmStandard.hh"
37
38#include "PhysListEmLivermore.hh"
39#include "PhysListEmPenelope.hh"
40
41#include "G4LossTableManager.hh"
42#include "G4UnitsTable.hh"
43
44//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45
46PhysicsList::PhysicsList()
47: G4VModularPhysicsList()
48{
49 G4LossTableManager::Instance();
50
51 currentDefaultCut = 1.0*mm;
52 cutForGamma = currentDefaultCut;
53 cutForElectron = currentDefaultCut;
54 cutForPositron = currentDefaultCut;
55
56 pMessenger = new PhysicsListMessenger(this);
57
58 SetVerboseLevel(1);
59
60 // EM physics
61 emName = G4String("standard");
62 emPhysicsList = new PhysListEmStandard(emName);
63
64}
65
66//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67
68PhysicsList::~PhysicsList()
69{
70 delete pMessenger;
71}
72
73//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74
75// Bosons
76#include "G4ChargedGeantino.hh"
77#include "G4Geantino.hh"
78#include "G4Gamma.hh"
79#include "G4OpticalPhoton.hh"
80
81// leptons
82#include "G4MuonPlus.hh"
83#include "G4MuonMinus.hh"
84#include "G4NeutrinoMu.hh"
85#include "G4AntiNeutrinoMu.hh"
86
87#include "G4Electron.hh"
88#include "G4Positron.hh"
89#include "G4NeutrinoE.hh"
90#include "G4AntiNeutrinoE.hh"
91
92// Mesons
93#include "G4PionPlus.hh"
94#include "G4PionMinus.hh"
95#include "G4PionZero.hh"
96#include "G4Eta.hh"
97#include "G4EtaPrime.hh"
98
99#include "G4KaonPlus.hh"
100#include "G4KaonMinus.hh"
101#include "G4KaonZero.hh"
102#include "G4AntiKaonZero.hh"
103#include "G4KaonZeroLong.hh"
104#include "G4KaonZeroShort.hh"
105
106// Baryons
107#include "G4Proton.hh"
108#include "G4AntiProton.hh"
109#include "G4Neutron.hh"
110#include "G4AntiNeutron.hh"
111
112// Nuclei
113#include "G4Deuteron.hh"
114#include "G4Triton.hh"
115#include "G4Alpha.hh"
116#include "G4GenericIon.hh"
117
118//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119
120void PhysicsList::ConstructParticle()
121{
122// pseudo-particles
123 G4Geantino::GeantinoDefinition();
124 G4ChargedGeantino::ChargedGeantinoDefinition();
125
126// gamma
127 G4Gamma::GammaDefinition();
128
129// optical photon
130 G4OpticalPhoton::OpticalPhotonDefinition();
131
132// leptons
133 G4Electron::ElectronDefinition();
134 G4Positron::PositronDefinition();
135 G4MuonPlus::MuonPlusDefinition();
136 G4MuonMinus::MuonMinusDefinition();
137
138 G4NeutrinoE::NeutrinoEDefinition();
139 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
140 G4NeutrinoMu::NeutrinoMuDefinition();
141 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
142
143// mesons
144 G4PionPlus::PionPlusDefinition();
145 G4PionMinus::PionMinusDefinition();
146 G4PionZero::PionZeroDefinition();
147 G4Eta::EtaDefinition();
148 G4EtaPrime::EtaPrimeDefinition();
149 G4KaonPlus::KaonPlusDefinition();
150 G4KaonMinus::KaonMinusDefinition();
151 G4KaonZero::KaonZeroDefinition();
152 G4AntiKaonZero::AntiKaonZeroDefinition();
153 G4KaonZeroLong::KaonZeroLongDefinition();
154 G4KaonZeroShort::KaonZeroShortDefinition();
155
156// barions
157 G4Proton::ProtonDefinition();
158 G4AntiProton::AntiProtonDefinition();
159 G4Neutron::NeutronDefinition();
160 G4AntiNeutron::AntiNeutronDefinition();
161
162// ions
163 G4Deuteron::DeuteronDefinition();
164 G4Triton::TritonDefinition();
165 G4Alpha::AlphaDefinition();
166 G4GenericIon::GenericIonDefinition();
167}
168
169//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
170
171#include "G4EmProcessOptions.hh"
172
173void PhysicsList::ConstructProcess()
174{
175 // Transportation
176 //
177 AddTransportation();
178
179 // Electromagnetic physics list
180 //
181 emPhysicsList->ConstructProcess();
182
183 // Em options
184 //
185 G4EmProcessOptions emOptions;
186 emOptions.SetStepFunction(1., 1*mm);
187 emOptions.SetIntegral(false);
188 emOptions.SetLossFluctuations(false);
189}
190
191//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
192
193void PhysicsList::AddPhysicsList(const G4String& name)
194{
195 if (verboseLevel>0) {
196 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
197 }
198
199 if (name == emName) return;
200
201 if (name == "standard") {
202
203 emName = name;
204 delete emPhysicsList;
205 emPhysicsList = new PhysListEmStandard(name);
206
207 } else if (name == "livermore") {
208 emName = name;
209 delete emPhysicsList;
210 emPhysicsList = new PhysListEmLivermore(name);
211
212 } else if (name == "penelope") {
213 emName = name;
214 delete emPhysicsList;
215 emPhysicsList = new PhysListEmPenelope(name);
216
217 } else {
218 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
219 << " is not defined"
220 << G4endl;
221 }
222}
223
224//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
225
226#include "G4Gamma.hh"
227#include "G4Electron.hh"
228#include "G4Positron.hh"
229
230void PhysicsList::SetCuts()
231{
232 // set cut values for gamma at first and for e- second and next for e+,
233 // because some processes for e+/e- need cut values for gamma
234 SetCutValue(cutForGamma, "gamma");
235 SetCutValue(cutForElectron, "e-");
236 SetCutValue(cutForPositron, "e+");
237}
238
239//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
240
241void PhysicsList::SetCutForGamma(G4double cut)
242{
243 cutForGamma = cut;
244 SetParticleCuts(cutForGamma, G4Gamma::Gamma());
245}
246
247//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
248
249void PhysicsList::SetCutForElectron(G4double cut)
250{
251 cutForElectron = cut;
252 SetParticleCuts(cutForElectron, G4Electron::Electron());
253}
254
255//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
256
257void PhysicsList::SetCutForPositron(G4double cut)
258{
259 cutForPositron = cut;
260 SetParticleCuts(cutForPositron, G4Positron::Positron());
261}
262
263//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracBrowser for help on using the repository browser.