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 //
28 //
29 // $Id: PhysicsList.cc 100290 2016-10-17 08:47:55Z 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.hh"
38 
39 #include "G4EmStandardPhysics.hh"
44 #include "G4EmStandardPhysicsSS.hh"
45 #include "G4EmStandardPhysicsGS.hh"
47 #include "G4EmLivermorePhysics.hh"
48 #include "G4EmPenelopePhysics.hh"
49 #include "G4EmLowEPPhysics.hh"
50 
51 #include "DetectorConstruction.hh"
52 
53 #include "G4LossTableManager.hh"
54 #include "G4UnitsTable.hh"
55 #include "G4SystemOfUnits.hh"
56 
57 // particles
58 
59 #include "G4BosonConstructor.hh"
60 #include "G4LeptonConstructor.hh"
61 #include "G4MesonConstructor.hh"
62 #include "G4BosonConstructor.hh"
63 #include "G4BaryonConstructor.hh"
64 #include "G4IonConstructor.hh"
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
70  : G4VModularPhysicsList(), fDet(det)
71 {
72  fMessenger = new PhysicsListMessenger(this);
73  SetVerboseLevel(1);
74 
75  // EM physics
76  fEmName = G4String("local");
77  fEmPhysicsList = new PhysListEmStandard(fEmName);
78 
80  // fix lower limit for cut
83 }
84 
85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
86 
88 {
89  delete fMessenger;
90 }
91 
92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
93 
95 {
96  G4BosonConstructor pBosonConstructor;
97  pBosonConstructor.ConstructParticle();
98 
99  G4LeptonConstructor pLeptonConstructor;
100  pLeptonConstructor.ConstructParticle();
101 
102  G4MesonConstructor pMesonConstructor;
103  pMesonConstructor.ConstructParticle();
104 
105  G4BaryonConstructor pBaryonConstructor;
106  pBaryonConstructor.ConstructParticle();
107 
108  G4IonConstructor pIonConstructor;
109  pIonConstructor.ConstructParticle();
110 
111  G4ShortLivedConstructor pShortLivedConstructor;
112  pShortLivedConstructor.ConstructParticle();
113 }
114 
115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
116 
118 {
119  // Transportation
120  //
122 
123  // Electromagnetic physics list
124  //
125  fEmPhysicsList->ConstructProcess();
126 
127  // Decay Process
128  //
129  AddDecay();
130 
131  // Decay Process
132  //
134 
135  // step limitation (as a full process)
136  //
137  AddStepMax();
138 }
139 
140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
141 
143 {
144  if (verboseLevel>1) {
145  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
146  }
147 
148  if (name == fEmName) return;
149 
150  if (name == "local") {
151  fEmName = name;
152  delete fEmPhysicsList;
153  fEmPhysicsList = new PhysListEmStandard(name);
154 
155  } else if (name == "emstandard_opt0") {
156  fEmName = name;
157  delete fEmPhysicsList;
158  fEmPhysicsList = new G4EmStandardPhysics();
159 
160  } else if (name == "emstandard_opt1") {
161  fEmName = name;
162  delete fEmPhysicsList;
163  fEmPhysicsList = new G4EmStandardPhysics_option1();
164 
165  } else if (name == "emstandard_opt2") {
166  fEmName = name;
167  delete fEmPhysicsList;
168  fEmPhysicsList = new G4EmStandardPhysics_option2();
169 
170  } else if (name == "emstandard_opt3") {
171  fEmName = name;
172  delete fEmPhysicsList;
173  fEmPhysicsList = new G4EmStandardPhysics_option3();
174 
175  } else if (name == "emstandard_opt4") {
176  fEmName = name;
177  delete fEmPhysicsList;
178  fEmPhysicsList = new G4EmStandardPhysics_option4();
179 
180  } else if (name == "emstandardSS") {
181  fEmName = name;
182  delete fEmPhysicsList;
183  fEmPhysicsList = new G4EmStandardPhysicsSS();
184 
185  } else if (name == "emstandardGS") {
186  fEmName = name;
187  delete fEmPhysicsList;
188  fEmPhysicsList = new G4EmStandardPhysicsGS();
189 
190  } else if (name == "emstandardWVI") {
191  fEmName = name;
192  delete fEmPhysicsList;
193  fEmPhysicsList = new G4EmStandardPhysicsWVI();
194 
195  } else if (name == "emlivermore") {
196  fEmName = name;
197  delete fEmPhysicsList;
198  fEmPhysicsList = new G4EmLivermorePhysics();
199 
200  } else if (name == "empenelope") {
201  fEmName = name;
202  delete fEmPhysicsList;
203  fEmPhysicsList = new G4EmPenelopePhysics();
204 
205  } else if (name == "emlowenergy") {
206  fEmName = name;
207  delete fEmPhysicsList;
208  fEmPhysicsList = new G4EmLowEPPhysics();
209 
210  } else {
211 
212  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
213  << " is not defined"
214  << G4endl;
215  }
216 }
217 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
218 
219 #include "G4PhysicsListHelper.hh"
220 #include "G4Decay.hh"
221 
223 {
225 
226  // Decay Process
227  //
228  G4Decay* fDecayProcess = new G4Decay();
229 
231  particleIterator->reset();
232  while( (*particleIterator)() ){
233  G4ParticleDefinition* particle = particleIterator->value();
234  if (fDecayProcess->IsApplicable(*particle))
235  ph->RegisterProcess(fDecayProcess, particle);
236  }
237 }
238 
239 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
240 
241 #include "G4PhysicsListHelper.hh"
242 #include "G4RadioactiveDecay.hh"
243 #include "G4GenericIon.hh"
244 #include "G4NuclideTable.hh"
245 
247 {
248  G4RadioactiveDecay* radioactiveDecay = new G4RadioactiveDecay();
249 
250  radioactiveDecay->SetARM(true); //Atomic Rearangement
251 
253  ph->RegisterProcess(radioactiveDecay, G4GenericIon::GenericIon());
254 
255  // mandatory for G4NuclideTable
256  //
258 }
259 
260 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
261 
262 #include "G4ProcessManager.hh"
263 #include "StepMax.hh"
264 
266 {
267  // Step limitation seen as a process
268  StepMax* stepMaxProcess = new StepMax();
269 
271  particleIterator->reset();
272  while ((*particleIterator)()){
273  G4ParticleDefinition* particle = particleIterator->value();
274  G4ProcessManager* pmanager = particle->GetProcessManager();
275 
276  if (stepMaxProcess->IsApplicable(*particle))
277  {
278  pmanager ->AddDiscreteProcess(stepMaxProcess);
279  }
280  }
281 }
282 
283 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
284 
285 #include "G4Material.hh"
286 
288 {
289  G4LogicalVolume* lBox = fDet->GetWorld()->GetLogicalVolume();
291  const G4MaterialCutsCouple* couple = lBox->GetMaterialCutsCouple();
292  const G4Material* currMat = lBox->GetMaterial();
293 
294  G4ParticleDefinition* part;
295  G4double cut;
296  part = particleTable->FindParticle("e-");
297  cut = G4LossTableManager::Instance()->GetRange(part,val,couple);
298  G4cout << "material : " << currMat->GetName() << G4endl;
299  G4cout << "particle : " << part->GetParticleName() << G4endl;
300  G4cout << "energy : " << G4BestUnit(val,"Energy") << G4endl;
301  G4cout << "range : " << G4BestUnit(cut,"Length") << G4endl;
302 }
303 
304 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
305 
void SetThresholdOfHalfLife(G4double)
void SetDefaultCutValue(G4double newCutValue)
const XML_Char * name
Definition: expat.h:151
void ConstructParticle()
Definition: PhysicsList.cc:117
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4LossTableManager * Instance()
static constexpr double mm
Definition: G4SIunits.hh:115
G4Material * GetMaterial() const
void SetEnergyRange(G4double lowedge, G4double highedge)
const G4VPhysicalVolume * GetWorld()
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
const G4String & GetName() const
Definition: G4Material.hh:178
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static void ConstructParticle()
static void ConstructParticle()
const G4String & GetParticleName() const
static constexpr double picosecond
Definition: G4SIunits.hh:161
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
static void ConstructParticle()
G4GLOB_DLL std::ostream G4cout
static void ConstructParticle()
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)
void SetARM(G4bool arm)
static constexpr double eV
Definition: G4SIunits.hh:215
void SetVerboseLevel(G4int value)
static void ConstructParticle()
void AddStepMax()
Definition: PhysicsList.cc:172
static G4ProductionCutsTable * GetProductionCutsTable()
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
G4LogicalVolume * GetLogicalVolume() const
static G4ParticleTable * GetParticleTable()
G4ProcessManager * GetProcessManager() const
void AddDecay()
Definition: PhysicsList.cc:222
static G4PhysicsListHelper * GetPhysicsListHelper()
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
static constexpr double GeV
Definition: G4SIunits.hh:217
virtual void ConstructProcess()=0
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
Detector construction class to define materials and geometry.
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
#define G4endl
Definition: G4ios.hh:61
static G4NuclideTable * GetInstance()
double G4double
Definition: G4Types.hh:76
void ConstructProcess()
Definition: PhysicsList.cc:170
G4double GetRange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
void GetRange(G4double)
Definition: PhysicsList.cc:287
void AddRadioactiveDecay()
Definition: PhysicsList.cc:246