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: G4EmProcessOptions.cc,v 1.28 2010/04/27 16:59:52 vnivanch Exp $ |
---|
27 | // GEANT4 tag $Name: geant4-09-04-beta-01 $ |
---|
28 | // |
---|
29 | // ------------------------------------------------------------------- |
---|
30 | // |
---|
31 | // GEANT4 Class file |
---|
32 | // |
---|
33 | // |
---|
34 | // File name: G4EmProcessOptions |
---|
35 | // |
---|
36 | // Author: Vladimir Ivanchenko |
---|
37 | // |
---|
38 | // Creation date: 27.02.2004 |
---|
39 | // |
---|
40 | // Modifications: |
---|
41 | // 30-06-04 G4EmProcess is pure discrete (V.Ivanchenko) |
---|
42 | // 24-03-05 Add ApplyCuts and RandomStep (V.Ivanchenko) |
---|
43 | // 10-01-06 PreciseRange -> CSDARange (V.Ivantchenko) |
---|
44 | // 10-05-06 Add command MscStepLimit to G4LossTableManager (V.Ivantchenko) |
---|
45 | // 22-05-06 Add SetBremsstrahlungTh (V.Ivanchenko) |
---|
46 | // 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko) |
---|
47 | // |
---|
48 | // Class Description: |
---|
49 | // |
---|
50 | // ------------------------------------------------------------------- |
---|
51 | // |
---|
52 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
53 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
54 | |
---|
55 | #include "G4EmProcessOptions.hh" |
---|
56 | #include "G4LossTableManager.hh" |
---|
57 | #include "G4VEmProcess.hh" |
---|
58 | #include "G4VEnergyLossProcess.hh" |
---|
59 | #include "G4VMultipleScattering.hh" |
---|
60 | #include "G4Region.hh" |
---|
61 | #include "G4RegionStore.hh" |
---|
62 | |
---|
63 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
64 | |
---|
65 | G4EmProcessOptions::G4EmProcessOptions() |
---|
66 | { |
---|
67 | theManager = G4LossTableManager::Instance(); |
---|
68 | } |
---|
69 | |
---|
70 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
71 | |
---|
72 | G4EmProcessOptions::~G4EmProcessOptions() |
---|
73 | { |
---|
74 | } |
---|
75 | |
---|
76 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
77 | |
---|
78 | void G4EmProcessOptions::SetLossFluctuations(G4bool val) |
---|
79 | { |
---|
80 | theManager->SetLossFluctuations(val); |
---|
81 | } |
---|
82 | |
---|
83 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
84 | |
---|
85 | void G4EmProcessOptions::SetSubCutoff(G4bool val, const G4Region* r) |
---|
86 | { |
---|
87 | theManager->SetSubCutoff(val, r); |
---|
88 | } |
---|
89 | |
---|
90 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
91 | |
---|
92 | void G4EmProcessOptions::SetIntegral(G4bool val) |
---|
93 | { |
---|
94 | theManager->SetIntegral(val); |
---|
95 | } |
---|
96 | |
---|
97 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
98 | |
---|
99 | void G4EmProcessOptions::SetMinSubRange(G4double val) |
---|
100 | { |
---|
101 | theManager->SetMinSubRange(val); |
---|
102 | } |
---|
103 | |
---|
104 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
105 | |
---|
106 | void G4EmProcessOptions::SetMinEnergy(G4double val) |
---|
107 | { |
---|
108 | theManager->SetMinEnergy(val); |
---|
109 | } |
---|
110 | |
---|
111 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
112 | |
---|
113 | void G4EmProcessOptions::SetMaxEnergy(G4double val) |
---|
114 | { |
---|
115 | theManager->SetMaxEnergy(val); |
---|
116 | } |
---|
117 | |
---|
118 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
119 | |
---|
120 | void G4EmProcessOptions::SetMaxEnergyForCSDARange(G4double val) |
---|
121 | { |
---|
122 | theManager->SetMaxEnergyForCSDARange(val); |
---|
123 | } |
---|
124 | |
---|
125 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
126 | |
---|
127 | void G4EmProcessOptions::SetMaxEnergyForMuons(G4double val) |
---|
128 | { |
---|
129 | theManager->SetMaxEnergyForMuons(val); |
---|
130 | } |
---|
131 | |
---|
132 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
133 | |
---|
134 | void G4EmProcessOptions::SetDEDXBinning(G4int val) |
---|
135 | { |
---|
136 | theManager->SetDEDXBinning(val); |
---|
137 | } |
---|
138 | |
---|
139 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
140 | |
---|
141 | void G4EmProcessOptions::SetDEDXBinningForCSDARange(G4int val) |
---|
142 | { |
---|
143 | theManager->SetDEDXBinningForCSDARange(val); |
---|
144 | } |
---|
145 | |
---|
146 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
147 | |
---|
148 | void G4EmProcessOptions::SetLambdaBinning(G4int val) |
---|
149 | { |
---|
150 | theManager->SetLambdaBinning(val); |
---|
151 | } |
---|
152 | |
---|
153 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
154 | |
---|
155 | void G4EmProcessOptions::SetStepFunction(G4double v1, G4double v2) |
---|
156 | { |
---|
157 | theManager->SetStepFunction(v1, v2); |
---|
158 | } |
---|
159 | |
---|
160 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
161 | |
---|
162 | void G4EmProcessOptions::SetRandomStep(G4bool val) |
---|
163 | { |
---|
164 | theManager->SetRandomStep(val); |
---|
165 | } |
---|
166 | |
---|
167 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
168 | |
---|
169 | void G4EmProcessOptions::SetApplyCuts(G4bool val) |
---|
170 | { |
---|
171 | const std::vector<G4VEmProcess*>& w = |
---|
172 | theManager->GetEmProcessVector(); |
---|
173 | std::vector<G4VEmProcess*>::const_iterator itp; |
---|
174 | for(itp = w.begin(); itp != w.end(); itp++) { |
---|
175 | G4VEmProcess* q = *itp; |
---|
176 | if(q) { q->SetApplyCuts(val); } |
---|
177 | } |
---|
178 | } |
---|
179 | |
---|
180 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
181 | |
---|
182 | void G4EmProcessOptions::SetBuildCSDARange(G4bool val) |
---|
183 | { |
---|
184 | theManager->SetBuildCSDARange(val); |
---|
185 | } |
---|
186 | |
---|
187 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
188 | |
---|
189 | void G4EmProcessOptions::SetVerbose(G4int val, const G4String& name) |
---|
190 | { |
---|
191 | G4bool all = false; |
---|
192 | if("all" == name) { all = true; } |
---|
193 | const std::vector<G4VEnergyLossProcess*>& v = |
---|
194 | theManager->GetEnergyLossProcessVector(); |
---|
195 | |
---|
196 | if(all) { |
---|
197 | theManager->SetVerbose(val); |
---|
198 | return; |
---|
199 | } |
---|
200 | |
---|
201 | std::vector<G4VEnergyLossProcess*>::const_iterator itr; |
---|
202 | for(itr = v.begin(); itr != v.end(); ++itr) { |
---|
203 | G4VEnergyLossProcess* p = *itr; |
---|
204 | if(p) { |
---|
205 | if (p->GetProcessName() == name) { p->SetVerboseLevel(val); } |
---|
206 | } |
---|
207 | } |
---|
208 | const std::vector<G4VEmProcess*>& w = |
---|
209 | theManager->GetEmProcessVector(); |
---|
210 | std::vector<G4VEmProcess*>::const_iterator itp; |
---|
211 | for(itp = w.begin(); itp != w.end(); itp++) { |
---|
212 | G4VEmProcess* q = *itp; |
---|
213 | if(q) { |
---|
214 | if (q->GetProcessName() == name) { q->SetVerboseLevel(val); } |
---|
215 | } |
---|
216 | } |
---|
217 | const std::vector<G4VMultipleScattering*>& u = |
---|
218 | theManager->GetMultipleScatteringVector(); |
---|
219 | std::vector<G4VMultipleScattering*>::const_iterator itm; |
---|
220 | for(itm = u.begin(); itm != u.end(); itm++) { |
---|
221 | G4VMultipleScattering* s = *itm; |
---|
222 | if(s) { |
---|
223 | if (s->GetProcessName() == name) { s->SetVerboseLevel(val); } |
---|
224 | } |
---|
225 | } |
---|
226 | } |
---|
227 | |
---|
228 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
229 | |
---|
230 | void G4EmProcessOptions::SetLambdaFactor(G4double val) |
---|
231 | { |
---|
232 | const std::vector<G4VEnergyLossProcess*>& v = |
---|
233 | theManager->GetEnergyLossProcessVector(); |
---|
234 | std::vector<G4VEnergyLossProcess*>::const_iterator itr; |
---|
235 | for(itr = v.begin(); itr != v.end(); itr++) { |
---|
236 | G4VEnergyLossProcess* p = *itr; |
---|
237 | if(p) { p->SetLambdaFactor(val); } |
---|
238 | } |
---|
239 | } |
---|
240 | |
---|
241 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
242 | |
---|
243 | void G4EmProcessOptions::ActivateDeexcitation(const G4String& pname, |
---|
244 | G4bool val, |
---|
245 | const G4String& reg) |
---|
246 | { |
---|
247 | G4RegionStore* regionStore = G4RegionStore::GetInstance(); |
---|
248 | const G4Region* r = 0; |
---|
249 | if(reg == "" || reg == "World") { |
---|
250 | r = regionStore->GetRegion("DefaultRegionForTheWorld", false); |
---|
251 | } else { |
---|
252 | r = regionStore->GetRegion(reg, false); |
---|
253 | } |
---|
254 | if(!r) { |
---|
255 | G4cout << "G4EmProcessOptions::ActivateDeexcitation ERROR: G4Region <" |
---|
256 | << reg << "> not found, the command ignored" << G4endl; |
---|
257 | return; |
---|
258 | } |
---|
259 | |
---|
260 | const std::vector<G4VEnergyLossProcess*>& v = |
---|
261 | theManager->GetEnergyLossProcessVector(); |
---|
262 | std::vector<G4VEnergyLossProcess*>::const_iterator itr; |
---|
263 | for(itr = v.begin(); itr != v.end(); itr++) { |
---|
264 | G4VEnergyLossProcess* p = *itr; |
---|
265 | if(p) { |
---|
266 | if(pname == p->GetProcessName()) { p->ActivateDeexcitation(val,r); } |
---|
267 | } |
---|
268 | } |
---|
269 | const std::vector<G4VEmProcess*>& w = |
---|
270 | theManager->GetEmProcessVector(); |
---|
271 | std::vector<G4VEmProcess*>::const_iterator itp; |
---|
272 | for(itp = w.begin(); itp != w.end(); itp++) { |
---|
273 | G4VEmProcess* q = *itp; |
---|
274 | if(q) { |
---|
275 | if(pname == q->GetProcessName()) { q->ActivateDeexcitation(val,r); } |
---|
276 | } |
---|
277 | } |
---|
278 | } |
---|
279 | |
---|
280 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
281 | |
---|
282 | void G4EmProcessOptions::SetMscStepLimitation(G4MscStepLimitType val) |
---|
283 | { |
---|
284 | const std::vector<G4VMultipleScattering*>& u = |
---|
285 | theManager->GetMultipleScatteringVector(); |
---|
286 | std::vector<G4VMultipleScattering*>::const_iterator itm; |
---|
287 | for(itm = u.begin(); itm != u.end(); itm++) { |
---|
288 | if(*itm) (*itm)->SetStepLimitType(val); |
---|
289 | } |
---|
290 | } |
---|
291 | |
---|
292 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
293 | |
---|
294 | void G4EmProcessOptions::SetMscLateralDisplacement(G4bool val) |
---|
295 | { |
---|
296 | const std::vector<G4VMultipleScattering*>& u = |
---|
297 | theManager->GetMultipleScatteringVector(); |
---|
298 | std::vector<G4VMultipleScattering*>::const_iterator itm; |
---|
299 | for(itm = u.begin(); itm != u.end(); itm++) { |
---|
300 | if(*itm) { (*itm)->SetLateralDisplasmentFlag(val); } |
---|
301 | } |
---|
302 | } |
---|
303 | |
---|
304 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
305 | |
---|
306 | void G4EmProcessOptions::SetSkin(G4double val) |
---|
307 | { |
---|
308 | if(val < 0.0) return; |
---|
309 | const std::vector<G4VMultipleScattering*>& u = |
---|
310 | theManager->GetMultipleScatteringVector(); |
---|
311 | std::vector<G4VMultipleScattering*>::const_iterator itm; |
---|
312 | for(itm = u.begin(); itm != u.end(); itm++) { |
---|
313 | if(*itm) { (*itm)->SetSkin(val); } |
---|
314 | } |
---|
315 | } |
---|
316 | |
---|
317 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
318 | |
---|
319 | void G4EmProcessOptions::SetMscRangeFactor(G4double val) |
---|
320 | { |
---|
321 | if(val < 0.0) return; |
---|
322 | const std::vector<G4VMultipleScattering*>& u = |
---|
323 | theManager->GetMultipleScatteringVector(); |
---|
324 | std::vector<G4VMultipleScattering*>::const_iterator itm; |
---|
325 | for(itm = u.begin(); itm != u.end(); itm++) { |
---|
326 | if(*itm) { (*itm)->SetRangeFactor(val); } |
---|
327 | } |
---|
328 | } |
---|
329 | |
---|
330 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
331 | |
---|
332 | void G4EmProcessOptions::SetMscGeomFactor(G4double val) |
---|
333 | { |
---|
334 | if(val < 0.0) { return; } |
---|
335 | const std::vector<G4VMultipleScattering*>& u = |
---|
336 | theManager->GetMultipleScatteringVector(); |
---|
337 | std::vector<G4VMultipleScattering*>::const_iterator itm; |
---|
338 | for(itm = u.begin(); itm != u.end(); itm++) { |
---|
339 | if(*itm) { (*itm)->SetGeomFactor(val); } |
---|
340 | } |
---|
341 | } |
---|
342 | |
---|
343 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
344 | |
---|
345 | void G4EmProcessOptions::SetPolarAngleLimit(G4double val) |
---|
346 | { |
---|
347 | const std::vector<G4VMultipleScattering*>& u = |
---|
348 | theManager->GetMultipleScatteringVector(); |
---|
349 | std::vector<G4VMultipleScattering*>::const_iterator itm; |
---|
350 | for(itm = u.begin(); itm != u.end(); itm++) { |
---|
351 | if(*itm) { (*itm)->SetPolarAngleLimit(val); } |
---|
352 | } |
---|
353 | const std::vector<G4VEmProcess*>& w = |
---|
354 | theManager->GetEmProcessVector(); |
---|
355 | std::vector<G4VEmProcess*>::const_iterator itp; |
---|
356 | for(itp = w.begin(); itp != w.end(); itp++) { |
---|
357 | G4VEmProcess* q = *itp; |
---|
358 | if(q) { q->SetPolarAngleLimit(val); } |
---|
359 | } |
---|
360 | } |
---|
361 | |
---|
362 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
363 | |
---|
364 | void G4EmProcessOptions::SetFactorForAngleLimit(G4double val) |
---|
365 | { |
---|
366 | theManager->SetFactorForAngleLimit(val); |
---|
367 | } |
---|
368 | |
---|
369 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
370 | |
---|
371 | void G4EmProcessOptions::SetLPMFlag(G4bool val) |
---|
372 | { |
---|
373 | theManager->SetLPMFlag(val); |
---|
374 | } |
---|
375 | |
---|
376 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
377 | |
---|
378 | void G4EmProcessOptions::SetSplineFlag(G4bool val) |
---|
379 | { |
---|
380 | theManager->SetSplineFlag(val); |
---|
381 | } |
---|
382 | |
---|
383 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
384 | |
---|
385 | void G4EmProcessOptions::SetLinearLossLimit(G4double val) |
---|
386 | { |
---|
387 | theManager->SetLinearLossLimit(val); |
---|
388 | } |
---|
389 | |
---|
390 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
391 | |
---|
392 | void G4EmProcessOptions::SetBremsstrahlungTh(G4double val) |
---|
393 | { |
---|
394 | theManager->SetBremsstrahlungTh(val); |
---|
395 | } |
---|
396 | |
---|
397 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
398 | |
---|