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 // $Id: PhysicsList.cc 86064 2014-11-07 08:49:32Z gcosmo $
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "PhysicsList.hh"
35 #include "PhysicsListMessenger.hh"
36 
37 #include "PhysListEmStandard_option0.hh"
38 #include "PhysListEmStandard_option3.hh"
39 #include "PhysListEmStandard_GS.hh"
40 #include "PhysListEmStandard_WVI.hh"
41 #include "PhysListEmStandard_SS.hh"
42 
43 #include "StepMax.hh"
44 
45 #include "G4ParticleDefinition.hh"
46 
47 #include "G4ProcessManager.hh"
48 #include "G4LossTableManager.hh"
49 
50 // Bosons
51 #include "G4ChargedGeantino.hh"
52 #include "G4Geantino.hh"
53 #include "G4Gamma.hh"
54 
55 // leptons
56 #include "G4Electron.hh"
57 #include "G4Positron.hh"
58 
59 // Hadrons
60 #include "G4Proton.hh"
61 
62 #include "G4SystemOfUnits.hh"
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65 
68  fDetector(det),fMessenger(0),fEmName(" "),fEmPhysicsList(0)
69 {
71  fMessenger = new PhysicsListMessenger(this);
72 
73  // EM physics
74  fEmName = G4String("standard_opt3");
76 
77  defaultCutValue = 10*km;
78 
79  SetVerboseLevel(1);
80 }
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83 
85 {
86  delete fEmPhysicsList;
87  delete fMessenger;
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 
93 {
94  // pseudo-particles
97 
98  // gamma
100 
101  // leptons
104 
105  // baryons
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110 
112 {
115 
116  AddStepMax();
117 }
118 
119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
120 
122 {
123  // Step limitation seen as a process
124  StepMax* stepMaxProcess = new StepMax();
125 
126  theParticleIterator->reset();
127  while ((*theParticleIterator)()){
128  G4ParticleDefinition* particle = theParticleIterator->value();
129  G4ProcessManager* pmanager = particle->GetProcessManager();
130 
131  if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
132  {
133  pmanager ->AddDiscreteProcess(stepMaxProcess);
134  }
135  }
136 }
137 
138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
139 
141 {
142  if (verboseLevel>-1) {
143  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
144  }
145 
146  if (name == fEmName) return;
147 
148  if (name == "standard_opt0") {
149 
150  fEmName = name;
151  delete fEmPhysicsList;
153 
154  } else if (name == "standard_opt3") {
155 
156  fEmName = name;
157  delete fEmPhysicsList;
159 
160  } else if (name == "standard_GS") {
161 
162  fEmName = name;
163  delete fEmPhysicsList;
165 
166  } else if (name == "standard_WVI") {
167 
168  fEmName = name;
169  delete fEmPhysicsList;
171 
172  } else if (name == "standard_SS") {
173 
174  fEmName = name;
175  delete fEmPhysicsList;
177  } else {
178 
179  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
180  << " is not defined"
181  << G4endl;
182  }
183 }
184 
185 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
186 
187 #include "G4UnitsTable.hh"
188 
190 {
191  if (verboseLevel >0){
192  G4cout << "PhysicsList::SetCuts:";
193  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
194  }
195 
196  // set cut values for gamma at first and for e- second and next for e+,
197  // because some processes for e+/e- need cut values for gamma
198  SetCutValue(defaultCutValue, "gamma");
201  SetCutValue(defaultCutValue, "proton");
202 }
203 
204 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
void SetCutValue(G4double aCut, const G4String &pname)
G4String name
Definition: TRTMaterials.hh:40
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4ProcessManager * GetProcessManager() const
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
G4GLOB_DLL std::ostream G4cout
void SetVerboseLevel(G4int value)
void SetCuts()
Definition: PhysicsList.cc:219
void AddStepMax()
Definition: PhysicsList.cc:172
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
static const double km
Definition: G4SIunits.hh:114
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
DetectorConstruction * fDetector
Definition: PhysicsList.hh:63
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
static G4ChargedGeantino * ChargedGeantinoDefinition()
Detector construction class to demonstrate various ways of placement.
#define G4endl
Definition: G4ios.hh:61
G4String fEmName
Definition: PhysicsList.hh:72
void ConstructProcess()
Definition: PhysicsList.cc:170
#define theParticleIterator
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81