Geant4  10.02
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 93735 2015-10-30 11:00:28Z 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(), fEmPhysicsList(0), fDet(0), fMessenger(0)
71 {
72  fDet = det;
73  fMessenger = new PhysicsListMessenger(this);
74  SetVerboseLevel(1);
75 
76  // EM physics
77  fEmName = G4String("local");
79 
81  // fix lower limit for cut
84 }
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87 
89 {
90  delete fMessenger;
91 }
92 
93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
94 
96 {
97  G4BosonConstructor pBosonConstructor;
98  pBosonConstructor.ConstructParticle();
99 
100  G4LeptonConstructor pLeptonConstructor;
101  pLeptonConstructor.ConstructParticle();
102 
103  G4MesonConstructor pMesonConstructor;
104  pMesonConstructor.ConstructParticle();
105 
106  G4BaryonConstructor pBaryonConstructor;
107  pBaryonConstructor.ConstructParticle();
108 
109  G4IonConstructor pIonConstructor;
110  pIonConstructor.ConstructParticle();
111 
112  G4ShortLivedConstructor pShortLivedConstructor;
113  pShortLivedConstructor.ConstructParticle();
114 }
115 
116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
117 
118 #include "G4EmProcessOptions.hh"
119 
121 {
122  // Transportation
123  //
125 
126  // Electromagnetic physics list
127  //
129 
130  // Em options
131  //
132  G4EmProcessOptions emOptions;
133  emOptions.SetBuildCSDARange(true);
134  emOptions.SetDEDXBinningForCSDARange(10*10);
135 
136  // Decay Process
137  //
138  AddDecay();
139 
140  // Decay Process
141  //
143 
144  // step limitation (as a full process)
145  //
146  AddStepMax();
147 }
148 
149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
150 
152 {
153  if (verboseLevel>1) {
154  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
155  }
156 
157  if (name == fEmName) return;
158 
159  if (name == "local") {
160  fEmName = name;
161  delete fEmPhysicsList;
163 
164  } else if (name == "emstandard_opt0") {
165  fEmName = name;
166  delete fEmPhysicsList;
168 
169  } else if (name == "emstandard_opt1") {
170  fEmName = name;
171  delete fEmPhysicsList;
173 
174  } else if (name == "emstandard_opt2") {
175  fEmName = name;
176  delete fEmPhysicsList;
178 
179  } else if (name == "emstandard_opt3") {
180  fEmName = name;
181  delete fEmPhysicsList;
183 
184  } else if (name == "emstandard_opt4") {
185  fEmName = name;
186  delete fEmPhysicsList;
188 
189  } else if (name == "emstandardSS") {
190  fEmName = name;
191  delete fEmPhysicsList;
193 
194  } else if (name == "emstandardGS") {
195  fEmName = name;
196  delete fEmPhysicsList;
198 
199  } else if (name == "emstandardWVI") {
200  fEmName = name;
201  delete fEmPhysicsList;
203 
204  } else if (name == "emlivermore") {
205  fEmName = name;
206  delete fEmPhysicsList;
208 
209  } else if (name == "empenelope") {
210  fEmName = name;
211  delete fEmPhysicsList;
213 
214  } else if (name == "emlowenergy") {
215  fEmName = name;
216  delete fEmPhysicsList;
218 
219  } else {
220 
221  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
222  << " is not defined"
223  << G4endl;
224  }
225 }
226 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
227 
228 #include "G4PhysicsListHelper.hh"
229 #include "G4Decay.hh"
230 
232 {
234 
235  // Decay Process
236  //
237  G4Decay* fDecayProcess = new G4Decay();
238 
239  theParticleIterator->reset();
240  while( (*theParticleIterator)() ){
241  G4ParticleDefinition* particle = theParticleIterator->value();
242  if (fDecayProcess->IsApplicable(*particle))
243  ph->RegisterProcess(fDecayProcess, particle);
244  }
245 }
246 
247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
248 
249 #include "G4PhysicsListHelper.hh"
250 #include "G4RadioactiveDecay.hh"
251 #include "G4GenericIon.hh"
252 
254 {
255  G4RadioactiveDecay* radioactiveDecay = new G4RadioactiveDecay();
256  radioactiveDecay->SetHLThreshold(-1.*s);
257  radioactiveDecay->SetARM(true); //Atomic Rearangement
258 
260  ph->RegisterProcess(radioactiveDecay, G4GenericIon::GenericIon());
261 }
262 
263 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
264 
265 #include "G4ProcessManager.hh"
266 #include "StepMax.hh"
267 
269 {
270  // Step limitation seen as a process
271  StepMax* stepMaxProcess = new StepMax();
272 
273  theParticleIterator->reset();
274  while ((*theParticleIterator)()){
275  G4ParticleDefinition* particle = theParticleIterator->value();
276  G4ProcessManager* pmanager = particle->GetProcessManager();
277 
278  if (stepMaxProcess->IsApplicable(*particle))
279  {
280  pmanager ->AddDiscreteProcess(stepMaxProcess);
281  }
282  }
283 }
284 
285 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
286 
287 #include "G4Material.hh"
288 
290 {
293  const G4MaterialCutsCouple* couple = lBox->GetMaterialCutsCouple();
294  const G4Material* currMat = lBox->GetMaterial();
295 
296  G4ParticleDefinition* part;
297  G4double cut;
298  part = particleTable->FindParticle("e-");
299  cut = G4LossTableManager::Instance()->GetRange(part,val,couple);
300  G4cout << "material : " << currMat->GetName() << G4endl;
301  G4cout << "particle : " << part->GetParticleName() << G4endl;
302  G4cout << "energy : " << G4BestUnit(val,"Energy") << G4endl;
303  G4cout << "range : " << G4BestUnit(cut,"Length") << G4endl;
304 }
305 
306 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
307 
308 
void SetDefaultCutValue(G4double newCutValue)
void ConstructParticle()
Definition: PhysicsList.cc:117
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4LossTableManager * Instance()
void SetEnergyRange(G4double lowedge, G4double highedge)
const G4VPhysicalVolume * GetWorld()
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
G4Material * GetMaterial() const
G4String name
Definition: TRTMaterials.hh:40
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()
void SetDEDXBinningForCSDARange(G4int val)
static void ConstructParticle()
G4ProcessManager * GetProcessManager() const
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
const G4String & GetParticleName() const
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
static void ConstructParticle()
static const double s
Definition: G4SIunits.hh:168
G4GLOB_DLL std::ostream G4cout
static void ConstructParticle()
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)
void SetARM(G4bool arm)
static const double GeV
Definition: G4SIunits.hh:214
void SetVerboseLevel(G4int value)
static void ConstructParticle()
void AddStepMax()
Definition: PhysicsList.cc:172
static G4ProductionCutsTable * GetProductionCutsTable()
static const double eV
Definition: G4SIunits.hh:212
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
G4LogicalVolume * GetLogicalVolume() const
static G4ParticleTable * GetParticleTable()
void AddDecay()
Definition: PhysicsList.cc:231
static G4PhysicsListHelper * GetPhysicsListHelper()
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
void SetBuildCSDARange(G4bool val)
Detector construction class to demonstrate various ways of placement.
#define G4endl
Definition: G4ios.hh:61
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
DetectorConstruction * fDet
Definition: PhysicsList.hh:70
double G4double
Definition: G4Types.hh:76
void SetHLThreshold(G4double hl)
G4String fEmName
Definition: PhysicsList.hh:72
void ConstructProcess()
Definition: PhysicsList.cc:170
G4double GetRange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
static const double mm
Definition: G4SIunits.hh:114
void GetRange(G4double)
Definition: PhysicsList.cc:289
#define theParticleIterator
void AddRadioactiveDecay()
Definition: PhysicsList.cc:253