Geant4  10.01.p03
G4EmParameters.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: G4EmParameters.cc 69320 2013-04-30 15:59:36Z vnivanch $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 Class file
31 //
32 //
33 // File name: G4EmParameters
34 //
35 // Author: Vladimir Ivanchenko
36 //
37 // Creation date: 18.05.2013
38 //
39 // Modifications:
40 //
41 //
42 //
43 // -------------------------------------------------------------------
44 //
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
47 
48 #include "G4EmParameters.hh"
49 #include "G4PhysicalConstants.hh"
50 #include "G4SystemOfUnits.hh"
52 #include "G4NistManager.hh"
53 
55 
56 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
57 
59 {
60  if(0 == theInstance) {
61  static G4EmParameters manager;
62  theInstance = &manager;
63  }
64  return theInstance;
65 }
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
68 
70 {
71  delete theMessenger;
72 }
73 
74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
75 
77 {
80 
81  lossFluctuation = true;
82  buildCSDARange = false;
83  flagLPM = true;
84  spline = true;
85  finalRange = false;
86  applyCuts = false;
87  fluo = false;
88  auger = false;
89  pixe = false;
90  deexIgnoreCut = false;
91  lateralDisplacement = true;
95 
97  minKinEnergy = 0.1*keV;
98  maxKinEnergy = 10.0*TeV;
99  maxKinEnergyCSDA = 1.0*GeV;
100  linLossLimit = 0.01;
101  bremsTh = DBL_MAX;
102  lambdaFactor = 0.8;
103  factorForAngleLimit = 1.0;
105  rangeFactor = 0.04;
106  geomFactor = 2.5;
107  skin = 1.0;
108 
109  nbins = 77;
110  nbinsPerDecade = 7;
111  verbose = 1;
112  workerVerbose = 0;
113 
115 }
116 
117 #include "G4AutoLock.hh"
118 namespace { G4Mutex EmParametersMutex = G4MUTEX_INITIALIZER; }
119 
121 {
122  G4AutoLock l(&EmParametersMutex);
123  lossFluctuation = val;
124 }
125 
127 {
128  return lossFluctuation;
129 }
130 
132 {
133  G4AutoLock l(&EmParametersMutex);
134  buildCSDARange = val;
135 }
136 
138 {
139  return buildCSDARange;
140 }
141 
143 {
144  G4AutoLock l(&EmParametersMutex);
145  flagLPM = val;
146 }
147 
149 {
150  return flagLPM;
151 }
152 
154 {
155  G4AutoLock l(&EmParametersMutex);
156  spline = val;
157 }
158 
160 {
161  return spline;
162 }
163 
165 {
166  G4AutoLock l(&EmParametersMutex);
167  finalRange = val;
168 }
169 
171 {
172  return finalRange;
173 }
174 
176 {
177  G4AutoLock l(&EmParametersMutex);
178  applyCuts = val;
179 }
180 
182 {
183  return applyCuts;
184 }
185 
187 {
188  G4AutoLock l(&EmParametersMutex);
189  fluo = val;
190 }
191 
193 {
194  return fluo;
195 }
196 
198 {
199  G4AutoLock l(&EmParametersMutex);
200  auger = val;
201  if(val) { fluo = true; }
202 }
203 
205 {
206  return auger;
207 }
208 
210 {
211  G4AutoLock l(&EmParametersMutex);
212  pixe = val;
213  if(val) { fluo = true; }
214 }
215 
217 {
218  return pixe;
219 }
220 
222 {
223  G4AutoLock l(&EmParametersMutex);
224  deexIgnoreCut = val;
225 }
226 
228 {
229  return deexIgnoreCut;
230 }
231 
233 {
234  G4AutoLock l(&EmParametersMutex);
235  lateralDisplacement = val;
236 }
237 
239 {
240  return lateralDisplacement;
241 }
242 
244 {
245  G4AutoLock l(&EmParametersMutex);
247 }
248 
250 {
252 }
253 
255 {
256  G4AutoLock l(&EmParametersMutex);
258 }
259 
261 {
263 }
264 
266 {
268 }
269 
271 {
273 }
274 
276 {
277  G4AutoLock l(&EmParametersMutex);
278  if(val > 0.0 && val < 1.0) {
279  minSubRange = val;
280  } else {
282  ed << "Value of MinSubRange is out of range (0 - 1): " << val
283  << " is ignored";
284  PrintWarning(ed);
285  }
286 }
287 
289 {
290  return minSubRange;
291 }
292 
294 {
295  G4AutoLock l(&EmParametersMutex);
296  if(val > 1.e-3*eV && val < maxKinEnergy) {
297  minKinEnergy = val;
299  } else {
301  ed << "Value of MinKinEnergy is out of range: " << val/MeV
302  << " MeV is ignored";
303  PrintWarning(ed);
304  }
305 }
306 
308 {
309  return minKinEnergy;
310 }
311 
313 {
314  G4AutoLock l(&EmParametersMutex);
315  if(val > minKinEnergy && val < 1.e+7*TeV) {
316  maxKinEnergy = val;
318  } else {
320  ed << "Value of MaxKinEnergy is out of range: "
321  << val/GeV << " GeV is ignored";
322  PrintWarning(ed);
323  }
324 }
325 
327 {
328  return maxKinEnergy;
329 }
330 
332 {
333  G4AutoLock l(&EmParametersMutex);
334  if(val > minKinEnergy && val <= 100*TeV) {
335  maxKinEnergyCSDA = val;
336  } else {
338  ed << "Value of MaxKinEnergyCSDA is out of range: "
339  << val/GeV << " GeV is ignored";
340  PrintWarning(ed);
341  }
342 }
343 
345 {
346  return maxKinEnergyCSDA;
347 }
348 
350 {
351  G4AutoLock l(&EmParametersMutex);
352  if(val > 0.0 && val < 0.5) {
353  linLossLimit = val;
354  } else {
356  ed << "Value of linLossLimit is out of range: " << val
357  << " is ignored";
358  PrintWarning(ed);
359  }
360 }
361 
363 {
364  return linLossLimit;
365 }
366 
368 {
369  G4AutoLock l(&EmParametersMutex);
370  if(val > 0.0) {
371  bremsTh = val;
372  } else {
374  ed << "Value of bremsstrahlung threshold is out of range: "
375  << val/GeV << " GeV is ignored";
376  PrintWarning(ed);
377  }
378 }
379 
381 {
382  return bremsTh;
383 }
384 
386 {
387  G4AutoLock l(&EmParametersMutex);
388  if(val > 0.0 && val < 1.0) {
389  lambdaFactor = val;
390  } else {
392  ed << "Value of lambda factor is out of range: " << val
393  << " is ignored";
394  PrintWarning(ed);
395  }
396 }
397 
399 {
400  return lambdaFactor;
401 }
402 
404 {
405  G4AutoLock l(&EmParametersMutex);
406  if(val > 0.0) {
407  factorForAngleLimit = val;
408  } else {
410  ed << "Value of factor for enegry limit is out of range: "
411  << val << " is ignored";
412  PrintWarning(ed);
413  }
414 }
415 
417 {
418  return factorForAngleLimit;
419 }
420 
422 {
423  G4AutoLock l(&EmParametersMutex);
424  if(val >= 0.0 && val <= pi) {
425  thetaLimit = val;
426  } else {
428  ed << "Value of polar angle limit is out of range: "
429  << val << " is ignored";
430  PrintWarning(ed);
431  }
432 }
433 
435 {
436  return thetaLimit;
437 }
438 
440 {
441  G4AutoLock l(&EmParametersMutex);
442  if(val > 0.0 && val < 1.0) {
443  rangeFactor = val;
444  } else {
446  ed << "Value of rangeFactor is out of range: "
447  << val << " is ignored";
448  PrintWarning(ed);
449  }
450 }
451 
453 {
454  return rangeFactor;
455 }
456 
458 {
459  G4AutoLock l(&EmParametersMutex);
460  if(val >= 1.0) {
461  geomFactor = val;
462  } else {
464  ed << "Value of geomFactor is out of range: "
465  << val << " is ignored";
466  PrintWarning(ed);
467  }
468 }
469 
471 {
472  return geomFactor;
473 }
474 
476 {
477  G4AutoLock l(&EmParametersMutex);
478  if(val >= 1.0) {
479  skin = val;
480  } else {
482  ed << "Value of skin is out of range: "
483  << val << " is ignored";
484  PrintWarning(ed);
485  }
486 }
487 
489 {
490  return skin;
491 }
492 
494 {
495  G4AutoLock l(&EmParametersMutex);
496  if(val >= 5 && val < 10000000) {
497  nbins = val;
499  } else {
501  ed << "Value of number of bins is out of range: "
502  << val << " is ignored";
503  PrintWarning(ed);
504  }
505 }
506 
508 {
509  return nbins;
510 }
511 
513 {
514  G4AutoLock l(&EmParametersMutex);
515  if(val >= 5 && val < 1000000) {
516  nbinsPerDecade = val;
518  } else {
520  ed << "Value of number of bins per decade is out of range: "
521  << val << " is ignored";
522  PrintWarning(ed);
523  }
524 }
525 
527 {
528  return nbinsPerDecade;
529 }
530 
532 {
533  G4AutoLock l(&EmParametersMutex);
534  verbose = val;
536 }
537 
539 {
540  return verbose;
541 }
542 
544 {
545  G4AutoLock l(&EmParametersMutex);
546  workerVerbose = val;
547 }
548 
550 {
551  return workerVerbose;
552 }
553 
555 {
556  G4AutoLock l(&EmParametersMutex);
557  mscStepLimit = val;
558 }
559 
561 {
562  return mscStepLimit;
563 }
564 
566 {
567  G4Exception("G4EmParameters", "em0044", JustWarning, ed);
568 }
569 
570 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
571 
G4bool UseCutAsFinalRange() const
static G4EmParameters * theInstance
void SetLossFluctuations(G4bool val)
G4int NumberOfBinsPerDecade() const
void SetApplyCuts(G4bool val)
G4MscStepLimitType mscStepLimit
static const double MeV
Definition: G4SIunits.hh:193
G4int NumberOfBins() const
void SetVerbose(G4int val)
G4bool Spline() const
G4int WorkerVerbose() const
G4double MaxKinEnergy() const
void SetDeexcitationIgnoreCut(G4bool val)
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
void SetLatDisplacementBeyondSafety(G4bool val)
void SetMscStepLimitType(G4MscStepLimitType val)
G4double linLossLimit
void SetLinearLossLimit(G4double val)
G4double MscGeomFactor() const
G4double MscThetaLimit() const
const G4double pi
void SetAuger(G4bool val)
G4double maxKinEnergy
G4bool muhadLateralDisplacement
void SetNumberOfBins(G4int val)
void SetMinSubRange(G4double val)
G4bool LPM() const
void SetMaxEnergyForCSDARange(G4double val)
G4bool ApplyCuts() const
G4bool Fluo() const
int G4int
Definition: G4Types.hh:78
void SetMaxEnergy(G4double val)
void SetBremsstrahlungTh(G4double val)
static G4NistManager * Instance()
#define G4MUTEX_INITIALIZER
Definition: G4Threading.hh:175
G4double MinSubRange() const
G4bool DeexcitationIgnoreCut() const
G4bool LatDisplacementBeyondSafety() const
void SetLateralDisplacement(G4bool val)
G4bool BuildCSDARange() const
void SetWorkerVerbose(G4int val)
G4bool lateralDisplacement
G4double LinearLossLimit() const
G4double LambdaFactor() const
G4int Verbose() const
G4bool MuHadLateralDisplacement() const
bool G4bool
Definition: G4Types.hh:79
void SetMscRangeFactor(G4double val)
void SetNumberOfBinsPerDecade(G4int val)
G4bool LateralDisplacement() const
G4double minSubRange
static const double GeV
Definition: G4SIunits.hh:196
void SetMscGeomFactor(G4double val)
G4double MinKinEnergy() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4double lambdaFactor
static const double eV
Definition: G4SIunits.hh:194
void SetBuildCSDARange(G4bool val)
G4int G4Mutex
Definition: G4Threading.hh:173
G4bool Auger() const
G4bool LossFluctuation() const
void SetPixe(G4bool val)
void SetSpline(G4bool val)
void SetMuHadLateralDisplacement(G4bool val)
int G4lrint(double ad)
Definition: templates.hh:163
G4double maxKinEnergyCSDA
void SetMinEnergy(G4double val)
void SetLPM(G4bool val)
G4bool UseAngularGeneratorForIonisation() const
G4MscStepLimitType
G4double BremsstrahlungTh() const
static G4EmParameters * Instance()
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double MscRangeFactor() const
void ActivateAngularGeneratorForIonisation(G4bool val)
void SetUseCutAsFinalRange(G4bool val)
G4bool latDisplacementBeyondSafety
static const double TeV
Definition: G4SIunits.hh:197
G4bool Pixe() const
G4double minKinEnergy
static const double keV
Definition: G4SIunits.hh:195
G4MscStepLimitType MscStepLimitType() const
void SetMscThetaLimit(G4double val)
void SetLambdaFactor(G4double val)
void SetFactorForAngleLimit(G4double val)
double G4double
Definition: G4Types.hh:76
G4bool useAngGeneratorForIonisation
void PrintWarning(G4ExceptionDescription &ed)
G4EmParametersMessenger * theMessenger
G4double MaxEnergyForCSDARange() const
#define DBL_MAX
Definition: templates.hh:83
G4double MscSkin() const
void SetFluo(G4bool val)
G4double FactorForAngleLimit() const
void SetMscSkin(G4double val)
G4double rangeFactor
G4double factorForAngleLimit