source: trunk/examples/extended/electromagnetic/TestEm17/src/PhysicsList.cc @ 1309

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

update to geant4.9.3

File size: 5.9 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 10:06:21 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 "MuNuclearBuilder.hh"
38
39#include "G4LossTableManager.hh"
40
41#include "G4Gamma.hh"
42#include "G4Electron.hh"
43#include "G4Positron.hh"
44
45#include "G4BosonConstructor.hh"
46#include "G4LeptonConstructor.hh"
47#include "G4MesonConstructor.hh"
48#include "G4BosonConstructor.hh"
49#include "G4BaryonConstructor.hh"
50#include "G4IonConstructor.hh"
51#include "G4ShortLivedConstructor.hh"
52
53
54//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55
56PhysicsList::PhysicsList() : G4VModularPhysicsList()
57{
58  SetVerboseLevel(1);
59  pMessenger = new PhysicsListMessenger(this);
60
61  // cuts
62  currentDefaultCut   = 1.0*mm;
63  cutForGamma         = currentDefaultCut;
64  cutForElectron      = currentDefaultCut;
65  cutForPositron      = currentDefaultCut;
66 
67  // EM physics
68  emName = G4String("standard");
69  emPhysicsList = new PhysListEmStandard(emName);
70
71  muNuclPhysicsList = 0;
72 
73  // instanciate EnergyLossTable
74  G4LossTableManager::Instance();
75}
76
77//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78
79PhysicsList::~PhysicsList()
80{
81  delete pMessenger;
82}
83
84//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85
86void PhysicsList::ConstructParticle()
87{
88  G4BosonConstructor  pBosonConstructor;
89  pBosonConstructor.ConstructParticle();
90
91  G4LeptonConstructor pLeptonConstructor;
92  pLeptonConstructor.ConstructParticle();
93
94  G4MesonConstructor pMesonConstructor;
95  pMesonConstructor.ConstructParticle();
96
97  G4BaryonConstructor pBaryonConstructor;
98  pBaryonConstructor.ConstructParticle();
99
100  G4IonConstructor pIonConstructor;
101  pIonConstructor.ConstructParticle();
102
103  G4ShortLivedConstructor pShortLivedConstructor;
104  pShortLivedConstructor.ConstructParticle();
105}
106
107//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108
109void PhysicsList::ConstructProcess()
110{
111  // transportation
112  //
113  AddTransportation();
114 
115  // electromagnetic Physics List
116  //
117  emPhysicsList->ConstructProcess();
118  if(muNuclPhysicsList) muNuclPhysicsList->ConstructProcess();
119}
120
121//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
122
123void PhysicsList::AddPhysicsList(const G4String& name)
124{
125  if (verboseLevel>1) {
126    G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
127  }
128
129  if (name == emName) return;
130
131  if (name == "standard" && name != emName) {
132
133    emName = name;
134    delete emPhysicsList;
135    emPhysicsList = new PhysListEmStandard(name);
136
137  } else if (name == "muNucl") {
138    muNuclPhysicsList = new MuNuclearBuilder(name);
139
140  } else {
141
142    G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
143           << " is not defined"
144           << G4endl;
145  }
146}
147
148//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
149
150void PhysicsList::SetCuts()
151{
152     
153  if (verboseLevel >0){
154    G4cout << "PhysicsList::SetCuts:";
155    G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
156  } 
157
158  // set cut values for gamma at first and for e- second and next for e+,
159  // because some processes for e+/e- need cut values for gamma
160  SetCutValue(cutForGamma, "gamma");
161  SetCutValue(cutForElectron, "e-");
162  SetCutValue(cutForPositron, "e+");   
163   
164  if (verboseLevel>0) DumpCutValuesTable();
165}
166
167//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
168
169#include "G4Gamma.hh"
170#include "G4Electron.hh"
171#include "G4Positron.hh"
172
173void PhysicsList::SetCutForGamma(G4double cut)
174{
175  cutForGamma = cut;
176  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
177}
178
179//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
180
181void PhysicsList::SetCutForElectron(G4double cut)
182{
183  cutForElectron = cut;
184  SetParticleCuts(cutForElectron, G4Electron::Electron());
185}
186
187//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
188
189void PhysicsList::SetCutForPositron(G4double cut)
190{
191  cutForPositron = cut;
192  SetParticleCuts(cutForPositron, G4Positron::Positron());
193}
194
195//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
196
Note: See TracBrowser for help on using the repository browser.