Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
examples/extended/polarisation/Pol01/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 polarisation/Pol01/src/PhysicsList.cc
27 /// \brief Implementation of the PhysicsList class
28 //
29 //
30 // $Id: PhysicsList.cc 68753 2013-04-05 10:26:04Z gcosmo $
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 "PhysListEmPolarized.hh"
40 
41 #include "G4LossTableManager.hh"
42 #include "G4UnitsTable.hh"
43 #include "G4SystemOfUnits.hh"
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
49 {
51 
52  currentDefaultCut = 0.1*mm;
53  cutForGamma = currentDefaultCut;
54  cutForElectron = currentDefaultCut;
55  cutForPositron = currentDefaultCut;
56 
57  pMessenger = new PhysicsListMessenger(this);
58 
59  SetVerboseLevel(1);
60 
61  emName = "polarized";
62  emPhysicsList = new PhysListEmPolarized();
63 
64 }
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67 
69 {
70  delete pMessenger;
71 }
72 
73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74 
75 // Bosons
76 #include "G4Gamma.hh"
77 
78 // leptons
79 #include "G4Electron.hh"
80 #include "G4Positron.hh"
81 
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86 {
87  // only QED in this example
88 
89 // gamma
91 
92 // leptons
95 }
96 
97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98 
99 #include "G4EmProcessOptions.hh"
100 
102 {
103  // Transportation
104  //
106 
107  // Electromagnetic physics list
108  //
109  emPhysicsList->ConstructProcess();
110 
111  // step limitation (as a full process)
112  //
113  AddStepMax();
114 }
115 
116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
117 
119 {
120  if (verboseLevel>0) {
121  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
122  }
123 
124  if (name == emName) return;
125 
126  if (name == "standard") {
127 
128  emName = name;
129  delete emPhysicsList;
130  emPhysicsList = new PhysListEmStandard();
131 
132  }
133  if (name == "polarized") {
134 
135  emName = name;
136  delete emPhysicsList;
137  emPhysicsList = new PhysListEmPolarized();
138 
139  }
140  else {
141  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
142  << " is not defined"
143  << G4endl;
144  }
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
148 
149 #include "G4ProcessManager.hh"
150 #include "StepMax.hh"
151 
153 {
154  // Step limitation seen as a process
155  StepMax* stepMaxProcess = new StepMax();
156 
157  theParticleIterator->reset();
158  while ((*theParticleIterator)()){
159  G4ParticleDefinition* particle = theParticleIterator->value();
160  G4ProcessManager* pmanager = particle->GetProcessManager();
161 
162  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
163  pmanager ->AddDiscreteProcess(stepMaxProcess);
164  }
165 }
166 
167 
168 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
169 
170 #include "G4Gamma.hh"
171 #include "G4Electron.hh"
172 #include "G4Positron.hh"
173 
175 {
176  // set cut values for gamma at first and for e- second and next for e+,
177  // because some processes for e+/e- need cut values for gamma
178  SetCutValue(cutForGamma, "gamma");
179  SetCutValue(cutForElectron, "e-");
180  SetCutValue(cutForPositron, "e+");
181 }
182 
183 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
184 
186 {
187  cutForGamma = cut;
188  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
189 }
190 
191 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
192 
194 {
195  cutForElectron = cut;
196  SetParticleCuts(cutForElectron, G4Electron::Electron());
197 }
198 
199 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
200 
202 {
203  cutForPositron = cut;
204  SetParticleCuts(cutForPositron, G4Positron::Positron());
205 }
206 
207 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4LossTableManager * Instance()
void SetCutValue(G4double aCut, const G4String &pname)
const XML_Char * name
G4ProcessManager * GetProcessManager() const
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
G4GLOB_DLL std::ostream G4cout
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
static G4Positron * Positron()
Definition: G4Positron.cc:94
Definition of the PhysListEmPolarized class.
virtual G4bool IsApplicable(const G4ParticleDefinition &)
virtual void ConstructProcess()=0
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
#define theParticleIterator
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81