source: trunk/examples/extended/medical/GammaTherapy/src/PhysicsList.cc @ 1313

Last change on this file since 1313 was 1230, checked in by garnier, 15 years ago

update to geant4.9.3

File size: 9.2 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// $Id: PhysicsList.cc,v 1.16 2008/06/11 15:17:57 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-03-cand-01 $
28//
29//---------------------------------------------------------------------------
30//
31// ClassName:   PhysicsList
32//
33// Author:      V.Ivanchenko 03.05.2004
34//
35// Modified:
36// 16.11.06 Use components from physics_lists subdirectory (V.Ivanchenko)
37// 16.05.07 Use renamed EM components from physics_lists (V.Ivanchenko)
38//
39//----------------------------------------------------------------------------
40//
41
42//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44
45#include "PhysicsList.hh"
46#include "PhysicsListMessenger.hh"
47
48#include "ParticlesBuilder.hh"
49#include "G4EmStandardPhysics.hh"
50#include "G4EmStandardPhysics_option1.hh"
51#include "G4EmStandardPhysics_option2.hh"
52#include "G4EmStandardPhysics_option3.hh"
53#include "PhysListEmLivermore.hh"
54#include "PhysListEmPenelope.hh"
55#include "G4StepLimiterBuilder.hh"
56#include "G4DecayPhysics.hh"
57#include "G4HadronElasticPhysics.hh"
58#include "G4HadronInelasticQBBC.hh"
59#include "G4IonBinaryCascadePhysics.hh"
60#include "G4EmExtraPhysics.hh"
61#include "G4QStoppingPhysics.hh"
62//#include "PhysListEmModelPai.hh"
63
64#include "G4UnitsTable.hh"
65#include "G4LossTableManager.hh"
66#include "G4EmProcessOptions.hh"
67
68//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69
70PhysicsList::PhysicsList() 
71: G4VModularPhysicsList()
72{
73  emBuilderIsRegisted = false;
74  decayIsRegisted = false;
75  stepLimiterIsRegisted = false;
76  helIsRegisted = false;
77  bicIsRegisted = false;
78  ionIsRegisted = false;
79  gnucIsRegisted = false;
80  stopIsRegisted = false;
81  verbose = 1;
82  G4LossTableManager::Instance()->SetVerbose(1);
83  defaultCutValue = 1.*mm;
84  cutForGamma     = defaultCutValue;
85  cutForElectron  = defaultCutValue;
86  cutForPositron  = defaultCutValue;
87
88  pMessenger = new PhysicsListMessenger(this);
89
90  // Add Physics builders
91  RegisterPhysics(new ParticlesBuilder());
92}
93
94//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
95
96PhysicsList::~PhysicsList()
97{}
98
99//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
100
101void PhysicsList::ConstructParticle()
102{
103  if(verbose > 0) 
104    G4cout << "### PhysicsList Construte Particles" << G4endl;
105  G4VModularPhysicsList::ConstructParticle();
106}
107
108//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
109
110void PhysicsList::ConstructProcess()
111{
112  if(verbose > 0) 
113    G4cout << "### PhysicsList Construte Processes" << G4endl;
114  if(!emBuilderIsRegisted) AddPhysicsList("emstandard");
115  RegisterPhysics(new G4StepLimiterBuilder());
116  G4VModularPhysicsList::ConstructProcess();
117
118  // Define energy interval for loss processes
119  G4EmProcessOptions emOptions;
120  emOptions.SetMinEnergy(0.1*keV);
121  emOptions.SetMaxEnergy(100.*GeV);
122  emOptions.SetDEDXBinning(90);
123  emOptions.SetLambdaBinning(90);
124  //  emOptions.SetBuildCSDARange(false);
125  emOptions.SetApplyCuts(true);
126  //emOptions.SetVerbose(0);
127}
128
129//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
130
131void PhysicsList::AddPhysicsList(const G4String& name)
132{
133  if(verbose > 0) {
134    G4cout << "### PhysicsList Add Physics <" << name
135           << "> emBuilderIsRegisted= " << emBuilderIsRegisted
136           << G4endl;
137  }
138  if ((name == "emstandard") && !emBuilderIsRegisted) {
139    RegisterPhysics(new G4EmStandardPhysics());
140    emBuilderIsRegisted = true;
141    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;   
142
143  } else if (name == "emstandard_opt1" && !emBuilderIsRegisted) {
144    RegisterPhysics(new G4EmStandardPhysics_option1());
145    emBuilderIsRegisted = true;
146    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
147
148  } else if (name == "emstandard_opt2" && !emBuilderIsRegisted) {
149    RegisterPhysics(new G4EmStandardPhysics_option2());
150    emBuilderIsRegisted = true;
151    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
152
153  } else if (name == "emstandard_opt3" && !emBuilderIsRegisted) {
154    RegisterPhysics(new G4EmStandardPhysics_option3());
155    emBuilderIsRegisted = true;
156    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
157
158  } else if (name == "livermore" && !emBuilderIsRegisted) {
159    RegisterPhysics(new PhysListEmLivermore());
160    emBuilderIsRegisted = true;
161    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
162
163  } else if (name == "penelope" && !emBuilderIsRegisted) {
164    RegisterPhysics(new PhysListEmPenelope());
165    emBuilderIsRegisted = true;
166    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
167    /*
168  } else if (name == "pai" && !emBuilderIsRegisted) {
169    RegisterPhysics(new PhysListEmModelPai());
170    emBuilderIsRegisted = true;
171    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
172    */
173
174  } else if (name == "decay" && !decayIsRegisted && emBuilderIsRegisted) {
175    RegisterPhysics(new G4DecayPhysics());
176    decayIsRegisted = true;
177    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
178
179  } else if (name == "elastic" && !helIsRegisted && emBuilderIsRegisted) {
180    RegisterPhysics(new G4HadronElasticPhysics());
181    helIsRegisted = true;
182    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
183   
184  } else if (name == "binary" && !bicIsRegisted && emBuilderIsRegisted) {
185    RegisterPhysics(new G4HadronInelasticQBBC());
186    bicIsRegisted = true;
187    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
188   
189  } else if (name == "binary_ion" && !ionIsRegisted && emBuilderIsRegisted) {
190    RegisterPhysics(new G4IonBinaryCascadePhysics());
191    ionIsRegisted = true;
192    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
193
194  } else if (name == "gamma_nuc" && !gnucIsRegisted && emBuilderIsRegisted) {
195    RegisterPhysics(new G4EmExtraPhysics());
196    gnucIsRegisted = true;
197    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
198
199  } else if (name == "stopping" && !stopIsRegisted && emBuilderIsRegisted) {
200    RegisterPhysics(new G4QStoppingPhysics());
201    gnucIsRegisted = true;
202    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl;
203   
204  } else if(!emBuilderIsRegisted) {
205    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" 
206           << " fail - EM physics should be registered first " << G4endl;
207  } else {
208    G4cout << "PhysicsList::AddPhysicsList <" << name << ">" 
209           << " fail - module is already regitered or is unknown " << G4endl;
210  }
211}
212
213//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
214
215void PhysicsList::SetCuts()
216{
217
218  SetCutValue(cutForGamma, "gamma");
219  SetCutValue(cutForElectron, "e-");
220  SetCutValue(cutForPositron, "e+");
221
222  if (verbose>0) DumpCutValuesTable();
223}
224
225//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
226
227void PhysicsList::SetVerbose(G4int val)
228{
229  verbose = val;
230}
231
232//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
233
234void PhysicsList::SetCutForGamma(G4double cut)
235{
236  cutForGamma = cut;
237  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
238}
239
240//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
241
242void PhysicsList::SetCutForElectron(G4double cut)
243{
244  cutForElectron = cut;
245  SetParticleCuts(cutForElectron, G4Electron::Electron());
246}
247
248//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
249
250void PhysicsList::SetCutForPositron(G4double cut)
251{
252  cutForPositron = cut;
253  SetParticleCuts(cutForPositron, G4Positron::Positron());
254}
255
256//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracBrowser for help on using the repository browser.