Geant4  10.01
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 86418 2014-11-11 10:39:38Z 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 #include "G4UnitsTable.hh"
43 #include "G4SystemOfUnits.hh"
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
49 {
50  pMessenger = new PhysicsListMessenger(this);
51 
53 
54  SetVerboseLevel(1);
55 
56  emName = "polarized";
58 
59 }
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
62 
64 {
65  delete pMessenger;
66 }
67 
68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69 
70 // Bosons
71 #include "G4Gamma.hh"
72 
73 // leptons
74 #include "G4Electron.hh"
75 #include "G4Positron.hh"
76 
77 
78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79 
81 {
85 }
86 
87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88 
89 #include "G4EmProcessOptions.hh"
90 
92 {
93  // Transportation
94  //
96 
97  // Electromagnetic physics list
98  //
100 
101  // step limitation (as a full process)
102  //
103  AddStepMax();
104 }
105 
106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107 
109 {
110  if (verboseLevel>0) {
111  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
112  }
113 
114  if (name == emName) return;
115 
116  if (name == "standard") {
117 
118  emName = name;
119  delete emPhysicsList;
121 
122  } else if (name == "polarized") {
123 
124  emName = name;
125  delete emPhysicsList;
127 
128  } else {
129  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
130  << " is not defined"
131  << G4endl;
132  }
133 }
134 
135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
136 
137 #include "G4ProcessManager.hh"
138 #include "StepMax.hh"
139 
141 {
142  // Step limitation seen as a process
143  StepMax* stepMaxProcess = new StepMax();
144 
145  theParticleIterator->reset();
146  while ((*theParticleIterator)()){
147  G4ParticleDefinition* particle = theParticleIterator->value();
148  G4ProcessManager* pmanager = particle->GetProcessManager();
149 
150  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
151  pmanager ->AddDiscreteProcess(stepMaxProcess);
152  }
153 }
154 
155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
void ConstructParticle()
Definition: PhysicsList.cc:117
G4VPhysicsConstructor * emPhysicsList
Definition: PhysicsList.hh:68
G4String name
Definition: TRTMaterials.hh:40
G4ProcessManager * GetProcessManager() const
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
G4GLOB_DLL std::ostream G4cout
void SetVerboseLevel(G4int value)
G4String emName
Definition: PhysicsList.hh:69
void AddStepMax()
Definition: PhysicsList.cc:172
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
Definition of the PhysListEmPolarized class.
PhysicsListMessenger * pMessenger
Definition: PhysicsList.hh:71
static G4EmParameters * Instance()
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
virtual void ConstructProcess()=0
#define G4endl
Definition: G4ios.hh:61
void ConstructProcess()
Definition: PhysicsList.cc:170
#define theParticleIterator
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81