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