Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 // $Id: PhysicsList.cc 100660 2016-10-31 10:19:31Z gcosmo $
27 //
28 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30 
31 #include "PhysicsList.hh"
32 #include "PhysicsListMessenger.hh"
33 
34 #include "PhysListEmStandard.hh"
35 
36 #include "G4EmStandardPhysics.hh"
40 
41 #include "G4LossTableManager.hh"
42 #include "G4SystemOfUnits.hh"
43 #include "G4UnitsTable.hh"
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
48 {
49  pMessenger = new PhysicsListMessenger(this);
50  SetVerboseLevel(1);
51 
52  // EM physics
53  emName = G4String("local");
54  emPhysicsList = new PhysListEmStandard(emName);
55 
58 }
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
61 
63 {
64  delete pMessenger;
65 }
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
69 #include "G4BosonConstructor.hh"
70 #include "G4LeptonConstructor.hh"
71 #include "G4MesonConstructor.hh"
72 #include "G4BosonConstructor.hh"
73 #include "G4BaryonConstructor.hh"
74 #include "G4IonConstructor.hh"
76 
78 {
79  G4BosonConstructor pBosonConstructor;
80  pBosonConstructor.ConstructParticle();
81 
82  G4LeptonConstructor pLeptonConstructor;
83  pLeptonConstructor.ConstructParticle();
84 
85  G4MesonConstructor pMesonConstructor;
86  pMesonConstructor.ConstructParticle();
87 
88  G4BaryonConstructor pBaryonConstructor;
89  pBaryonConstructor.ConstructParticle();
90 
91  G4IonConstructor pIonConstructor;
92  pIonConstructor.ConstructParticle();
93 
94  G4ShortLivedConstructor pShortLivedConstructor;
95  pShortLivedConstructor.ConstructParticle();
96 }
97 
98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
99 
100 #include "G4PhysicsListHelper.hh"
101 #include "G4Decay.hh"
102 
104 {
106 
107  // electromagnetic Physics List
108  //
109  emPhysicsList->ConstructProcess();
110 
111  // Add Decay Process
112  //
113  G4Decay* fDecayProcess = new G4Decay();
115 
117  particleIterator->reset();
118  while( (*particleIterator)() ){
119  G4ParticleDefinition* particle = particleIterator->value();
120  if (fDecayProcess->IsApplicable(*particle))
121  ph ->RegisterProcess(fDecayProcess, particle);
122  }
123 }
124 
125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
126 
128 {
129  if (verboseLevel>1) {
130  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
131  }
132 
133  if (name == emName) return;
134 
135  if (name == "local") {
136 
137  emName = name;
138  delete emPhysicsList;
139  emPhysicsList = new PhysListEmStandard(name);
140 
141  } else if (name == "emstandard_opt0") {
142 
143  emName = name;
144  delete emPhysicsList;
145  emPhysicsList = new G4EmStandardPhysics();
146 
147  } else if (name == "emstandard_opt1") {
148 
149  emName = name;
150  delete emPhysicsList;
151  emPhysicsList = new G4EmStandardPhysics_option1();
152 
153  } else if (name == "emstandard_opt2") {
154 
155  emName = name;
156  delete emPhysicsList;
157  emPhysicsList = new G4EmStandardPhysics_option2();
158 
159  } else if (name == "emstandard_opt3") {
160 
161  emName = name;
162  delete emPhysicsList;
163  emPhysicsList = new G4EmStandardPhysics_option3();
164 
165  } else {
166 
167  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
168  << " is not defined"
169  << G4endl;
170  }
171 }
172 
173 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetDefaultCutValue(G4double newCutValue)
const XML_Char * name
Definition: expat.h:151
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
static constexpr double mm
Definition: G4SIunits.hh:115
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)
static void ConstructParticle()
static void ConstructParticle()
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
static void ConstructParticle()
G4GLOB_DLL std::ostream G4cout
static void ConstructParticle()
void SetVerboseLevel(G4int value)
static void ConstructParticle()
static G4PhysicsListHelper * GetPhysicsListHelper()
virtual void ConstructProcess()=0
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
#define G4endl
Definition: G4ios.hh:61
void ConstructProcess()
Definition: PhysicsList.cc:170