Geant4_10
exrdmPhysicsList.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 //
26 // $Id: exrdmPhysicsList.cc 73290 2013-08-23 10:04:20Z gcosmo $
27 //
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 
33 #include "exrdmPhysicsList.hh"
35 
37 #include "G4EmStandardPhysics.hh"
39 #include "G4EmLivermorePhysics.hh"
40 #include "G4EmPenelopePhysics.hh"
41 #include "exrdmPhysListHadron.hh"
42 #include "G4RegionStore.hh"
43 #include "G4Region.hh"
44 #include "G4ProductionCuts.hh"
45 #include "G4ProcessManager.hh"
46 #include "G4ParticleTypes.hh"
47 #include "G4ParticleTable.hh"
48 
49 #include "G4Gamma.hh"
50 #include "G4Electron.hh"
51 #include "G4Positron.hh"
52 
53 #include "G4UnitsTable.hh"
54 #include "G4LossTableManager.hh"
55 
60 
61 #include "G4EmExtraPhysics.hh"
64 #include "G4StoppingPhysics.hh"
67 #include "G4NeutronTrackingCut.hh"
68 #include "G4DecayPhysics.hh"
69 
70 #include "G4SystemOfUnits.hh"
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73 
76  fCutForGamma(1.*mm), fCutForElectron(1.*mm),
77  fCutForPositron(1.*mm),
78  fEmPhysicsList(0),
79  fRaddecayList(0),
80  fParticleList(0),
81  fHadPhysicsList(0),
82  fNhadcomp(0),
83  fPMessenger(0),fDetectorCuts(0), fTargetCuts(0)
84 {
86  defaultCutValue =1.*mm;
87 
88  fPMessenger = new exrdmPhysicsListMessenger(this);
89 
90  SetVerboseLevel(1);
91 
92  //default physics
93  fParticleList = new G4DecayPhysics();
94 
95  //default physics
96  fRaddecayList = new G4RadioactiveDecayPhysics();
97 
98  // EM physics
99  fEmPhysicsList = new G4EmStandardPhysics();
100 }
101 
102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
103 
105 {
106  delete fPMessenger;
107  delete fRaddecayList;
108  delete fEmPhysicsList;
109  if (fHadPhysicsList) delete fHadPhysicsList;
110  if (fNhadcomp > 0) {
111  for(G4int i=0; i<fNhadcomp; i++) {
112  delete fHadronPhys[i];
113  }
114  }
115 }
116 
117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
118 
120 {
121  fParticleList->ConstructParticle();
122 }
123 
124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
125 
127 {
129  // em
130  fEmPhysicsList->ConstructProcess();
131  // decays
132  fParticleList->ConstructProcess();
133  fRaddecayList->ConstructProcess();
134  // had
135  if (fNhadcomp > 0) {
136  for(G4int i=0; i<fNhadcomp; i++) {
137  (fHadronPhys[i])->ConstructProcess();
138  }
139  }
140  if (fHadPhysicsList) fHadPhysicsList->ConstructProcess();
141  G4cout << "### exrdmPhysicsList::ConstructProcess is done" << G4endl;
142 
143 }
144 
145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146 
148 {
149  if (verboseLevel>1) {
150  G4cout << "exrdmPhysicsList::SelectPhysicsList: <" << name << ">" << G4endl;
151  }
152  // default Had physics
153  if (name == "Hadron" && !fHadPhysicsList) {
154  fHadPhysicsList = new exrdmPhysListHadron("hadron");
155  } else if (name == "QGSP_BERT") {
156  AddExtraBuilders(false);
157  fHadPhysicsList = new G4HadronPhysicsQGSP_BERT(verboseLevel);
158  } else if (name == "QGSP_BIC" && !fHadPhysicsList) {
159  AddExtraBuilders(false);
160  fHadPhysicsList = new G4HadronPhysicsQGSP_BIC(verboseLevel);
161  } else if (name == "QGSP_BERT_HP" && !fHadPhysicsList) {
162  AddExtraBuilders(true);
163  fHadPhysicsList = new G4HadronPhysicsQGSP_BERT_HP(verboseLevel);
164  } else if (name == "QGSP_BIC_HP" && !fHadPhysicsList) {
165  AddExtraBuilders(true);
166  fHadPhysicsList = new G4HadronPhysicsQGSP_BIC_HP(verboseLevel);
167  } else if (name == "emlivermore") {
168  delete fEmPhysicsList;
169  fEmPhysicsList = new G4EmLivermorePhysics(verboseLevel);
170  } else if (name == "empenelope") {
171  delete fEmPhysicsList;
172  fEmPhysicsList = new G4EmPenelopePhysics(verboseLevel);
173  } else if (name == "emstandard") {
174  delete fEmPhysicsList;
175  fEmPhysicsList = new G4EmStandardPhysics(verboseLevel);
176  } else if (name == "emstandard_opt4") {
177  delete fEmPhysicsList;
178  fEmPhysicsList = new G4EmStandardPhysics_option4(verboseLevel);
179  } else {
180  G4cout << "exrdmPhysicsList WARNING wrong or unkonwn <"
181  << name << "> Physics " << G4endl;
182  }
183 }
184 
185 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
186 
187 void exrdmPhysicsList::AddExtraBuilders(G4bool flagHP)
188 {
189  fNhadcomp = 5;
190  fHadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
191  if(flagHP) {
192  fHadronPhys.push_back( new G4HadronElasticPhysicsHP(verboseLevel));
193  } else {
194  fHadronPhys.push_back( new G4HadronElasticPhysics(verboseLevel));
195  }
196  fHadronPhys.push_back( new G4StoppingPhysics(verboseLevel));
197  fHadronPhys.push_back( new G4IonBinaryCascadePhysics(verboseLevel));
198  fHadronPhys.push_back( new G4NeutronTrackingCut(verboseLevel));
199 }
200 
201 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
202 
204 {
205  SetCutValue(fCutForGamma, "gamma");
206  SetCutValue(fCutForElectron, "e-");
207  SetCutValue(fCutForPositron, "e+");
208  G4cout << "world cuts are set" << G4endl;
209 
210  if( !fTargetCuts ) SetTargetCut(fCutForElectron);
211  G4Region* region = (G4RegionStore::GetInstance())->GetRegion("Target");
212  region->SetProductionCuts(fTargetCuts);
213  G4cout << "Target cuts are set" << G4endl;
214 
215  if( !fDetectorCuts ) SetDetectorCut(fCutForElectron);
216  region = (G4RegionStore::GetInstance())->GetRegion("Detector");
217  region->SetProductionCuts(fDetectorCuts);
218  G4cout << "Detector cuts are set" << G4endl;
219 
221 }
222 
223 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
224 
226 {
227  fCutForGamma = cut;
228  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
229 }
230 
231 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
232 
234 {
235  fCutForElectron = cut;
236  SetParticleCuts(fCutForElectron, G4Electron::Electron());
237 }
238 
239 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
240 
242 {
243  fCutForPositron = cut;
244  SetParticleCuts(fCutForPositron, G4Positron::Positron());
245 }
246 
247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
248 
250 {
251  if( !fTargetCuts ) fTargetCuts = new G4ProductionCuts();
252 
253  fTargetCuts->SetProductionCut(cut, idxG4GammaCut);
254  fTargetCuts->SetProductionCut(cut, idxG4ElectronCut);
255  fTargetCuts->SetProductionCut(cut, idxG4PositronCut);
256 
257 }
258 
259 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
260 
262 {
263  if( !fDetectorCuts ) fDetectorCuts = new G4ProductionCuts();
264 
265  fDetectorCuts->SetProductionCut(cut, idxG4GammaCut);
266  fDetectorCuts->SetProductionCut(cut, idxG4ElectronCut);
267  fDetectorCuts->SetProductionCut(cut, idxG4PositronCut);
268 }
269 
270 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4LossTableManager * Instance()
void SetCutValue(G4double aCut, const G4String &pname)
virtual void SetCuts()
Definition of the exrdmPhysListHadron class.
const XML_Char * name
Definition: expat.h:151
void SetProductionCut(G4double cut, G4int index=-1)
virtual ~exrdmPhysicsList()
int G4int
Definition: G4Types.hh:78
void SetTargetCut(G4double val)
static G4RegionStore * GetInstance()
virtual void ConstructParticle()=0
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
Definition of the exrdmPhysListParticles class.
void SetCutForElectron(G4double)
bool G4bool
Definition: G4Types.hh:79
virtual void ConstructParticle()
Definition of the exrdmPhysicsListMessenger class.
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void SetDetectorCut(G4double val)
static G4Positron * Positron()
Definition: G4Positron.cc:94
void SetCutForGamma(G4double)
virtual void ConstructProcess()
Definition of the exrdmPhysicsList class.
void SetCutForPositron(G4double)
virtual void ConstructProcess()=0
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
void SetProductionCuts(G4ProductionCuts *cut)
double G4double
Definition: G4Types.hh:76
void SelectPhysicsList(const G4String &name)