Geant4  10.03.p03
 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 //
28 //
29 //
30 // $Id: PhysicsList.cc 100257 2016-10-17 08:00:06Z gcosmo $
31 //
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 
35 #include "PhysicsList.hh"
36 #include "PhysicsListMessenger.hh"
37 
38 #include "G4EmStandardPhysics.hh"
39 #include "PhysListEmPolarized.hh"
40 
41 #include "G4EmParameters.hh"
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
47  fEmPhysicsList(0), fEmName("polarized"), fMessenger(0)
48 {
49  fMessenger = new PhysicsListMessenger(this);
50 
52 
53  SetVerboseLevel(1);
54 
55  fEmPhysicsList = new PhysListEmPolarized();
56 
57 }
58 
59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60 
62 {
63  delete fMessenger;
64 }
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67 
68 #include "G4BosonConstructor.hh"
69 #include "G4LeptonConstructor.hh"
70 #include "G4MesonConstructor.hh"
71 #include "G4BosonConstructor.hh"
72 #include "G4BaryonConstructor.hh"
73 #include "G4IonConstructor.hh"
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79 {
80  G4BosonConstructor pBosonConstructor;
81  pBosonConstructor.ConstructParticle();
82 
83  G4LeptonConstructor pLeptonConstructor;
84  pLeptonConstructor.ConstructParticle();
85 
86  G4MesonConstructor pMesonConstructor;
87  pMesonConstructor.ConstructParticle();
88 
89  G4BaryonConstructor pBaryonConstructor;
90  pBaryonConstructor.ConstructParticle();
91 
92  G4IonConstructor pIonConstructor;
93  pIonConstructor.ConstructParticle();
94 
95  G4ShortLivedConstructor pShortLivedConstructor;
96  pShortLivedConstructor.ConstructParticle();
97 
98 }
99 
100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101 
102 #include "G4EmProcessOptions.hh"
103 
105 {
106  // Transportation
107  //
109 
110  // Electromagnetic physics list
111  //
112  fEmPhysicsList->ConstructProcess();
113 
114  // step limitation (as a full process)
115  //
116  AddStepMax();
117 }
118 
119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
120 
122 {
123  if (verboseLevel>0) {
124  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
125  }
126 
127  if (name == fEmName) return;
128 
129  if (name == "standard") {
130 
131  fEmName = name;
132  delete fEmPhysicsList;
133  fEmPhysicsList = new G4EmStandardPhysics();
134 
135  } else if (name == "polarized") {
136 
137  fEmName = name;
138  delete fEmPhysicsList;
139  fEmPhysicsList = new PhysListEmPolarized();
140 
141  } else {
142  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
143  << " is not defined"
144  << G4endl;
145  }
146 }
147 
148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
149 
150 #include "G4ProcessManager.hh"
151 #include "StepMax.hh"
152 
154 {
155  // Step limitation seen as a process
156  StepMax* stepMaxProcess = new StepMax();
157 
159  particleIterator->reset();
160  while ((*particleIterator)()){
161  G4ParticleDefinition* particle = particleIterator->value();
162  G4ProcessManager* pmanager = particle->GetProcessManager();
163 
164  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
165  pmanager ->AddDiscreteProcess(stepMaxProcess);
166  }
167 }
168 
169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const XML_Char * name
Definition: expat.h:151
void ConstructParticle()
Definition: PhysicsList.cc:117
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()
void AddStepMax()
Definition: PhysicsList.cc:172
G4ProcessManager * GetProcessManager() const
Definition of the PhysListEmPolarized class.
static G4EmParameters * Instance()
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
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