source: trunk/examples/extended/hadronic/Hadr01/src/PhysicsList.cc

Last change on this file was 1342, checked in by garnier, 14 years ago

update ti head

  • Property svn:executable set to *
File size: 12.8 KB
Line 
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//
27// $Id: PhysicsList.cc,v 1.36 2010/10/25 16:15:08 vnivanch Exp $
28// GEANT4 tag $Name: examples-V09-03-09 $
29//
30/////////////////////////////////////////////////////////////////////////
31//
32// PhysicsList
33//
34// Created: 31.04.2006 V.Ivanchenko
35//
36// Modified:
37// 04.06.2006 Adoptation of hadr01 (V.Ivanchenko)
38// 26.04.2007 Physics according to 8.3 Physics List (V.Ivanchenko)
39//
40////////////////////////////////////////////////////////////////////////
41//
42
43#include "PhysicsList.hh"
44#include "PhysicsListMessenger.hh"
45
46#include "G4DecayPhysics.hh"
47#include "G4EmStandardPhysics.hh"
48#include "G4EmStandardPhysics_option1.hh"
49#include "G4EmStandardPhysics_option2.hh"
50#include "G4EmStandardPhysics_option3.hh"
51#include "G4EmLivermorePhysics.hh"
52#include "G4EmPenelopePhysics.hh"
53#include "G4HadronElasticPhysics.hh"
54#include "G4HadronElasticPhysicsXS.hh"
55#include "G4HadronElasticPhysics93.hh"
56#include "G4HadronElasticPhysicsHP.hh"
57#include "G4HadronElasticPhysicsLHEP.hh"
58#include "G4HadronHElasticPhysics.hh"
59#include "G4HadronQElasticPhysics.hh"
60#include "G4ChargeExchangePhysics.hh"
61#include "G4NeutronTrackingCut.hh"
62#include "G4QStoppingPhysics.hh"
63#include "G4LHEPStoppingPhysics.hh"
64#include "G4IonBinaryCascadePhysics.hh"
65#include "G4IonPhysics.hh"
66#include "G4EmExtraPhysics.hh"
67#include "G4EmProcessOptions.hh"
68
69#include "HadronPhysicsFTFP.hh"
70#include "HadronPhysicsFTFP_BERT.hh"
71#include "HadronPhysicsFTF_BIC.hh"
72#include "HadronPhysicsLHEP.hh"
73#include "HadronPhysicsLHEP_EMV.hh"
74#include "G4HadronInelasticQBBC.hh"
75#include "HadronPhysicsQGSC.hh"
76#include "HadronPhysicsQGSC_BERT.hh"
77#include "HadronPhysicsQGSP.hh"
78#include "HadronPhysicsQGSP_BERT.hh"
79#include "HadronPhysicsQGSP_BERT_HP.hh"
80#include "HadronPhysicsQGSP_BIC.hh"
81#include "HadronPhysicsQGSP_BIC_HP.hh"
82#include "HadronPhysicsQGSP_FTFP_BERT.hh"
83#include "HadronPhysicsQGS_BIC.hh"
84
85#include "G4IonPhysics.hh"
86
87#include "G4LossTableManager.hh"
88
89#include "G4ProcessManager.hh"
90#include "G4ParticleTypes.hh"
91#include "G4ParticleTable.hh"
92#include "G4Gamma.hh"
93#include "G4Electron.hh"
94#include "G4Positron.hh"
95#include "G4Proton.hh"
96
97//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
98
99PhysicsList::PhysicsList() : G4VModularPhysicsList()
100{
101  G4LossTableManager::Instance();
102  defaultCutValue = 0.7*mm;
103  cutForGamma     = defaultCutValue;
104  cutForElectron  = defaultCutValue;
105  cutForPositron  = defaultCutValue;
106  cutForProton    = defaultCutValue;
107  verboseLevel    = 1;
108
109  pMessenger = new PhysicsListMessenger(this);
110
111  // Particles
112  particleList = new G4DecayPhysics("decays");
113
114  // EM physics
115  emPhysicsList = new G4EmStandardPhysics();
116}
117
118//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
119
120PhysicsList::~PhysicsList()
121{
122  delete pMessenger;
123  delete particleList;
124  delete emPhysicsList;
125  for(size_t i=0; i<hadronPhys.size(); i++) {
126    delete hadronPhys[i];
127  }
128}
129
130//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
131
132void PhysicsList::ConstructParticle()
133{
134  particleList->ConstructParticle();
135}
136
137//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
138
139void PhysicsList::ConstructProcess()
140{
141  AddTransportation();
142  emPhysicsList->ConstructProcess();
143  particleList->ConstructProcess();
144  for(size_t i=0; i<hadronPhys.size(); i++) {
145    hadronPhys[i]->ConstructProcess();
146  }
147}
148
149//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
150
151void PhysicsList::AddPhysicsList(const G4String& name)
152{
153  if (verboseLevel>0) {
154    G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
155  }
156  if (name == "emstandard_opt2") {
157
158    delete emPhysicsList;
159    emPhysicsList = new G4EmStandardPhysics_option2();
160
161  } else if (name == "emstandard_opt3") {
162
163    delete emPhysicsList;
164    emPhysicsList = new G4EmStandardPhysics_option3();
165
166  } else if (name == "emstandard_opt1") {
167
168    delete emPhysicsList;
169    emPhysicsList = new G4EmStandardPhysics_option1();
170
171  } else if (name == "emstandard_opt0") {
172
173    delete emPhysicsList;
174    emPhysicsList = new G4EmStandardPhysics();
175
176  } else if (name == "FTFP_BERT_EMV") {
177
178    AddPhysicsList("emstandard_opt1");
179    AddPhysicsList("FTFP_BERT");
180
181  } else if (name == "FTFP_BERT_EMX") {
182
183    AddPhysicsList("emstandard_opt2");
184    AddPhysicsList("FTFP_BERT");
185
186  } else if (name == "FTFP_BERT") {
187
188    SetBuilderList1();
189    hadronPhys.push_back( new HadronPhysicsFTFP_BERT());
190
191  } else if (name == "FTF_BIC") {
192
193    SetBuilderList0();
194    hadronPhys.push_back( new HadronPhysicsFTF_BIC());
195
196  } else if (name == "LHEP") {
197
198    SetBuilderList2();
199    hadronPhys.push_back( new HadronPhysicsLHEP());
200
201  } else if (name == "LHEP_EMV") {
202
203    AddPhysicsList("emstandard_opt1");
204    SetBuilderList2(true);
205    hadronPhys.push_back( new HadronPhysicsLHEP_EMV());
206
207  } else if (name == "QBBC") {
208
209    AddPhysicsList("emstandard_opt2");
210    SetBuilderList3(name);
211    hadronPhys.push_back( new G4HadronInelasticQBBC());
212
213  } else if (name == "QBBC_XGG") {
214
215    AddPhysicsList("emstandard_opt2");
216    SetBuilderList3(name);
217    hadronPhys.push_back( new G4HadronInelasticQBBC(name,verboseLevel));
218
219  } else if (name == "QBBC_XGGSN") {
220
221    AddPhysicsList("emstandard_opt2");
222    SetBuilderList3(name);
223    hadronPhys.push_back( new G4HadronInelasticQBBC(name,verboseLevel));
224
225  } else if (name == "QGSC_BERT") {
226
227    SetBuilderList4();
228    hadronPhys.push_back( new HadronPhysicsQGSC_BERT());
229
230  } else if (name == "QGSP_BERT") {
231
232    SetBuilderList1();
233    hadronPhys.push_back( new HadronPhysicsQGSP_BERT());
234
235  } else if (name == "QGSP_FTFP_BERT") {
236
237    SetBuilderList1();
238    hadronPhys.push_back( new HadronPhysicsQGSP_FTFP_BERT());
239
240  } else if (name == "QGSP_BERT_EMV") {
241
242    AddPhysicsList("emstandard_opt1");
243    AddPhysicsList("QGSP_BERT");
244
245  } else if (name == "QGSP_BERT_EMX") {
246
247    AddPhysicsList("emstandard_opt2");
248    AddPhysicsList("QGSP_BERT");
249
250  } else if (name == "QGSP_BERT_HP") {
251
252    SetBuilderList1(true);
253    hadronPhys.push_back( new HadronPhysicsQGSP_BERT_HP());
254
255  } else if (name == "QGSP_BIC") {
256
257    SetBuilderList0();
258    hadronPhys.push_back( new HadronPhysicsQGSP_BIC());
259
260  } else if (name == "QGSP_BIC_EMY") {
261
262    AddPhysicsList("emstandard_opt3");
263    SetBuilderList0();
264    hadronPhys.push_back( new HadronPhysicsQGSP_BIC());
265
266  } else if (name == "QGS_BIC") {
267
268    SetBuilderList0();
269    hadronPhys.push_back( new HadronPhysicsQGS_BIC());
270
271  } else if (name == "QGSP_BIC_HP") {
272
273    SetBuilderList0(true);
274    hadronPhys.push_back( new HadronPhysicsQGSP_BIC_HP());
275
276  } else {
277
278    G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
279           << " is not defined"
280           << G4endl;
281  }
282}
283
284//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
285
286void PhysicsList::SetBuilderList0(G4bool flagHP)
287{
288  hadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
289  if(flagHP) {
290    hadronPhys.push_back( new G4HadronElasticPhysicsHP(verboseLevel) );
291  } else {
292    hadronPhys.push_back( new G4HadronElasticPhysics(verboseLevel) );
293  }
294  hadronPhys.push_back( new G4QStoppingPhysics(verboseLevel));
295  hadronPhys.push_back( new G4IonBinaryCascadePhysics(verboseLevel));
296  hadronPhys.push_back( new G4NeutronTrackingCut(verboseLevel));
297}
298
299//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
300
301void PhysicsList::SetBuilderList1(G4bool flagHP)
302{
303  hadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
304  if(flagHP) {
305    hadronPhys.push_back( new G4HadronElasticPhysicsHP(verboseLevel) );
306  } else {
307    hadronPhys.push_back( new G4HadronElasticPhysics(verboseLevel) );
308  }
309  hadronPhys.push_back( new G4QStoppingPhysics(verboseLevel));
310  hadronPhys.push_back( new G4IonPhysics(verboseLevel));
311  hadronPhys.push_back( new G4NeutronTrackingCut(verboseLevel));
312}
313
314//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
315
316void PhysicsList::SetBuilderList2(G4bool addStopping)
317{
318  hadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
319  hadronPhys.push_back( new G4HadronElasticPhysicsLHEP(verboseLevel));
320  if(addStopping) { hadronPhys.push_back( new G4QStoppingPhysics(verboseLevel)); }
321  hadronPhys.push_back( new G4IonPhysics(verboseLevel));
322}
323
324//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
325
326void PhysicsList::SetBuilderList3(const G4String& type)
327{
328  hadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
329  if(type == "QBBC") {
330    RegisterPhysics( new G4HadronElasticPhysicsXS(verboseLevel) );
331  } else if(type == "QBBC_XGG") {
332    RegisterPhysics( new G4HadronElasticPhysics(verboseLevel) );
333  } else if(type == "QBBC_XGGSN") {
334    RegisterPhysics( new G4HadronElasticPhysics93(verboseLevel) );
335  } else if(type == "QBBC_HP") {
336    RegisterPhysics( new G4HadronElasticPhysicsHP(verboseLevel) );
337  }
338  hadronPhys.push_back( new G4QStoppingPhysics(verboseLevel));
339  hadronPhys.push_back( new G4IonBinaryCascadePhysics(verboseLevel));
340  hadronPhys.push_back( new G4NeutronTrackingCut(verboseLevel));
341}
342
343//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
344
345void PhysicsList::SetBuilderList4()
346{
347  hadronPhys.push_back( new G4EmExtraPhysics(verboseLevel));
348  hadronPhys.push_back( new G4HadronQElasticPhysics(verboseLevel));
349  hadronPhys.push_back( new G4QStoppingPhysics(verboseLevel));
350  hadronPhys.push_back( new G4IonPhysics(verboseLevel));
351  hadronPhys.push_back( new G4NeutronTrackingCut(verboseLevel));
352}
353
354//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
355
356void PhysicsList::SetCuts()
357{
358
359  if (verboseLevel >0){
360    G4cout << "PhysicsList::SetCuts:";
361    G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
362  }
363
364  // set cut values for gamma at first and for e- second and next for e+,
365  // because some processes for e+/e- need cut values for gamma
366  SetCutValue(cutForGamma, "gamma");
367  SetCutValue(cutForElectron, "e-");
368  SetCutValue(cutForPositron, "e+");
369  SetCutValue(cutForProton, "proton");
370
371  if (verboseLevel>0) DumpCutValuesTable();
372}
373
374//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
375
376void PhysicsList::SetCutForGamma(G4double cut)
377{
378  cutForGamma = cut;
379  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
380}
381
382//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
383
384void PhysicsList::SetCutForElectron(G4double cut)
385{
386  cutForElectron = cut;
387  SetParticleCuts(cutForElectron, G4Electron::Electron());
388}
389
390//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
391
392void PhysicsList::SetCutForPositron(G4double cut)
393{
394  cutForPositron = cut;
395  SetParticleCuts(cutForPositron, G4Positron::Positron());
396}
397
398//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
399
400void PhysicsList::SetCutForProton(G4double cut)
401{
402  cutForProton = cut;
403  SetParticleCuts(cutForProton, G4Proton::Proton());
404}
405
406void PhysicsList::List()
407{
408  G4cout << "### PhysicsLists available: FTFP_BERT FTFP_BERT_EMV FTFP_BERT_EMX FTF_BIC"
409         << G4endl;
410  G4cout << "                            LHEP LHEP_EMV QBBC QBBC_XGG QBBC_XGGSN"
411         << G4endl; 
412  G4cout << "                            QGSC_BERT QGSP_BERT QGSP_BERT_EMV QGSP_BIC_EMY"
413         << G4endl; 
414  G4cout << "                            QGSP_BERT_EMX QGSP_BERT_HP QGSP_BIC QGSP_BIC_HP" 
415         << G4endl; 
416}
417
418//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
419
Note: See TracBrowser for help on using the repository browser.