Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
examples/extended/electromagnetic/TestEm17/src/PhysicsList.cc
Go to the documentation of this file.
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 /// \file electromagnetic/TestEm17/src/PhysicsList.cc
27 /// \brief Implementation of the PhysicsList class
28 //
29 //
30 // $Id: PhysicsList.cc 67268 2013-02-13 11:38:40Z ihrivnac $
31 //
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 
35 #include "PhysicsList.hh"
36 #include "PhysicsListMessenger.hh"
37 
38 #include "PhysListEmStandard.hh"
39 #include "MuNuclearBuilder.hh"
40 
41 #include "G4LossTableManager.hh"
42 
43 #include "G4Gamma.hh"
44 #include "G4Electron.hh"
45 #include "G4Positron.hh"
46 
47 #include "G4BosonConstructor.hh"
48 #include "G4LeptonConstructor.hh"
49 #include "G4MesonConstructor.hh"
50 #include "G4BosonConstructor.hh"
51 #include "G4BaryonConstructor.hh"
52 #include "G4IonConstructor.hh"
54 
55 #include "G4SystemOfUnits.hh"
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 
60  fEmPhysicsList(0),
61  fMuNuclPhysicsList(0),
62  fMessenger(0)
63 {
64  SetVerboseLevel(1);
65  fMessenger = new PhysicsListMessenger(this);
66 
67  // cuts
68  fCurrentDefaultCut = 1.0*mm;
69  fCutForGamma = fCurrentDefaultCut;
70  fCutForElectron = fCurrentDefaultCut;
71  fCutForPositron = fCurrentDefaultCut;
72 
73  // EM physics
74  fEmName = G4String("standard");
75  fEmPhysicsList = new PhysListEmStandard(fEmName);
76 
77  fMuNuclPhysicsList = 0;
78 
79  // instanciate EnergyLossTable
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86 {
87  delete fMessenger;
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 
93 {
94  G4BosonConstructor pBosonConstructor;
95  pBosonConstructor.ConstructParticle();
96 
97  G4LeptonConstructor pLeptonConstructor;
98  pLeptonConstructor.ConstructParticle();
99 
100  G4MesonConstructor pMesonConstructor;
101  pMesonConstructor.ConstructParticle();
102 
103  G4BaryonConstructor pBaryonConstructor;
104  pBaryonConstructor.ConstructParticle();
105 
106  G4IonConstructor pIonConstructor;
107  pIonConstructor.ConstructParticle();
108 
109  G4ShortLivedConstructor pShortLivedConstructor;
110  pShortLivedConstructor.ConstructParticle();
111 }
112 
113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
114 
116 {
117  // transportation
118  //
120 
121  // electromagnetic Physics List
122  //
123  fEmPhysicsList->ConstructProcess();
124  if(fMuNuclPhysicsList) fMuNuclPhysicsList->ConstructProcess();
125 }
126 
127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
128 
130 {
131  if (verboseLevel>1) {
132  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
133  }
134 
135  if (name == fEmName) return;
136 
137  if (name == "standard" && name != fEmName) {
138 
139  fEmName = name;
140  delete fEmPhysicsList;
141  fEmPhysicsList = new PhysListEmStandard(name);
142 
143  } else if (name == "muNucl") {
144  fMuNuclPhysicsList = new MuNuclearBuilder(name);
145 
146  } else {
147 
148  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
149  << " is not defined"
150  << G4endl;
151  }
152 }
153 
154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
155 
157 {
158 
159  if (verboseLevel >0){
160  G4cout << "PhysicsList::SetCuts:";
161  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
162  }
163 
164  // set cut values for gamma at first and for e- second and next for e+,
165  // because some processes for e+/e- need cut values for gamma
166  SetCutValue(fCutForGamma, "gamma");
167  SetCutValue(fCutForElectron, "e-");
168  SetCutValue(fCutForPositron, "e+");
169 
171 }
172 
173 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
174 
175 #include "G4Gamma.hh"
176 #include "G4Electron.hh"
177 #include "G4Positron.hh"
178 
180 {
181  fCutForGamma = cut;
182  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
183 }
184 
185 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
186 
188 {
189  fCutForElectron = cut;
190  SetParticleCuts(fCutForElectron, G4Electron::Electron());
191 }
192 
193 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
194 
196 {
197  fCutForPositron = cut;
198  SetParticleCuts(fCutForPositron, G4Positron::Positron());
199 }
200 
201 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
202 
static G4LossTableManager * Instance()
void SetCutValue(G4double aCut, const G4String &pname)
const XML_Char * name
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static void ConstructParticle()
static void ConstructParticle()
Definition of the MuNuclearBuilder class.
static void ConstructParticle()
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
static void ConstructParticle()
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static void ConstructParticle()
static G4Positron * Positron()
Definition: G4Positron.cc:94
virtual void ConstructProcess()=0
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76