source: trunk/examples/extended/electromagnetic/TestEm13/src/PhysicsList.cc @ 1279

Last change on this file since 1279 was 1230, checked in by garnier, 14 years ago

update to geant4.9.3

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.7 2009/11/19 17:30:25 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 "PhysListEmLivermore.hh"
38#include "PhysListEmPenelope.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  G4EmProcessOptions emOptions;
185  emOptions.SetStepFunction(1., 1*mm); 
186  emOptions.SetIntegral(false);
187  emOptions.SetLossFluctuations(false);   
188}
189
190//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
191
192void PhysicsList::AddPhysicsList(const G4String& name)
193{
194  if (verboseLevel>0) {
195    G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
196  }
197 
198  if (name == emName) return;
199
200  if (name == "standard") {
201    emName = name;
202    delete emPhysicsList;
203    emPhysicsList = new PhysListEmStandard(name);
204   
205  } else if (name == "livermore") {
206    emName = name;
207    delete emPhysicsList;
208    emPhysicsList = new PhysListEmLivermore(name);
209   
210  } else if (name == "penelope") {
211    emName = name;
212    delete emPhysicsList;
213    emPhysicsList = new PhysListEmPenelope(name);
214                         
215  } else {
216    G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
217           << " is not defined"
218           << G4endl;
219  }
220}
221
222//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
223
224#include "G4Gamma.hh"
225#include "G4Electron.hh"
226#include "G4Positron.hh"
227
228void PhysicsList::SetCuts()
229{   
230  // set cut values for gamma at first and for e- second and next for e+,
231  // because some processes for e+/e- need cut values for gamma
232  SetCutValue(cutForGamma, "gamma");
233  SetCutValue(cutForElectron, "e-");
234  SetCutValue(cutForPositron, "e+");
235}
236
237//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
238
239void PhysicsList::SetCutForGamma(G4double cut)
240{
241  cutForGamma = cut;
242  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
243}
244
245//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
246
247void PhysicsList::SetCutForElectron(G4double cut)
248{
249  cutForElectron = cut;
250  SetParticleCuts(cutForElectron, G4Electron::Electron());
251}
252
253//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
254
255void PhysicsList::SetCutForPositron(G4double cut)
256{
257  cutForPositron = cut;
258  SetParticleCuts(cutForPositron, G4Positron::Positron());
259}
260
261//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracBrowser for help on using the repository browser.