source: trunk/examples/extended/electromagnetic/TestEm0/src/PhysicsList.cc@ 1357

Last change on this file since 1357 was 1337, checked in by garnier, 15 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 8.7 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.9 2010/03/21 19:07:53 vnivanch Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-01 $
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#include "G4EmStandardPhysics.hh"
38#include "G4EmStandardPhysics_option1.hh"
39#include "G4EmStandardPhysics_option2.hh"
40#include "G4EmStandardPhysics_option3.hh"
41#include "G4EmLivermorePhysics.hh"
42#include "G4EmPenelopePhysics.hh"
43
44#include "G4LossTableManager.hh"
45#include "G4UnitsTable.hh"
46
47//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48
49PhysicsList::PhysicsList()
50: G4VModularPhysicsList()
51{
52 G4LossTableManager::Instance();
53
54 currentDefaultCut = 1.0*mm;
55 cutForGamma = currentDefaultCut;
56 cutForElectron = currentDefaultCut;
57 cutForPositron = currentDefaultCut;
58
59 pMessenger = new PhysicsListMessenger(this);
60
61 SetVerboseLevel(1);
62
63 // EM physics
64 emName = G4String("local");
65 emPhysicsList = new PhysListEmStandard(emName);
66
67}
68
69//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
70
71PhysicsList::~PhysicsList()
72{
73 delete pMessenger;
74}
75
76//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77
78// Bosons
79#include "G4ChargedGeantino.hh"
80#include "G4Geantino.hh"
81#include "G4Gamma.hh"
82#include "G4OpticalPhoton.hh"
83
84// leptons
85#include "G4MuonPlus.hh"
86#include "G4MuonMinus.hh"
87#include "G4NeutrinoMu.hh"
88#include "G4AntiNeutrinoMu.hh"
89
90#include "G4Electron.hh"
91#include "G4Positron.hh"
92#include "G4NeutrinoE.hh"
93#include "G4AntiNeutrinoE.hh"
94
95// Mesons
96#include "G4PionPlus.hh"
97#include "G4PionMinus.hh"
98#include "G4PionZero.hh"
99#include "G4Eta.hh"
100#include "G4EtaPrime.hh"
101
102#include "G4KaonPlus.hh"
103#include "G4KaonMinus.hh"
104#include "G4KaonZero.hh"
105#include "G4AntiKaonZero.hh"
106#include "G4KaonZeroLong.hh"
107#include "G4KaonZeroShort.hh"
108
109// Baryons
110#include "G4Proton.hh"
111#include "G4AntiProton.hh"
112#include "G4Neutron.hh"
113#include "G4AntiNeutron.hh"
114
115// Nuclei
116#include "G4Deuteron.hh"
117#include "G4Triton.hh"
118#include "G4Alpha.hh"
119#include "G4GenericIon.hh"
120
121//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
122
123void PhysicsList::ConstructParticle()
124{
125// pseudo-particles
126 G4Geantino::GeantinoDefinition();
127 G4ChargedGeantino::ChargedGeantinoDefinition();
128
129// gamma
130 G4Gamma::GammaDefinition();
131
132// optical photon
133 G4OpticalPhoton::OpticalPhotonDefinition();
134
135// leptons
136 G4Electron::ElectronDefinition();
137 G4Positron::PositronDefinition();
138 G4MuonPlus::MuonPlusDefinition();
139 G4MuonMinus::MuonMinusDefinition();
140
141 G4NeutrinoE::NeutrinoEDefinition();
142 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
143 G4NeutrinoMu::NeutrinoMuDefinition();
144 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
145
146// mesons
147 G4PionPlus::PionPlusDefinition();
148 G4PionMinus::PionMinusDefinition();
149 G4PionZero::PionZeroDefinition();
150 G4Eta::EtaDefinition();
151 G4EtaPrime::EtaPrimeDefinition();
152 G4KaonPlus::KaonPlusDefinition();
153 G4KaonMinus::KaonMinusDefinition();
154 G4KaonZero::KaonZeroDefinition();
155 G4AntiKaonZero::AntiKaonZeroDefinition();
156 G4KaonZeroLong::KaonZeroLongDefinition();
157 G4KaonZeroShort::KaonZeroShortDefinition();
158
159// barions
160 G4Proton::ProtonDefinition();
161 G4AntiProton::AntiProtonDefinition();
162 G4Neutron::NeutronDefinition();
163 G4AntiNeutron::AntiNeutronDefinition();
164
165// ions
166 G4Deuteron::DeuteronDefinition();
167 G4Triton::TritonDefinition();
168 G4Alpha::AlphaDefinition();
169 G4GenericIon::GenericIonDefinition();
170}
171
172//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
173
174#include "G4EmProcessOptions.hh"
175
176void PhysicsList::ConstructProcess()
177{
178 // Transportation
179 //
180 AddTransportation();
181
182 // Electromagnetic physics list
183 //
184 emPhysicsList->ConstructProcess();
185
186 // Em options
187 //
188 // Main options and setting parameters are shown here.
189 // Several of them have default values.
190 //
191 G4EmProcessOptions emOptions;
192
193 //physics tables
194 //
195 //emOptions.SetMinEnergy(100*eV); //default
196 //emOptions.SetMaxEnergy(100*TeV); //default
197 //emOptions.SetDEDXBinning(12*20); //default=12*7
198 //emOptions.SetLambdaBinning(12*20); //default=12*7
199
200 emOptions.SetBuildCSDARange(true);
201 //emOptions.SetMaxEnergyForCSDARange(100*TeV);
202 //emOptions.SetDEDXBinningForCSDARange(12*20);
203
204 //emOptions.SetSplineFlag(true); //default
205
206 emOptions.SetVerbose(0);
207}
208
209//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
210
211void PhysicsList::AddPhysicsList(const G4String& name)
212{
213 if (verboseLevel>0) {
214 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
215 }
216
217 if (name == emName) return;
218
219 if (name == "local") {
220
221 emName = name;
222 delete emPhysicsList;
223 emPhysicsList = new PhysListEmStandard(name);
224
225 } else if (name == "emstandard_opt0"){
226 emName = name;
227 delete emPhysicsList;
228 emPhysicsList = new G4EmStandardPhysics();
229
230 } else if (name == "emstandard_opt1"){
231 emName = name;
232 delete emPhysicsList;
233 emPhysicsList = new G4EmStandardPhysics_option1();
234
235 } else if (name == "emstandard_opt2"){
236 emName = name;
237 delete emPhysicsList;
238 emPhysicsList = new G4EmStandardPhysics_option2();
239
240 } else if (name == "emstandard_opt3"){
241 emName = name;
242 delete emPhysicsList;
243 emPhysicsList = new G4EmStandardPhysics_option3();
244
245 } else if (name == "empenelope"){
246 emName = name;
247 delete emPhysicsList;
248 emPhysicsList = new G4EmPenelopePhysics();
249
250 } else if (name == "emlivermore"){
251 emName = name;
252 delete emPhysicsList;
253 emPhysicsList = new G4EmLivermorePhysics();
254
255 } else {
256
257 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
258 << " is not defined"
259 << G4endl;
260 }
261}
262
263//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
264
265#include "G4Gamma.hh"
266#include "G4Electron.hh"
267#include "G4Positron.hh"
268
269void PhysicsList::SetCuts()
270{
271 // fixe lower limit for cut
272 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100*eV, 1*GeV);
273
274 // set cut values for gamma at first and for e- second and next for e+,
275 // because some processes for e+/e- need cut values for gamma
276 SetCutValue(cutForGamma, "gamma");
277 SetCutValue(cutForElectron, "e-");
278 SetCutValue(cutForPositron, "e+");
279 DumpCutValuesTable();
280}
281
282//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
283
284void PhysicsList::SetCutForGamma(G4double cut)
285{
286 cutForGamma = cut;
287 SetParticleCuts(cutForGamma, G4Gamma::Gamma());
288}
289
290//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
291
292void PhysicsList::SetCutForElectron(G4double cut)
293{
294 cutForElectron = cut;
295 SetParticleCuts(cutForElectron, G4Electron::Electron());
296}
297
298//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
299
300void PhysicsList::SetCutForPositron(G4double cut)
301{
302 cutForPositron = cut;
303 SetParticleCuts(cutForPositron, G4Positron::Positron());
304}
305
306//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracBrowser for help on using the repository browser.