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

Last change on this file since 1282 was 1230, checked in by garnier, 15 years ago

update to geant4.9.3

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