Geant4  10.00.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 68585 2013-04-01 23:35:07Z adotti $
30 //
31 //---------------------------------------------------------------------------
32 //
33 // ClassName: PhysicsList
34 //
35 // Author: V.Ivanchenko 14.10.2002
36 //
37 // Modified:
38 // 17.11.06 Use components from physics_lists subdirectory (V.Ivanchenko)
39 // 24.10.12 Migrated to new stopping and ion physics (A.Ribon)
40 //
41 //----------------------------------------------------------------------------
42 //
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
47 #include "PhysicsList.hh"
48 #include "PhysicsListMessenger.hh"
49 
50 #include "PhysListEmStandard.hh"
51 #include "G4EmStandardPhysics.hh"
56 #include "G4EmLivermorePhysics.hh"
57 #include "G4EmPenelopePhysics.hh"
58 #include "G4DecayPhysics.hh"
60 #include "G4HadronInelasticQBBC.hh"
61 #include "G4IonPhysics.hh"
62 #include "G4EmExtraPhysics.hh"
63 #include "G4StoppingPhysics.hh"
64 
65 #include "G4RegionStore.hh"
66 #include "G4Region.hh"
67 #include "G4ProductionCuts.hh"
68 #include "G4ProcessManager.hh"
69 #include "G4ParticleTypes.hh"
70 #include "G4ParticleTable.hh"
71 
72 #include "G4Gamma.hh"
73 #include "G4Electron.hh"
74 #include "G4Positron.hh"
75 #include "G4Proton.hh"
76 
77 #include "G4UnitsTable.hh"
78 #include "G4SystemOfUnits.hh"
79 #include "G4LossTableManager.hh"
80 #include "StepMax.hh"
81 
82 #include "G4EmProcessOptions.hh"
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85 
87  fEmPhysicsList(0),
88  fDecayPhysicsList(0),
89  fStepMaxProcess(0),
90  fMessenger(0),
91  fVertexDetectorCuts(0),
92  fMuonDetectorCuts(0)
93 {
95  defaultCutValue = 1.*mm;
101 
103  fMuonDetectorCuts = 0;
104 
105  fMessenger = new PhysicsListMessenger(this);
106  fStepMaxProcess = new StepMax();
107 
108  // Initilise flags
109 
110  SetVerboseLevel(1);
111 
112  fHelIsRegisted = false;
113  fBicIsRegisted = false;
114  fGnucIsRegisted = false;
115  fStopIsRegisted = false;
116 
117  // EM physics
118  fEmName = G4String("emstandard");
120 
121  // Decay Physics is always defined
123 }
124 
125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
126 
128 {
129  delete fMessenger;
130  delete fDecayPhysicsList;
131  delete fEmPhysicsList;
132  delete fStepMaxProcess;
133  for(size_t i=0; i<fHadronPhys.size(); i++) {
134  delete fHadronPhys[i];
135  }
136 }
137 
138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
139 
141 {
143 }
144 
145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146 
148 {
152  for(size_t i=0; i<fHadronPhys.size(); ++i) {
153  fHadronPhys[i]->ConstructProcess();
154  }
155  AddStepMax();
156 }
157 
158 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
159 
161 {
162  if (verboseLevel > 1)
163  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
164 
165  if (name == fEmName) return;
166 
167  if (name == "emstandard") {
168  fEmName = name;
169  delete fEmPhysicsList;
171  if (verboseLevel > 0)
172  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
173 
174  } else if (name == "emstandard_opt1") {
175  fEmName = name;
176  delete fEmPhysicsList;
178  if (verboseLevel > 0)
179  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
180 
181  } else if (name == "emstandard_opt2") {
182  fEmName = name;
183  delete fEmPhysicsList;
185  if (verboseLevel > 0)
186  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
187 
188  } else if (name == "emstandard_opt3") {
189  fEmName = name;
190  delete fEmPhysicsList;
192  if (verboseLevel > 0)
193  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
194 
195  } else if (name == "emstandard_opt4") {
196  fEmName = name;
197  delete fEmPhysicsList;
199  if (verboseLevel > 0)
200  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
201 
202  } else if (name == "emstandard_local") {
203  fEmName = name;
204  delete fEmPhysicsList;
206  if (verboseLevel > 0)
207  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
208 
209  } else if (name == "emlivermore") {
210  fEmName = name;
211  delete fEmPhysicsList;
213 
214  } else if (name == "empenelope") {
215  fEmName = name;
216  delete fEmPhysicsList;
218 
219  } else if (name == "elastic" && !fHelIsRegisted) {
220  fHadronPhys.push_back( new G4HadronElasticPhysics());
221  fHelIsRegisted = true;
222  if (verboseLevel > 0)
223  G4cout << "PhysicsList::Add hadron elastic physics" << G4endl;
224 
225  } else if (name == "binary" && !fBicIsRegisted) {
226  fHadronPhys.push_back(new G4HadronInelasticQBBC());
227  fHadronPhys.push_back(new G4IonPhysics());
228  fBicIsRegisted = true;
229  if (verboseLevel > 0)
230  G4cout << "PhysicsList::Add hadron inelastic physics from <QBBC>" << G4endl;
231 
232  } else if (name == "gamma_nuc" && !fGnucIsRegisted) {
233  fHadronPhys.push_back(new G4EmExtraPhysics());
234  fGnucIsRegisted = true;
235  if (verboseLevel > 0)
236  G4cout << "PhysicsList::Add gamma- and electro-nuclear physics" << G4endl;
237 
238  } else if (name == "stopping" && !fStopIsRegisted) {
239  fHadronPhys.push_back(new G4StoppingPhysics());
240  fStopIsRegisted = true;
241  if (verboseLevel > 0)
242  G4cout << "PhysicsList::Add stopping physics" << G4endl;
243 
244  } else {
245  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
246  << " is not defined"
247  << G4endl;
248  }
249 }
250 
251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
252 
254 {
255  // Step limitation seen as a process
256 
257  theParticleIterator->reset();
258  while ((*theParticleIterator)()){
259  G4ParticleDefinition* particle = theParticleIterator->value();
260  G4ProcessManager* pmanager = particle->GetProcessManager();
261 
262  if (fStepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
263  {
265  }
266  }
267 }
268 
269 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
270 
272 {
273  SetCutValue(fCutForGamma, "gamma", "DefaultRegionForTheWorld");
274  SetCutValue(fCutForElectron, "e-", "DefaultRegionForTheWorld");
275  SetCutValue(fCutForElectron, "e+", "DefaultRegionForTheWorld");
276  SetCutValue(fCutForProton, "proton", "DefaultRegionForTheWorld");
277  // G4cout << "PhysicsList: world cuts are set cutG= " << cutForGamma/mm
278  // << " mm cutE= " << fCutForElectron/mm << " mm " << G4endl;
279 
280  //G4cout << " cutV= " << fCutForVertexDetector
281  // << " cutM= " << fCutForMuonDetector<<G4endl;
282 
283  G4Region* region = (G4RegionStore::GetInstance())->GetRegion("VertexDetector");
286  // G4cout << "Vertex cuts are set" << G4endl;
287 
288  region = (G4RegionStore::GetInstance())->GetRegion("MuonDetector");
291  //G4cout << "Muon cuts are set " <<muonRegion << " " << muonDetectorCuts << G4endl;
292 
294 }
295 
296 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
297 
299 {
300  fCutForGamma = cut;
302 }
303 
304 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
305 
307 {
308  fCutForElectron = cut;
311 }
312 
313 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
314 
316 {
317  fCutForProton = cut;
319 }
320 
321 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
322 
324 {
325  fCutForVertexDetector = cut;
326 
327  if( fVertexDetectorCuts ) {
332  }
333 }
334 
335 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
336 
338 {
339  fCutForMuonDetector = cut;
340 
341  if( fMuonDetectorCuts ) {
346  }
347 }
348 
349 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
350 
G4ProductionCuts * GetProductionCuts() const
void ConstructParticle()
Definition: PhysicsList.cc:117
void SetVertexCut(G4double val)
Definition: PhysicsList.cc:323
static G4LossTableManager * Instance()
G4ProductionCuts * fVertexDetectorCuts
Definition: PhysicsList.hh:105
void SetCutValue(G4double aCut, const G4String &pname)
void SetCutForGamma(G4double)
Definition: PhysicsList.cc:231
G4double fCutForMuonDetector
Definition: PhysicsList.hh:94
G4String name
Definition: TRTMaterials.hh:40
G4double fCutForPositron
Definition: PhysicsList.hh:70
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4double fCutForElectron
Definition: PhysicsList.hh:69
void SetProductionCut(G4double cut, G4int index=-1)
void SetCutForProton(G4double)
Definition: PhysicsList.cc:269
std::vector< G4VPhysicsConstructor * > fHadronPhys
Definition: PhysicsList.hh:85
G4ProcessManager * GetProcessManager() const
void SetCutForElectron(G4double)
Definition: PhysicsList.cc:239
void SetMuonCut(G4double val)
Definition: PhysicsList.cc:337
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
G4bool fStopIsRegisted
Definition: PhysicsList.hh:111
G4double fCutForProton
Definition: PhysicsList.hh:68
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
G4ProductionCuts * fMuonDetectorCuts
Definition: PhysicsList.hh:106
static G4RegionStore * GetInstance()
G4bool fHelIsRegisted
Definition: PhysicsList.hh:78
virtual void ConstructParticle()=0
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
G4double fCutForGamma
Definition: PhysicsList.hh:64
static G4Proton * Proton()
Definition: G4Proton.cc:93
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void SetCuts()
Definition: PhysicsList.cc:219
void AddStepMax()
Definition: PhysicsList.cc:172
G4VPhysicsConstructor * fDecayPhysicsList
Definition: PhysicsList.hh:89
static G4Positron * Positron()
Definition: G4Positron.cc:94
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
G4StepLimiter * fStepMaxProcess
Definition: PhysicsList.hh:76
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4String fEmName
Definition: PhysicsList.hh:72
void ConstructProcess()
Definition: PhysicsList.cc:170
static const double mm
Definition: G4SIunits.hh:102
#define theParticleIterator
G4bool fGnucIsRegisted
Definition: PhysicsList.hh:110
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205
G4bool fBicIsRegisted
Definition: PhysicsList.hh:79
G4double fCutForVertexDetector
Definition: PhysicsList.hh:93