Geant4  10.01.p01
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 85268 2014-10-27 09:04:27Z 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 "G4EmLivermorePhysics.hh"
46 #include "G4EmPenelopePhysics.hh"
47 #include "G4EmLowEPPhysics.hh"
48 
49 #include "DetectorConstruction.hh"
50 
51 #include "G4LossTableManager.hh"
52 #include "G4UnitsTable.hh"
53 #include "G4SystemOfUnits.hh"
54 
55 // particles
56 
57 #include "G4BosonConstructor.hh"
58 #include "G4LeptonConstructor.hh"
59 #include "G4MesonConstructor.hh"
60 #include "G4BosonConstructor.hh"
61 #include "G4BaryonConstructor.hh"
62 #include "G4IonConstructor.hh"
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66 
68 : G4VModularPhysicsList(), fEmPhysicsList(0), fDet(0), fMessenger(0)
69 {
70  fDet = det;
71  fMessenger = new PhysicsListMessenger(this);
72  SetVerboseLevel(1);
73 
74  // EM physics
75  fEmName = G4String("local");
77 
79  // fix lower limit for cut
82 }
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85 
87 {
88  delete fMessenger;
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92 
94 {
95  G4BosonConstructor pBosonConstructor;
96  pBosonConstructor.ConstructParticle();
97 
98  G4LeptonConstructor pLeptonConstructor;
99  pLeptonConstructor.ConstructParticle();
100 
101  G4MesonConstructor pMesonConstructor;
102  pMesonConstructor.ConstructParticle();
103 
104  G4BaryonConstructor pBaryonConstructor;
105  pBaryonConstructor.ConstructParticle();
106 
107  G4IonConstructor pIonConstructor;
108  pIonConstructor.ConstructParticle();
109 
110  G4ShortLivedConstructor pShortLivedConstructor;
111  pShortLivedConstructor.ConstructParticle();
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115 
116 #include "G4EmProcessOptions.hh"
117 
119 {
120  // Transportation
121  //
123 
124  // Electromagnetic physics list
125  //
127 
128  // Em options
129  //
130  G4EmProcessOptions emOptions;
131  emOptions.SetBuildCSDARange(true);
132  emOptions.SetDEDXBinningForCSDARange(10*10);
133 
134  // Decay Process
135  //
136  AddDecay();
137 
138  // Decay Process
139  //
141 
142  // step limitation (as a full process)
143  //
144  AddStepMax();
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
148 
150 {
151  if (verboseLevel>1) {
152  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
153  }
154 
155  if (name == fEmName) return;
156 
157  if (name == "local") {
158 
159  fEmName = name;
160  delete fEmPhysicsList;
162 
163  } else if (name == "emstandard_opt0") {
164 
165  fEmName = name;
166  delete fEmPhysicsList;
168 
169  } else if (name == "emstandard_opt1") {
170 
171  fEmName = name;
172  delete fEmPhysicsList;
174 
175  } else if (name == "emstandard_opt2") {
176 
177  fEmName = name;
178  delete fEmPhysicsList;
180 
181  } else if (name == "emstandard_opt3") {
182 
183  fEmName = name;
184  delete fEmPhysicsList;
186 
187  } else if (name == "emstandard_opt4") {
188 
189  fEmName = name;
190  delete fEmPhysicsList;
192 
193  } else if (name == "emstandardSS") {
194 
195  fEmName = name;
196  delete fEmPhysicsList;
198 
199  } else if (name == "emlivermore") {
200  fEmName = name;
201  delete fEmPhysicsList;
203 
204  } else if (name == "empenelope") {
205  fEmName = name;
206  delete fEmPhysicsList;
208 
209  } else if (name == "emlowenergy") {
210  fEmName = name;
211  delete fEmPhysicsList;
213 
214  } else {
215 
216  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
217  << " is not defined"
218  << G4endl;
219  }
220 }
221 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
222 
223 #include "G4PhysicsListHelper.hh"
224 #include "G4Decay.hh"
225 
227 {
229 
230  // Decay Process
231  //
232  G4Decay* fDecayProcess = new G4Decay();
233 
234  theParticleIterator->reset();
235  while( (*theParticleIterator)() ){
236  G4ParticleDefinition* particle = theParticleIterator->value();
237  if (fDecayProcess->IsApplicable(*particle))
238  ph->RegisterProcess(fDecayProcess, particle);
239  }
240 }
241 
242 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
243 
244 #include "G4PhysicsListHelper.hh"
245 #include "G4RadioactiveDecay.hh"
246 #include "G4GenericIon.hh"
247 
249 {
250  G4RadioactiveDecay* radioactiveDecay = new G4RadioactiveDecay();
251  radioactiveDecay->SetHLThreshold(-1.*s);
252  radioactiveDecay->SetICM(true); //Internal Conversion
253  radioactiveDecay->SetARM(true); //Atomic Rearangement
254 
256  ph->RegisterProcess(radioactiveDecay, G4GenericIon::GenericIon());
257 }
258 
259 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
260 
261 #include "G4ProcessManager.hh"
262 #include "StepMax.hh"
263 
265 {
266  // Step limitation seen as a process
267  StepMax* stepMaxProcess = new StepMax();
268 
269  theParticleIterator->reset();
270  while ((*theParticleIterator)()){
271  G4ParticleDefinition* particle = theParticleIterator->value();
272  G4ProcessManager* pmanager = particle->GetProcessManager();
273 
274  if (stepMaxProcess->IsApplicable(*particle))
275  {
276  pmanager ->AddDiscreteProcess(stepMaxProcess);
277  }
278  }
279 }
280 
281 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
282 
283 #include "G4Material.hh"
284 
286 {
289  const G4MaterialCutsCouple* couple = lBox->GetMaterialCutsCouple();
290  const G4Material* currMat = lBox->GetMaterial();
291 
292  G4ParticleDefinition* part;
293  G4double cut;
294  part = particleTable->FindParticle("e-");
295  cut = G4LossTableManager::Instance()->GetRange(part,val,couple);
296  G4cout << "material : " << currMat->GetName() << G4endl;
297  G4cout << "particle : " << part->GetParticleName() << G4endl;
298  G4cout << "energy : " << G4BestUnit(val,"Energy") << G4endl;
299  G4cout << "range : " << G4BestUnit(cut,"Length") << G4endl;
300 }
301 
302 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
303 
304 
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:150
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:196
void SetVerboseLevel(G4int value)
static void ConstructParticle()
void AddStepMax()
Definition: PhysicsList.cc:172
static G4ProductionCutsTable * GetProductionCutsTable()
static const double eV
Definition: G4SIunits.hh:194
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
G4LogicalVolume * GetLogicalVolume() const
static G4ParticleTable * GetParticleTable()
void AddDecay()
Definition: PhysicsList.cc:226
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
void SetICM(G4bool icm)
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:102
void GetRange(G4double)
Definition: PhysicsList.cc:285
#define theParticleIterator
void AddRadioactiveDecay()
Definition: PhysicsList.cc:248