Geant4_10
G4EmProcessOptions.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: G4EmProcessOptions.cc 74376 2013-10-04 08:25:47Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 Class file
31 //
32 //
33 // File name: G4EmProcessOptions
34 //
35 // Author: Vladimir Ivanchenko
36 //
37 // Creation date: 27.02.2004
38 //
39 // Modifications:
40 // 30-06-04 G4EmProcess is pure discrete (V.Ivanchenko)
41 // 24-03-05 Add ApplyCuts and RandomStep (V.Ivanchenko)
42 // 10-01-06 PreciseRange -> CSDARange (V.Ivantchenko)
43 // 10-05-06 Add command MscStepLimit to G4LossTableManager (V.Ivantchenko)
44 // 22-05-06 Add SetBremsstrahlungTh (V.Ivanchenko)
45 // 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko)
46 // 30-05-12 Add biasing for G4VEmProcess (D. Sawkey)
47 //
48 // Class Description:
49 //
50 // -------------------------------------------------------------------
51 //
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
54 
55 #include "G4EmProcessOptions.hh"
56 #include "G4SystemOfUnits.hh"
57 #include "G4LossTableManager.hh"
58 #include "G4VEmProcess.hh"
59 #include "G4VEnergyLossProcess.hh"
60 #include "G4VMultipleScattering.hh"
61 #include "G4Region.hh"
62 #include "G4RegionStore.hh"
63 #include "G4VAtomDeexcitation.hh"
64 #include "G4Threading.hh"
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
67 
69 {
70  theManager = G4LossTableManager::Instance();
71 }
72 
73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
74 
76 {
77 }
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
80 
82 {
83  theManager->SetLossFluctuations(val);
84 }
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
87 
89 {
90  theManager->SetSubCutoff(val, r);
91 }
92 
93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
94 
96 {
97  theManager->SetIntegral(val);
98 }
99 
100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
101 
103 {
104  theManager->SetMinSubRange(val);
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
108 
110 {
111  theManager->SetMinEnergy(val);
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
115 
117 {
118  theManager->SetMaxEnergy(val);
119 }
120 
121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
122 
124 {
125  theManager->SetMaxEnergyForCSDARange(val);
126 }
127 
128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
129 
131 {
132  theManager->SetMaxEnergyForMuons(val);
133 }
134 
135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
136 
138 {
139  theManager->SetDEDXBinning(val);
140 }
141 
142 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
143 
145 {
146  theManager->SetDEDXBinningForCSDARange(val);
147 }
148 
149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
150 
152 {
153  theManager->SetLambdaBinning(val);
154 }
155 
156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
157 
159 {
160  theManager->SetStepFunction(v1, v2);
161 }
162 
163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
164 
166 {
167  theManager->SetRandomStep(val);
168 }
169 
170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
171 
173 {
174  const std::vector<G4VEmProcess*>& w =
175  theManager->GetEmProcessVector();
176  std::vector<G4VEmProcess*>::const_iterator itp;
177  for(itp = w.begin(); itp != w.end(); itp++) {
178  G4VEmProcess* q = *itp;
179  if(q) { q->SetApplyCuts(val); }
180  }
181 }
182 
183 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
184 
186 {
187  theManager->SetBuildCSDARange(val);
188 }
189 
190 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
191 
193  G4bool worker)
194 {
195  G4bool all = false;
196  if("all" == name) { all = true; }
197 
198  if(worker && !G4Threading::IsWorkerThread()) { return; }
199 
200  if(all) {
201  theManager->SetVerbose(val);
202  return;
203  }
204 
205  const std::vector<G4VEnergyLossProcess*>& v =
206  theManager->GetEnergyLossProcessVector();
207  std::vector<G4VEnergyLossProcess*>::const_iterator itr;
208  for(itr = v.begin(); itr != v.end(); ++itr) {
209  G4VEnergyLossProcess* p = *itr;
210  if(p) {
211  if (p->GetProcessName() == name) { p->SetVerboseLevel(val); }
212  }
213  }
214  const std::vector<G4VEmProcess*>& w =
215  theManager->GetEmProcessVector();
216  std::vector<G4VEmProcess*>::const_iterator itp;
217  for(itp = w.begin(); itp != w.end(); itp++) {
218  G4VEmProcess* q = *itp;
219  if(q) {
220  if (q->GetProcessName() == name) { q->SetVerboseLevel(val); }
221  }
222  }
223  const std::vector<G4VMultipleScattering*>& u =
224  theManager->GetMultipleScatteringVector();
225  std::vector<G4VMultipleScattering*>::const_iterator itm;
226  for(itm = u.begin(); itm != u.end(); itm++) {
227  G4VMultipleScattering* msc = *itm;
228  if(s) {
229  if (msc->GetProcessName() == name) { msc->SetVerboseLevel(val); }
230  }
231  }
232 }
233 
234 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
235 
237 {
238  const std::vector<G4VEnergyLossProcess*>& v =
239  theManager->GetEnergyLossProcessVector();
240  std::vector<G4VEnergyLossProcess*>::const_iterator itr;
241  for(itr = v.begin(); itr != v.end(); itr++) {
242  G4VEnergyLossProcess* p = *itr;
243  if(p) { p->SetLambdaFactor(val); }
244  }
245 }
246 
247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
248 
249 void
251  G4bool valDeexcitation,
252  G4bool valAuger,
253  G4bool valPIXE)
254 {
255  G4VAtomDeexcitation* ad = theManager-> AtomDeexcitation();
256  if(ad) {
257  ad->SetDeexcitationActiveRegion(rname, valDeexcitation,
258  valAuger,valPIXE);
259  }
260 }
261 
262 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
263 
265 {
266  G4VAtomDeexcitation* ad = theManager-> AtomDeexcitation();
267  if(ad) { ad->SetFluo(val); }
268 }
269 
270 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
271 
273 {
274  G4VAtomDeexcitation* ad = theManager-> AtomDeexcitation();
275  if(ad) { ad->SetAuger(val); }
276 }
277 
278 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
279 
281 {
282  G4VAtomDeexcitation* ad = theManager-> AtomDeexcitation();
283  if(ad) { ad->SetPIXE(val); }
284 }
285 
286 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
287 
289 {
290  G4VAtomDeexcitation* ad = theManager-> AtomDeexcitation();
291  if(ad) { ad->SetPIXECrossSectionModel(mname); }
292 }
293 
294 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
295 
296 void
298 {
299  G4VAtomDeexcitation* ad = theManager-> AtomDeexcitation();
300  if(ad) { ad->SetPIXEElectronCrossSectionModel(mname); }
301 }
302 
303 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
304 
306 {
307  const std::vector<G4VMultipleScattering*>& u =
308  theManager->GetMultipleScatteringVector();
309  std::vector<G4VMultipleScattering*>::const_iterator itm;
310  for(itm = u.begin(); itm != u.end(); itm++) {
311  if(*itm) (*itm)->SetStepLimitType(val);
312  }
313 }
314 
315 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
316 
318 {
319  const std::vector<G4VMultipleScattering*>& u =
320  theManager->GetMultipleScatteringVector();
321  std::vector<G4VMultipleScattering*>::const_iterator itm;
322  for(itm = u.begin(); itm != u.end(); itm++) {
323  if(*itm) { (*itm)->SetLateralDisplasmentFlag(val); }
324  }
325 }
326 
327 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
328 
330 {
331  if(val < 0.0) return;
332  const std::vector<G4VMultipleScattering*>& u =
333  theManager->GetMultipleScatteringVector();
334  std::vector<G4VMultipleScattering*>::const_iterator itm;
335  for(itm = u.begin(); itm != u.end(); itm++) {
336  if(*itm) { (*itm)->SetSkin(val); }
337  }
338 }
339 
340 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
341 
343 {
344  if(val < 0.0) return;
345  const std::vector<G4VMultipleScattering*>& u =
346  theManager->GetMultipleScatteringVector();
347  std::vector<G4VMultipleScattering*>::const_iterator itm;
348  for(itm = u.begin(); itm != u.end(); itm++) {
349  if(*itm) { (*itm)->SetRangeFactor(val); }
350  }
351 }
352 
353 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
354 
356 {
357  if(val < 0.0) { return; }
358  const std::vector<G4VMultipleScattering*>& u =
359  theManager->GetMultipleScatteringVector();
360  std::vector<G4VMultipleScattering*>::const_iterator itm;
361  for(itm = u.begin(); itm != u.end(); itm++) {
362  if(*itm) { (*itm)->SetGeomFactor(val); }
363  }
364 }
365 
366 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
367 
369 {
370  const std::vector<G4VMultipleScattering*>& u =
371  theManager->GetMultipleScatteringVector();
372  std::vector<G4VMultipleScattering*>::const_iterator itm;
373  for(itm = u.begin(); itm != u.end(); itm++) {
374  if(*itm) { (*itm)->SetPolarAngleLimit(val); }
375  }
376  const std::vector<G4VEmProcess*>& w =
377  theManager->GetEmProcessVector();
378  std::vector<G4VEmProcess*>::const_iterator itp;
379  for(itp = w.begin(); itp != w.end(); itp++) {
380  G4VEmProcess* q = *itp;
381  if(q) { q->SetPolarAngleLimit(val); }
382  }
383 }
384 
385 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
386 
388 {
389  theManager->SetFactorForAngleLimit(val);
390 }
391 
392 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
393 
395 {
396  theManager->SetLPMFlag(val);
397 }
398 
399 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
400 
402 {
403  theManager->SetSplineFlag(val);
404 }
405 
406 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
407 
409 {
410  theManager->SetLinearLossLimit(val);
411 }
412 
413 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
414 
416 {
417  theManager->SetBremsstrahlungTh(val);
418 }
419 
420 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
421 
422 void
424  G4bool flag)
425 {
426  const std::vector<G4VEnergyLossProcess*>& v =
427  theManager->GetEnergyLossProcessVector();
428  std::vector<G4VEnergyLossProcess*>::const_iterator itr;
429  for(itr = v.begin(); itr != v.end(); ++itr) {
430  G4VEnergyLossProcess* p = *itr;
431  if(p) {
432  if (p->GetProcessName() == name) {
433  p->SetCrossSectionBiasingFactor(val, flag);
434  }
435  }
436  }
437  const std::vector<G4VEmProcess*>& w =
438  theManager->GetEmProcessVector();
439  std::vector<G4VEmProcess*>::const_iterator itp;
440  for(itp = w.begin(); itp != w.end(); itp++) {
441  G4VEmProcess* q = *itp;
442  if(q) {
443  if (q->GetProcessName() == name) {
444  q->SetCrossSectionBiasingFactor(val, flag);
445  }
446  }
447  }
448 }
449 
450 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
451 
452 void
454  G4double length,
455  const G4String& region,
456  G4bool flag)
457 {
458  const std::vector<G4VEnergyLossProcess*>& v =
459  theManager->GetEnergyLossProcessVector();
460  std::vector<G4VEnergyLossProcess*>::const_iterator itr;
461  for(itr = v.begin(); itr != v.end(); ++itr) {
462  G4VEnergyLossProcess* p = *itr;
463  if(p) {
464  if (p->GetProcessName() == name) {
465  p->ActivateForcedInteraction(length,region,flag);
466  }
467  }
468  }
469  const std::vector<G4VEmProcess*>& w =
470  theManager->GetEmProcessVector();
471  std::vector<G4VEmProcess*>::const_iterator itp;
472  for(itp = w.begin(); itp != w.end(); itp++) {
473  G4VEmProcess* q = *itp;
474  if(q) {
475  if (q->GetProcessName() == name) {
476  q->ActivateForcedInteraction(length,region,flag);
477  }
478  }
479  }
480 }
481 
482 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
483 
484 void
486  const G4String& region,
487  G4double factor,
488  G4double energyLimit)
489 {
490  if(0.0 > factor) { return; }
491  const std::vector<G4VEnergyLossProcess*>& v =
492  theManager->GetEnergyLossProcessVector();
493  std::vector<G4VEnergyLossProcess*>::const_iterator itr;
494  for(itr = v.begin(); itr != v.end(); ++itr) {
495  G4VEnergyLossProcess* p = *itr;
496  if(p) {
497  if (p->GetProcessName() == name) {
498  p->ActivateSecondaryBiasing(region, factor, energyLimit);
499  }
500  }
501  }
502 }
503 
504 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
505 
506 void
508  const G4String& region,
509  G4double factor,
510  G4double energyLimit)
511 {
512  if(0.0 > factor) { return; }
513  const std::vector<G4VEmProcess*>& v =
514  theManager->GetEmProcessVector();
515  std::vector<G4VEmProcess*>::const_iterator itr;
516  for(itr = v.begin(); itr != v.end(); ++itr) {
517  G4VEmProcess* p = *itr;
518  if(p) {
519  if (p->GetProcessName() == name) {
520  p->ActivateSecondaryBiasing(region, factor, energyLimit);
521  }
522  }
523  }
524 }
525 
526 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
527 
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="", G4bool flag=true)
void SetRandomStep(G4bool val)
void SetSkin(G4double val)
void SetMaxEnergyForMuons(G4double val)
void SetLambdaFactor(G4double val)
void SetPIXEElectronCrossSectionModel(const G4String &)
static G4LossTableManager * Instance()
void SetPIXE(G4bool val)
void SetBremsstrahlungTh(G4double val)
void SetSplineFlag(G4bool val)
const XML_Char * s
Definition: expat.h:262
void SetLambdaBinning(G4int val)
const char * p
Definition: xmltok.h:285
void ActivateForcedInteraction(G4double length=0.0, const G4String &region="", G4bool flag=true)
void SetMinEnergy(G4double val)
void SetDeexcitationActiveRegion(const G4String &rname, G4bool valDeexcitation, G4bool valAuger, G4bool valPIXE)
void SetPIXECrossSectionModel(const G4String &)
void SetMscGeomFactor(G4double val)
const XML_Char * name
Definition: expat.h:151
void SetStepFunction(G4double v1, G4double v2)
void SetFactorForAngleLimit(G4double val)
void ActivateSecondaryBiasingForGamma(const G4String &name, const G4String &region, G4double factor, G4double energyLimit)
void ActivateSecondaryBiasing(const G4String &region, G4double factor, G4double energyLimit)
void SetDEDXBinningForCSDARange(G4int val)
const std::vector< G4VEmProcess * > & GetEmProcessVector()
void SetMscLateralDisplacement(G4bool val)
int G4int
Definition: G4Types.hh:78
void SetApplyCuts(G4bool val)
void SetMaxEnergyForCSDARange(G4double val)
void ActivateSecondaryBiasing(const G4String &region, G4double factor, G4double energyLimit)
void SetFluo(G4bool val)
void SetMinSubRange(G4double val)
void SetBuildCSDARange(G4bool val)
void SetAuger(G4bool val)
void SetCrossSectionBiasingFactor(G4double f, G4bool flag=true)
void SetDEDXBinning(G4int val)
void SetCrossSectionBiasingFactor(G4double f, G4bool flag=true)
void SetLambdaBinning(G4int val)
void SetLPMFlag(G4bool val)
void SetBremsstrahlungTh(G4double val)
bool G4bool
Definition: G4Types.hh:79
void SetLossFluctuations(G4bool val)
void SetMaxEnergyForCSDARange(G4double val)
void SetDEDXBinningForCSDARange(G4int val)
void SetLinearLossLimit(G4double val)
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const std::vector< G4VEnergyLossProcess * > & GetEnergyLossProcessVector()
void SetSubCutoff(G4bool val, const G4Region *r=0)
tuple v
Definition: test.py:18
void SetMaxEnergy(G4double val)
G4bool IsWorkerThread()
Definition: G4Threading.cc:104
void SetMinSubRange(G4double val)
void SetMinEnergy(G4double val)
void SetMaxEnergy(G4double val)
jump r
Definition: plot.C:36
void SetStepFunction(G4double v1, G4double v2)
void SetDeexcitationActiveRegion(const G4String &rname="", G4bool valDeexcitation=true, G4bool valAuger=true, G4bool valPIXE=true)
void SetFactorForAngleLimit(G4double val)
void SetLinearLossLimit(G4double val)
G4MscStepLimitType
void ActivateSecondaryBiasing(const G4String &name, const G4String &region, G4double factor, G4double energyLimit)
void ActivateForcedInteraction(const G4String &name, G4double length=0.0, const G4String &region="", G4bool flag=true)
void SetPIXECrossSectionModel(const G4String &val)
void SetBuildCSDARange(G4bool val)
void SetIntegral(G4bool val)
void SetVerbose(G4int val)
void SetDEDXBinning(G4int val)
void SetMaxEnergyForMuons(G4double val)
void SetIntegral(G4bool val)
void SetLossFluctuations(G4bool val)
void SetMscStepLimitation(G4MscStepLimitType val)
void SetRandomStep(G4bool val)
void SetLambdaFactor(G4double val)
double G4double
Definition: G4Types.hh:76
void SetMscRangeFactor(G4double val)
void SetSubCutoff(G4bool val, const G4Region *r=0)
void SetLPMFlag(G4bool val)
void SetPolarAngleLimit(G4double a)
void SetSplineFlag(G4bool val)
void SetProcessBiasingFactor(const G4String &name, G4double val, G4bool flag=true)
void SetPIXEElectronCrossSectionModel(const G4String &val)
const std::vector< G4VMultipleScattering * > & GetMultipleScatteringVector()
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437
void SetApplyCuts(G4bool val)
void SetVerbose(G4int val, const G4String &name="all", G4bool worker=false)
void SetPolarAngleLimit(G4double val)