Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4EmParameters.cc
이 파일의 문서화 페이지로 가기
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 "G4UnitsTable.hh"
51 #include "G4SystemOfUnits.hh"
52 #include "G4VEmProcess.hh"
53 #include "G4VEnergyLossProcess.hh"
54 #include "G4VAtomDeexcitation.hh"
56 #include "G4NistManager.hh"
57 #include "G4RegionStore.hh"
58 #include "G4Region.hh"
59 #include "G4ApplicationState.hh"
60 #include "G4StateManager.hh"
61 
63 
64 #ifdef G4MULTITHREADED
65  G4Mutex G4EmParameters::emParametersMutex = G4MUTEX_INITIALIZER;
66 #endif
67 
68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
69 
71 {
72  if(nullptr == theInstance) {
73 #ifdef G4MULTITHREADED
74  G4MUTEXLOCK(&emParametersMutex);
75  if(nullptr == theInstance) {
76 #endif
77  static G4EmParameters manager;
78  theInstance = &manager;
79 #ifdef G4MULTITHREADED
80  }
81  G4MUTEXUNLOCK(&emParametersMutex);
82 #endif
83  }
84  return theInstance;
85 }
86 
87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
88 
90 {
91  delete theMessenger;
92  delete emSaturation;
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
96 
98 {
101 
103  Initialise();
104  emSaturation = nullptr;
105 }
106 
108 {
109  if(!IsLocked()) { Initialise(); }
110 }
111 
113 {
114  lossFluctuation = true;
115  buildCSDARange = false;
116  flagLPM = true;
117  spline = true;
118  cutAsFinalRange = false;
119  applyCuts = false;
120  fluo = false;
121  beardenFluoDir = false;
122  auger = false;
123  augerCascade = false;
124  pixe = false;
125  deexIgnoreCut = false;
126  lateralDisplacement = true;
128  muhadLateralDisplacement = false;
131  useMottCorrection = false;
132  integral = true;
133  birks = false;
134  dnaFast = false;
135  dnaStationary = false;
136  dnaMsc = false;
137  gammaShark = false;
138  onIsolated = false;
139 
140  minSubRange = 1.0;
141  minKinEnergy = 0.1*CLHEP::keV;
142  maxKinEnergy = 100.0*CLHEP::TeV;
147  linLossLimit = 0.01;
149  lambdaFactor = 0.8;
150  factorForAngleLimit = 1.0;
152  energyLimit = 100.0*CLHEP::MeV;
153  rangeFactor = 0.04;
154  rangeFactorMuHad = 0.2;
155  geomFactor = 2.5;
156  skin = 1.0;
157  dRoverRange = 0.2;
159  dRoverRangeMuHad = 0.2;
161  factorScreen = 1.0;
162 
163  nbins = 84;
164  nbinsPerDecade = 7;
165  verbose = 1;
166  workerVerbose = 0;
167  tripletConv = 0;
168 
173 
174  namePIXE = "Empirical";
175  nameElectronPIXE = "Livermore";
176 }
177 
179 {
180  if(IsLocked()) { return; }
181  lossFluctuation = val;
182 }
183 
185 {
186  return lossFluctuation;
187 }
188 
190 {
191  if(IsLocked()) { return; }
192  buildCSDARange = val;
193 }
194 
196 {
197  return buildCSDARange;
198 }
199 
201 {
202  if(IsLocked()) { return; }
203  flagLPM = val;
204 }
205 
207 {
208  return flagLPM;
209 }
210 
212 {
213  if(IsLocked()) { return; }
214  spline = val;
215 }
216 
218 {
219  return spline;
220 }
221 
223 {
224  if(IsLocked()) { return; }
225  cutAsFinalRange = val;
226 }
227 
229 {
230  return cutAsFinalRange;
231 }
232 
234 {
235  if(IsLocked()) { return; }
236  applyCuts = val;
237 }
238 
240 {
241  return applyCuts;
242 }
243 
245 {
246  if(IsLocked()) { return; }
247  fluo = val;
248 }
249 
251 {
252  return fluo;
253 }
254 
256 {
257  if(IsLocked()) { return; }
258  beardenFluoDir = val;
259 }
260 
262 {
263  return beardenFluoDir;
264 }
265 
267 {
268  SetAugerCascade(val);
269 }
270 
272 {
273  return auger;
274 }
275 
277 {
278  if(IsLocked()) { return; }
279  augerCascade = val;
280  auger = val;
281  if(val) { fluo = true; }
282 }
283 
285 {
286  return augerCascade;
287 }
288 
290 {
291  if(IsLocked()) { return; }
292  pixe = val;
293  if(val) { fluo = true; }
294 }
295 
297 {
298  return pixe;
299 }
300 
302 {
303  if(IsLocked()) { return; }
304  deexIgnoreCut = val;
305 }
306 
308 {
309  return deexIgnoreCut;
310 }
311 
313 {
314  if(IsLocked()) { return; }
315  lateralDisplacement = val;
316 }
317 
319 {
320  return lateralDisplacement;
321 }
322 
324 {
325  if(IsLocked()) { return; }
327 }
328 
330 {
332 }
333 
335 {
336  if(IsLocked()) { return; }
338 }
339 
341 {
343 }
344 
346 {
347  if(IsLocked()) { return; }
349 }
350 
352 {
354 }
355 
357 {
358  if(IsLocked()) { return; }
360 }
361 
363 {
365 }
366 
368 {
369  if(IsLocked()) { return; }
370  useMottCorrection = val;
371 }
372 
374 {
375  return useMottCorrection;
376 }
377 
379 {
380  if(IsLocked()) { return; }
381  integral = val;
382 }
383 
385 {
386  return integral;
387 }
388 
390 {
391  birks = val;
392 #ifdef G4MULTITHREADED
393  G4MUTEXLOCK(&G4EmParameters::emParametersMutex);
394 #endif
395  if(birks) {
396  if(!emSaturation) { emSaturation = new G4EmSaturation(1); }
398  }
399 #ifdef G4MULTITHREADED
400  G4MUTEXUNLOCK(&G4EmParameters::emParametersMutex);
401 #endif
402 }
403 
405 {
406  return birks;
407 }
408 
410 {
411  if(IsLocked()) { return; }
412  dnaFast = val;
413 }
414 
416 {
417  return dnaFast;
418 }
419 
421 {
422  if(IsLocked()) { return; }
423  dnaStationary = val;
424 }
425 
427 {
428  return dnaStationary;
429 }
430 
432 {
433  if(IsLocked()) { return; }
434  dnaMsc = val;
435 }
436 
438 {
439  return dnaMsc;
440 }
441 
443 {
444  if(IsLocked()) { return; }
445  gammaShark = val;
446 }
447 
449 {
450  return gammaShark;
451 }
452 
454 {
455  if(emSaturation != ptr) {
456  delete emSaturation;
457  emSaturation = ptr;
458  SetBirksActive(true);
459  }
460 }
461 
463 {
464  if(IsLocked()) { return; }
465  onIsolated = val;
466 }
467 
469 {
470  return onIsolated;
471 }
472 
474 {
475  if(!emSaturation) { SetBirksActive(true); }
476  return emSaturation;
477 }
478 
480 {
481  if(IsLocked()) { return; }
482  if(val > 0.0 && val < 1.0) {
483  minSubRange = val;
484  } else {
486  ed << "Value of MinSubRange is out of range (0 - 1): " << val
487  << " is ignored";
488  PrintWarning(ed);
489  }
490 }
491 
493 {
494  return minSubRange;
495 }
496 
498 {
499  if(IsLocked()) { return; }
500  if(val > 1.e-3*eV && val < maxKinEnergy) {
501  minKinEnergy = val;
503  } else {
505  ed << "Value of MinKinEnergy is out of range: " << val/MeV
506  << " MeV is ignored";
507  PrintWarning(ed);
508  }
509 }
510 
512 {
513  return minKinEnergy;
514 }
515 
517 {
518  if(IsLocked()) { return; }
519  if(val > minKinEnergy && val < 1.e+7*TeV) {
520  maxKinEnergy = val;
522  } else {
524  ed << "Value of MaxKinEnergy is out of range: "
525  << val/GeV << " GeV is ignored";
526  PrintWarning(ed);
527  }
528 }
529 
531 {
532  return maxKinEnergy;
533 }
534 
536 {
537  if(IsLocked()) { return; }
538  if(val > minKinEnergy && val <= 100*TeV) {
539  maxKinEnergyCSDA = val;
540  } else {
542  ed << "Value of MaxKinEnergyCSDA is out of range: "
543  << val/GeV << " GeV is ignored";
544  PrintWarning(ed);
545  }
546 }
547 
549 {
550  return maxKinEnergyCSDA;
551 }
552 
554 {
555  if(IsLocked()) { return; }
556  if(val >= 0.0) {
557  lowestElectronEnergy = val;
558  } else {
560  ed << "Value of lowestElectronEnergy is out of range: "
561  << val/MeV << " MeV is ignored";
562  PrintWarning(ed);
563  }
564 }
565 
567 {
568  return lowestElectronEnergy;
569 }
570 
572 {
573  if(IsLocked()) { return; }
574  if(val >= 0.0) {
575  lowestMuHadEnergy = val;
576  } else {
578  ed << "Value of lowestMuHadEnergy is out of range: "
579  << val/MeV << " MeV is ignored";
580  PrintWarning(ed);
581  }
582 }
583 
585 {
586  return lowestMuHadEnergy;
587 }
588 
590 {
591  if(IsLocked()) { return; }
592  if(val > 0.0) { lowestTripletEnergy = val; }
593 }
594 
596 {
597  return lowestTripletEnergy;
598 }
599 
601 {
602  if(IsLocked()) { return; }
603  if(val > 0.0 && val < 0.5) {
604  linLossLimit = val;
605  } else {
607  ed << "Value of linLossLimit is out of range: " << val
608  << " is ignored";
609  PrintWarning(ed);
610  }
611 }
612 
614 {
615  return linLossLimit;
616 }
617 
619 {
620  if(IsLocked()) { return; }
621  if(val > 0.0) {
622  bremsTh = val;
623  } else {
625  ed << "Value of bremsstrahlung threshold is out of range: "
626  << val/GeV << " GeV is ignored";
627  PrintWarning(ed);
628  }
629 }
630 
632 {
633  return bremsTh;
634 }
635 
637 {
638  if(IsLocked()) { return; }
639  if(val > 0.0 && val < 1.0) {
640  lambdaFactor = val;
641  } else {
643  ed << "Value of lambda factor is out of range: " << val
644  << " is ignored";
645  PrintWarning(ed);
646  }
647 }
648 
650 {
651  return lambdaFactor;
652 }
653 
655 {
656  if(IsLocked()) { return; }
657  if(val > 0.0) {
658  factorForAngleLimit = val;
659  } else {
661  ed << "Value of factor for enegry limit is out of range: "
662  << val << " is ignored";
663  PrintWarning(ed);
664  }
665 }
666 
668 {
669  return factorForAngleLimit;
670 }
671 
673 {
674  if(IsLocked()) { return; }
675  if(val >= 0.0 && val <= pi) {
676  thetaLimit = val;
677  } else {
679  ed << "Value of polar angle limit is out of range: "
680  << val << " is ignored";
681  PrintWarning(ed);
682  }
683 }
684 
686 {
687  return thetaLimit;
688 }
689 
691 {
692  if(IsLocked()) { return; }
693  if(val >= 0.0) {
694  energyLimit = val;
695  } else {
697  ed << "Value of msc energy limit is out of range: "
698  << val << " is ignored";
699  PrintWarning(ed);
700  }
701 }
702 
704 {
705  return energyLimit;
706 }
707 
709 {
710  if(IsLocked()) { return; }
711  if(val > 0.0 && val < 1.0) {
712  rangeFactor = val;
713  } else {
715  ed << "Value of rangeFactor is out of range: "
716  << val << " is ignored";
717  PrintWarning(ed);
718  }
719 }
720 
722 {
723  return rangeFactor;
724 }
725 
727 {
728  if(IsLocked()) { return; }
729  if(val > 0.0 && val < 1.0) {
730  rangeFactorMuHad = val;
731  } else {
733  ed << "Value of rangeFactorMuHad is out of range: "
734  << val << " is ignored";
735  PrintWarning(ed);
736  }
737 }
738 
740 {
741  return rangeFactorMuHad;
742 }
743 
745 {
746  if(IsLocked()) { return; }
747  if(val >= 1.0) {
748  geomFactor = val;
749  } else {
751  ed << "Value of geomFactor is out of range: "
752  << val << " is ignored";
753  PrintWarning(ed);
754  }
755 }
756 
758 {
759  return geomFactor;
760 }
761 
763 {
764  if(IsLocked()) { return; }
765  if(val >= 1.0) {
766  skin = val;
767  } else {
769  ed << "Value of skin is out of range: "
770  << val << " is ignored";
771  PrintWarning(ed);
772  }
773 }
774 
776 {
777  return skin;
778 }
779 
781 {
782  if(IsLocked()) { return; }
783  if(val > 0.0) {
784  factorScreen = val;
785  } else {
787  ed << "Value of factorScreen is out of range: "
788  << val << " is ignored";
789  PrintWarning(ed);
790  }
791 }
792 
794 {
795  return factorScreen;
796 }
797 
799 {
800  if(IsLocked()) { return; }
801  if(v1 > 0.0 && v1 <= 1.0 && v2 > 0.0) {
802  dRoverRange = v1;
803  finalRange = v2;
804  } else {
806  ed << "Values of step function are out of range: "
807  << v1 << ", " << v2/CLHEP::mm << " mm - are ignored";
808  PrintWarning(ed);
809  }
810 }
811 
813 {
814  if(IsLocked()) { return; }
815  if(v1 > 0.0 && v1 <= 1.0 && v2 > 0.0) {
816  dRoverRangeMuHad = v1;
817  finalRangeMuHad = v2;
818  } else {
820  ed << "Values of step function are out of range: "
821  << v1 << ", " << v2/CLHEP::mm << " mm - are ignored";
822  PrintWarning(ed);
823  }
824 }
825 
827 {
828  if(IsLocked()) { return; }
829  if(val >= 5 && val < 10000000) {
830  nbins = val;
832  } else {
834  ed << "Value of number of bins is out of range: "
835  << val << " is ignored";
836  PrintWarning(ed);
837  }
838 }
839 
841 {
842  return nbins;
843 }
844 
846 {
847  if(IsLocked()) { return; }
848  if(val >= 5 && val < 1000000) {
849  nbinsPerDecade = val;
851  } else {
853  ed << "Value of number of bins per decade is out of range: "
854  << val << " is ignored";
855  PrintWarning(ed);
856  }
857 }
858 
860 {
861  return nbinsPerDecade;
862 }
863 
865 {
866  if(IsLocked()) { return; }
867  verbose = val;
869 }
870 
872 {
873  return verbose;
874 }
875 
877 {
878  if(IsLocked()) { return; }
879  workerVerbose = val;
880 }
881 
883 {
884  return workerVerbose;
885 }
886 
888 {
889  if(IsLocked()) { return; }
890  mscStepLimit = val;
891 }
892 
894 {
895  return mscStepLimit;
896 }
897 
899 {
900  if(IsLocked()) { return; }
901  mscStepLimitMuHad = val;
902 }
903 
905 {
906  return mscStepLimitMuHad;
907 }
908 
909 void
911 {
912  if(IsLocked()) { return; }
913  nucFormfactor = val;
914 }
915 
917 {
918  return nucFormfactor;
919 }
920 
922 {
923  if(IsLocked()) { return; }
924  dnaElectronSolvation = val;
925 }
926 
928 {
929  return dnaElectronSolvation;
930 }
931 
933 {
934  if(IsLocked()) { return; }
935  tripletConv = val;
936 }
937 
939 {
940  return tripletConv;
941 }
942 
944 {
945  if(IsLocked()) { return; }
946  G4cout << "G4EmParameters::SetPIXECrossSectionModel " << sss << G4endl;
947  namePIXE = sss;
948 }
949 
951 {
952  return namePIXE;
953 }
954 
956 {
957  if(IsLocked()) { return; }
959 }
960 
962 {
963  return nameElectronPIXE;
964 }
965 
967 {
968  G4Exception("G4EmParameters", "em0044", JustWarning, ed);
969 }
970 
972 {
973  G4String r = reg;
974  if(r == "" || r == "world" || r == "World") {
975  r = "DefaultRegionForTheWorld";
976  }
977  return r;
978 }
979 
981  const G4String& region,
982  const G4String& type)
983 {
984  if(IsLocked()) { return; }
985  G4String r = CheckRegion(region);
986  G4int nreg = m_regnamesPAI.size();
987  for(G4int i=0; i<nreg; ++i) {
988  if((m_particlesPAI[i] == particle ||
989  m_particlesPAI[i] == "all" ||
990  particle == "all") &&
991  (m_regnamesPAI[i] == r ||
992  m_regnamesPAI[i] == "DefaultRegionForTheWorld" ||
993  r == "DefaultRegionForTheWorld") ) {
994 
995  m_typesPAI[i] = type;
996  if(particle == "all") { m_particlesPAI[i] = particle; }
997  if(r == "DefaultRegionForTheWorld") { m_regnamesPAI[i] = r; }
998  return;
999  }
1000  }
1001  m_particlesPAI.push_back(particle);
1002  m_regnamesPAI.push_back(r);
1003  m_typesPAI.push_back(type);
1004 }
1005 
1006 const std::vector<G4String>& G4EmParameters::ParticlesPAI() const
1007 {
1008  return m_particlesPAI;
1009 }
1010 
1011 const std::vector<G4String>& G4EmParameters::RegionsPAI() const
1012 {
1013  return m_regnamesPAI;
1014 }
1015 
1016 const std::vector<G4String>& G4EmParameters::TypesPAI() const
1017 {
1018  return m_typesPAI;
1019 }
1020 
1022 {
1023  if(IsLocked()) { return; }
1024  G4String r = CheckRegion(region);
1025  G4int nreg = m_regnamesME.size();
1026  for(G4int i=0; i<nreg; ++i) {
1027  if(r == m_regnamesME[i]) { return; }
1028  }
1029  m_regnamesME.push_back(r);
1030 }
1031 
1032 const std::vector<G4String>& G4EmParameters::RegionsMicroElec() const
1033 {
1034  return m_regnamesME;
1035 }
1036 
1037 void G4EmParameters::AddDNA(const G4String& region, const G4String& type)
1038 {
1039  if(IsLocked()) { return; }
1040  G4String r = CheckRegion(region);
1041  G4int nreg = m_regnamesDNA.size();
1042  for(G4int i=0; i<nreg; ++i) {
1043  if(r == m_regnamesDNA[i]) { return; }
1044  }
1045  m_regnamesDNA.push_back(r);
1046  m_typesDNA.push_back(type);
1047 }
1048 
1049 const std::vector<G4String>& G4EmParameters::RegionsDNA() const
1050 {
1051  return m_regnamesDNA;
1052 }
1053 
1054 const std::vector<G4String>& G4EmParameters::TypesDNA() const
1055 {
1056  return m_typesDNA;
1057 }
1058 
1059 void G4EmParameters::AddMsc(const G4String& region, const G4String& type)
1060 {
1061  AddPhysics(region, type);
1062 }
1063 
1064 const std::vector<G4String>& G4EmParameters::RegionsMsc() const
1065 {
1066  return m_regnamesMsc;
1067 }
1068 
1069 const std::vector<G4String>& G4EmParameters::TypesMsc() const
1070 {
1071  return m_typesMsc;
1072 }
1073 
1074 void G4EmParameters::AddPhysics(const G4String& region, const G4String& type)
1075 {
1076  if(IsLocked()) { return; }
1077  G4String r = CheckRegion(region);
1078  G4int nreg = m_regnamesMsc.size();
1079  for(G4int i=0; i<nreg; ++i) {
1080  if(r == m_regnamesMsc[i]) { return; }
1081  }
1082  m_regnamesMsc.push_back(r);
1083  m_typesMsc.push_back(type);
1084 }
1085 
1086 const std::vector<G4String>& G4EmParameters::RegionsPhysics() const
1087 {
1088  return m_regnamesMsc;
1089 }
1090 
1091 const std::vector<G4String>& G4EmParameters::TypesPhysics() const
1092 {
1093  return m_typesMsc;
1094 }
1095 
1097 {
1098  if(IsLocked()) { return; }
1099  G4String r = CheckRegion(region);
1100  G4int nreg = m_regnamesSubCut.size();
1101  for(G4int i=0; i<nreg; ++i) {
1102  if(r == m_regnamesSubCut[i]) {
1103  m_subCuts[i] = val;
1104  return;
1105  }
1106  }
1107  m_regnamesSubCut.push_back(r);
1108  m_subCuts.push_back(val);
1109 }
1110 
1111 void
1113  G4bool fauger, G4bool fpixe)
1114 {
1115  if(IsLocked()) { return; }
1116  if(fdeex) { fluo = true; }
1117  G4String r = CheckRegion(region);
1118  G4int nreg = m_regnamesDeex.size();
1119  if(0 == nreg && r != "DefaultRegionForTheWorld") {
1120  m_regnamesDeex.push_back("DefaultRegionForTheWorld");
1121  m_fluo.push_back(false);
1122  m_auger.push_back(false);
1123  m_pixe.push_back(false);
1124  nreg = 1;
1125  }
1126  for(G4int i=0; i<nreg; ++i) {
1127  if(r == m_regnamesDeex[i]) {
1128  m_fluo[i] = fdeex;
1129  m_auger[i]= fauger;
1130  m_pixe[i] = fpixe;
1131  return;
1132  }
1133  }
1134  m_regnamesDeex.push_back(r);
1135  m_fluo.push_back(fdeex);
1136  m_auger.push_back(fauger);
1137  m_pixe.push_back(fpixe);
1138 }
1139 
1140 void
1142  G4double val, G4bool wflag)
1143 {
1144  if(IsLocked()) { return; }
1145  if(val > 0.0) {
1146  G4int n = m_procBiasedXS.size();
1147  for(G4int i=0; i<n; ++i) {
1148  if(procname == m_procBiasedXS[i]) {
1149  m_factBiasedXS[i] = val;
1150  m_weightBiasedXS[i]= wflag;
1151  return;
1152  }
1153  }
1154  m_procBiasedXS.push_back(procname);
1155  m_factBiasedXS.push_back(val);
1156  m_weightBiasedXS.push_back(wflag);
1157  } else {
1159  ed << "Process: " << procname << " XS biasing factor "
1160  << val << " is negative - ignored";
1161  PrintWarning(ed);
1162  }
1163 }
1164 
1165 void
1167  const G4String& region,
1168  G4double length,
1169  G4bool wflag)
1170 {
1171  if(IsLocked()) { return; }
1172  G4String r = CheckRegion(region);
1173  if(length >= 0.0) {
1174  G4int n = m_procForced.size();
1175  for(G4int i=0; i<n; ++i) {
1176  if(procname == m_procForced[i] && r == m_regnamesForced[i] ) {
1177  m_lengthForced[i] = length;
1178  m_weightForced[i]= wflag;
1179  return;
1180  }
1181  }
1182  m_regnamesForced.push_back(r);
1183  m_procForced.push_back(procname);
1184  m_lengthForced.push_back(length);
1185  m_weightForced.push_back(wflag);
1186  } else {
1188  ed << "Process: " << procname << " in region " << r
1189  << " : forced interacttion length= "
1190  << length << " is negative - ignored";
1191  PrintWarning(ed);
1192  }
1193 }
1194 
1195 void
1197  const G4String& region,
1198  G4double factor,
1199  G4double energyLim)
1200 {
1201  if(IsLocked()) { return; }
1202  G4String r = CheckRegion(region);
1203  if(factor >= 0.0 && energyLim >= 0.0) {
1204  G4int n = m_procBiasedSec.size();
1205  for(G4int i=0; i<n; ++i) {
1206  if(procname == m_procBiasedSec[i] && r == m_regnamesBiasedSec[i] ) {
1207  m_factBiasedSec[i] = factor;
1208  m_elimBiasedSec[i] = energyLim;
1209  return;
1210  }
1211  }
1212  m_regnamesBiasedSec.push_back(r);
1213  m_procBiasedSec.push_back(procname);
1214  m_factBiasedSec.push_back(factor);
1215  m_elimBiasedSec.push_back(energyLim);
1216  } else {
1218  ed << "Process: " << procname << " in region " << r
1219  << " : secondary bised factor= "
1220  << factor << ", Elim= " << energyLim << " - ignored";
1221  PrintWarning(ed);
1222  }
1223 }
1224 
1226  G4bool isElectron) const
1227 {
1228  if(isElectron) { ptr->SetStepFunction(dRoverRange, finalRange, false); }
1229  else { ptr->SetStepFunction(dRoverRangeMuHad, finalRangeMuHad, false); }
1230 
1231  G4RegionStore* regionStore = G4RegionStore::GetInstance();
1232  G4int n = m_regnamesSubCut.size();
1233  for(G4int i=0; i<n; ++i) {
1234  const G4Region* reg = regionStore->GetRegion(m_regnamesSubCut[i], false);
1235  if(reg) { ptr->ActivateSubCutoff(m_subCuts[i], reg); }
1236  }
1237  n = m_procBiasedXS.size();
1238  for(G4int i=0; i<n; ++i) {
1239  if(ptr->GetProcessName() == m_procBiasedXS[i]) {
1241  m_weightBiasedXS[i]);
1242  break;
1243  }
1244  }
1245  n = m_procForced.size();
1246  for(G4int i=0; i<n; ++i) {
1247  if(ptr->GetProcessName() == m_procForced[i]) {
1249  m_regnamesForced[i],
1250  m_weightForced[i]);
1251  break;
1252  }
1253  }
1254  n = m_procBiasedSec.size();
1255  for(G4int i=0; i<n; ++i) {
1256  if(ptr->GetProcessName() == m_procBiasedSec[i]) {
1258  m_factBiasedSec[i],
1259  m_elimBiasedSec[i]);
1260  break;
1261  }
1262  }
1263 }
1264 
1266 {
1267  G4int n = m_procBiasedXS.size();
1268  for(G4int i=0; i<n; ++i) {
1269  if(ptr->GetProcessName() == m_procBiasedXS[i]) {
1271  m_weightBiasedXS[i]);
1272  break;
1273  }
1274  }
1275  n = m_procForced.size();
1276  for(G4int i=0; i<n; ++i) {
1277  if(ptr->GetProcessName() == m_procForced[i]) {
1279  m_regnamesForced[i],
1280  m_weightForced[i]);
1281  break;
1282  }
1283  }
1284  n = m_procBiasedSec.size();
1285  for(G4int i=0; i<n; ++i) {
1286  if(ptr->GetProcessName() == m_procBiasedSec[i]) {
1288  m_factBiasedSec[i],
1289  m_elimBiasedSec[i]);
1290  break;
1291  }
1292  }
1293 }
1294 
1296 {
1297  G4int n = m_regnamesDeex.size();
1298  for(G4int i=0; i<n; ++i) {
1300  m_fluo[i], m_auger[i], m_pixe[i]);
1301  }
1302 }
1303 
1304 std::ostream& G4EmParameters::StreamInfo(std::ostream& os) const
1305 {
1306  G4int prec = os.precision(5);
1307  os << "=======================================================================" << "\n";
1308  os << "====== Electromagnetic Physics Parameters ========" << "\n";
1309  os << "=======================================================================" << "\n";
1310  os << "LPM effect enabled " <<flagLPM << "\n";
1311  os << "Spline of EM tables enabled " <<spline << "\n";
1312  os << "Apply cuts on all EM processes " <<applyCuts << "\n";
1313  os << "Use integral approach for tracking " <<integral << "\n";
1314  os << "X-section factor for integral approach " <<lambdaFactor << "\n";
1315  os << "Min kinetic energy for tables "
1316  <<G4BestUnit(minKinEnergy,"Energy") << "\n";
1317  os << "Max kinetic energy for tables "
1318  <<G4BestUnit(maxKinEnergy,"Energy") << "\n";
1319  os << "Number of bins in tables " <<nbins << "\n";
1320  os << "Number of bins per decade of a table " <<nbinsPerDecade << "\n";
1321  os << "Verbose level " <<verbose << "\n";
1322  os << "Verbose level for worker thread " <<workerVerbose << "\n";
1323  os << "Bremsstrahlung energy threshold above which \n"
1324  << " primary is added to the list of secondary "
1325  <<G4BestUnit(bremsTh,"Energy") << "\n";
1326  os << "Lowest triplet kinetic energy "
1327  <<G4BestUnit(lowestTripletEnergy,"Energy") << "\n";
1328  os << "5D gamma conversion model type " <<tripletConv << "\n";
1329  os << "5D gamma conversion model on isolated ion " <<onIsolated << "\n";
1330 
1331  os << "=======================================================================" << "\n";
1332  os << "====== Ionisation Parameters ========" << "\n";
1333  os << "=======================================================================" << "\n";
1334  os << "Step function for e+- " <<"("<< dRoverRange
1335  << ", " << finalRange/CLHEP::mm << " mm)\n";
1336  os << "Step function for muons/hadrons " <<"("<< dRoverRangeMuHad
1337  << ", " << finalRangeMuHad/CLHEP::mm << " mm)\n";
1338  os << "Lowest e+e- kinetic energy "
1339  <<G4BestUnit(lowestElectronEnergy,"Energy") << "\n";
1340  os << "Lowest muon/hadron kinetic energy "
1341  <<G4BestUnit(lowestMuHadEnergy,"Energy") << "\n";
1342  os << "Fluctuations of dE/dx are enabled " <<lossFluctuation << "\n";
1343  os << "Use built-in Birks satuaration " << birks << "\n";
1344  os << "Build CSDA range enabled " <<buildCSDARange << "\n";
1345  os << "Use cut as a final range enabled " <<finalRange << "\n";
1346  os << "Enable angular generator interface "
1347  <<useAngGeneratorForIonisation << "\n";
1348  os << "Factor of cut reduction for sub-cutoff method " << minSubRange << "\n";
1349  os << "Max kinetic energy for CSDA tables "
1350  <<G4BestUnit(maxKinEnergyCSDA,"Energy") << "\n";
1351  os << "Linear loss limit " <<linLossLimit << "\n";
1352 
1353  os << "=======================================================================" << "\n";
1354  os << "====== Multiple Scattering Parameters ========" << "\n";
1355  os << "=======================================================================" << "\n";
1356  os << "Type of msc step limit algorithm for e+- " <<mscStepLimit << "\n";
1357  os << "Type of msc step limit algorithm for muons/hadrons " <<mscStepLimitMuHad << "\n";
1358  os << "Msc lateral displacement for e+- enabled " <<lateralDisplacement << "\n";
1359  os << "Msc lateral displacement for muons and hadrons " <<muhadLateralDisplacement << "\n";
1360  os << "Urban msc model lateral displacement alg96 " <<lateralDisplacementAlg96 << "\n";
1361  os << "Msc lateral displacement beyond geometry safety " <<latDisplacementBeyondSafety << "\n";
1362  os << "Range factor for msc step limit for e+- " <<rangeFactor << "\n";
1363  os << "Range factor for msc step limit for muons/hadrons " <<rangeFactorMuHad << "\n";
1364  os << "Geometry factor for msc step limitation of e+- " <<geomFactor << "\n";
1365  os << "Skin parameter for msc step limitation of e+- " <<skin << "\n";
1366  os << "Use Mott correction for e- scattering " << useMottCorrection << "\n";
1367  os << "Factor used for dynamic computation of angular \n"
1368  << " limit between single and multiple scattering " << factorForAngleLimit << "\n";
1369  os << "Fixed angular limit between single \n"
1370  << " and multiple scattering "
1371  << thetaLimit/CLHEP::rad << " rad" << "\n";
1372  os << "Upper energy limit for e+- multiple scattering "
1373  << energyLimit/CLHEP::MeV << " MeV" << "\n";
1374  os << "Type of nuclear form-factor " <<nucFormfactor << "\n";
1375  os << "Screening factor " <<factorScreen << "\n";
1376 
1377  os << "=======================================================================" << "\n";
1378  os << "====== Atomic Deexcitation Parameters ========" << "\n";
1379  os << "=======================================================================" << "\n";
1380  os << "Fluorescence enabled " <<fluo << "\n";
1381  os << "Fluorescence Bearden data files enabled " <<beardenFluoDir << "\n";
1382  os << "Auger electron production enabled " <<auger << "\n";
1383  os << "Auger cascade enabled " <<augerCascade << "\n";
1384  os << "PIXE atomic de-excitation enabled " <<pixe << "\n";
1385  os << "De-excitation module ignores cuts " <<deexIgnoreCut << "\n";
1386  os << "Type of PIXE cross section for hadrons " <<namePIXE << "\n";
1387  os << "Type of PIXE cross section for e+- " <<nameElectronPIXE << "\n";
1388 
1389  os << "=======================================================================" << "\n";
1390  os << "====== DNA Physics Parameters ========" << "\n";
1391  os << "=======================================================================" << "\n";
1392  os << "Use fast sampling in DNA models " << dnaFast << "\n";
1393  os << "Use Stationary option in DNA models " << dnaStationary << "\n";
1394  os << "Use DNA with multiple scattering of e- " << dnaMsc << "\n";
1395  os << "Use DNA e- solvation model type "
1396  << dnaElectronSolvation << "\n";
1397  os << "=======================================================================" << "\n";
1398  os.precision(prec);
1399  return os;
1400 }
1401 
1403 {
1404  StreamInfo(G4cout);
1405 }
1406 
1407 std::ostream& operator<< (std::ostream& os, const G4EmParameters& par)
1408 {
1409  return par.StreamInfo(os);
1410 }
1411 
1413 {
1414  return (!G4Threading::IsMasterThread() ||
1418 }
1419 
1420 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
std::vector< G4double > m_factBiasedXS
std::vector< G4bool > m_weightForced
G4String CheckRegion(const G4String &) const
std::vector< G4String > m_procBiasedXS
void SetMaxEnergy(G4double val)
void SetMscEnergyLimit(G4double val)
void SetDeexcitationIgnoreCut(G4bool val)
G4double BremsstrahlungTh() const
G4MscStepLimitType MscMuHadStepLimitType() const
static const double prec
Definition: RanecuEngine.cc:58
G4DNAModelSubType DNAeSolvationSubType() const
const std::vector< G4String > & RegionsPhysics() const
void SetBremsstrahlungTh(G4double val)
std::vector< G4bool > m_weightBiasedXS
void SetMinSubRange(G4double val)
void SetStepFunction(G4double v1, G4double v2, G4bool lock=true)
G4int NumberOfBinsPerDecade() const
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:45
void SetMscMuHadStepLimitType(G4MscStepLimitType val)
G4MscStepLimitType
static constexpr double MeV
Definition: G4SIunits.hh:214
G4bool LateralDisplacementAlg96() const
G4MscStepLimitType MscStepLimitType() const
void SetLambdaFactor(G4double val)
void SetSpline(G4bool val)
std::vector< G4String > m_regnamesDeex
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
G4bool UseAngularGeneratorForIonisation() const
G4double lambdaFactor
G4EmSaturation * GetEmSaturation()
G4bool lateralDisplacement
void SetUseCutAsFinalRange(G4bool val)
G4double linLossLimit
void SetPIXEElectronCrossSectionModel(const G4String &)
G4double rangeFactor
void DefineRegParamForEM(G4VEmProcess *) const
void PrintWarning(G4ExceptionDescription &ed) const
G4bool GammaSharkActive() const
G4bool LateralDisplacement() const
void SetDeexcitationActiveRegion(const G4String &rname, G4bool valDeexcitation, G4bool valAuger, G4bool valPIXE)
G4bool ApplyCuts() const
#define G4endl
Definition: G4ios.hh:61
void DefineRegParamForLoss(G4VEnergyLossProcess *, G4bool isElectron) const
G4bool BeardenFluoDir() const
void SetDNAElectronMsc(G4bool val)
void SetMuHadLateralDisplacement(G4bool val)
G4double MaxKinEnergy() const
G4bool BuildCSDARange() const
void SetBeardenFluoDir(G4bool val)
G4int GetConversionType() const
G4bool DNAStationary() const
void AddPhysics(const G4String &region, const G4String &type)
G4bool LPM() const
G4bool muhadLateralDisplacement
void SetVerbose(G4int val)
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="", G4bool flag=true)
std::vector< G4String > m_regnamesForced
G4bool IsMasterThread()
Definition: G4Threading.cc:130
void SetStepFunctionMuHad(G4double v1, G4double v2)
void SetLPM(G4bool val)
G4bool UseCutAsFinalRange() const
const std::vector< G4String > & TypesDNA() const
void ActivateForcedInteraction(G4double length, const G4String &region, G4bool flag=true)
G4bool DNAFast() const
std::vector< G4bool > m_fluo
G4bool MuHadLateralDisplacement() const
void SetOnIsolated(G4bool val)
void AddPAIModel(const G4String &particle, const G4String &region, const G4String &type)
void SetEmSaturation(G4EmSaturation *)
void ActivateSecondaryBiasing(const G4String &name, const G4String &region, G4double factor, G4double energyLimit)
static constexpr double TeV
G4double MscMuHadRangeFactor() const
G4bool lateralDisplacementAlg96
G4StateManager * fStateManager
void SetBuildCSDARange(G4bool val)
void SetCrossSectionBiasingFactor(G4double f, G4bool flag=true)
void SetLossFluctuations(G4bool val)
void SetLowestTripletEnergy(G4double val)
G4double factorScreen
G4bool BirksActive() const
void ActivateAngularGeneratorForIonisation(G4bool val)
void ActivateSecondaryBiasing(const G4String &region, G4double factor, G4double energyLimit)
const std::vector< G4String > & RegionsPAI() const
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
void SetLateralDisplacement(G4bool val)
const std::vector< G4String > & RegionsMicroElec() const
G4EmSaturation * emSaturation
std::vector< G4bool > m_auger
void SetMinEnergy(G4double val)
static const char sss[MAX_N_PAR+2]
Definition: Evaluator.cc:64
G4DNAModelSubType dnaElectronSolvation
static constexpr double TeV
Definition: G4SIunits.hh:218
void SetMscSkin(G4double val)
G4double LinearLossLimit() const
G4bool latDisplacementBeyondSafety
double G4double
Definition: G4Types.hh:76
G4double MaxEnergyForCSDARange() const
bool G4bool
Definition: G4Types.hh:79
void SetDNAStationary(G4bool val)
#define G4MUTEX_INITIALIZER
Definition: G4Threading.hh:88
G4double rangeFactorMuHad
void SetMscThetaLimit(G4double val)
G4NuclearFormfactorType nucFormfactor
G4bool LatDisplacementBeyondSafety() const
void SetMscMuHadRangeFactor(G4double val)
void SetConversionType(G4int val)
G4double MinSubRange() const
void SetStepFunction(G4double v1, G4double v2)
void SetLowestElectronEnergy(G4double val)
void SetMscRangeFactor(G4double val)
void SetPIXECrossSectionModel(const G4String &)
const std::vector< G4String > & TypesPAI() const
G4double LowestMuHadEnergy() const
G4double MscSkin() const
void SetSubCutoff(G4bool val, const G4String &region="")
void SetFactorForAngleLimit(G4double val)
static constexpr double MeV
std::vector< G4String > m_regnamesDNA
G4bool UseMottCorrection() const
void SetLatDisplacementBeyondSafety(G4bool val)
G4int WorkerVerbose() const
void SetFluo(G4bool val)
G4double finalRangeMuHad
G4double lowestTripletEnergy
const G4String & GetProcessName() const
Definition: G4VProcess.hh:411
G4double LambdaFactor() const
static constexpr double eV
Definition: G4SIunits.hh:215
void SetPixe(G4bool val)
G4MscStepLimitType mscStepLimit
void AddMicroElec(const G4String &region)
G4double energyLimit
void SetAuger(G4bool val)
void SetNumberOfBinsPerDecade(G4int val)
G4int Verbose() const
void AddDNA(const G4String &region, const G4String &type)
G4MscStepLimitType mscStepLimitMuHad
G4bool Pixe() const
void SetIntegral(G4bool val)
#define G4MUTEXUNLOCK(mutex)
Definition: G4Threading.hh:234
G4double MinKinEnergy() const
G4double MscRangeFactor() const
G4double ScreeningFactor() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
const std::vector< G4String > & TypesMsc() const
G4double lowestMuHadEnergy
G4bool AugerCascade() const
G4bool useAngGeneratorForIonisation
const G4String & PIXECrossSectionModel()
void SetBirksActive(G4bool val)
void ActivateForcedInteraction(const G4String &procname, const G4String &region, G4double length, G4bool wflag)
void SetLowestMuHadEnergy(G4double val)
G4double LowestTripletEnergy() const
void SetMscStepLimitType(G4MscStepLimitType val)
static G4EmParameters * theInstance
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.hh:65
void SetAugerCascade(G4bool val)
G4double dRoverRange
int G4lrint(double ad)
Definition: templates.hh:151
void SetDNAFast(G4bool val)
static G4RegionStore * GetInstance()
int G4int
Definition: G4Types.hh:78
G4double MscThetaLimit() const
void AddMsc(const G4String &region, const G4String &type)
G4NuclearFormfactorType NuclearFormfactorType() const
void SetNuclearFormfactorType(G4NuclearFormfactorType val)
std::vector< G4double > m_lengthForced
std::vector< G4String > m_particlesPAI
G4ApplicationState GetCurrentState() const
G4double maxKinEnergy
std::vector< G4bool > m_subCuts
G4NuclearFormfactorType
G4bool DeexcitationIgnoreCut() const
void ActivateSecondaryBiasing(const G4String &region, G4double factor, G4double energyLimit)
std::vector< G4String > m_procForced
const G4String & PIXEElectronCrossSectionModel()
std::vector< G4String > m_regnamesBiasedSec
static constexpr double mm
Definition: SystemOfUnits.h:95
G4double minSubRange
std::vector< G4double > m_elimBiasedSec
#define G4MUTEXLOCK(mutex)
Definition: G4Threading.hh:233
G4GLOB_DLL std::ostream G4cout
void DefineRegParamForDeex(G4VAtomDeexcitation *) const
void SetLinearLossLimit(G4double val)
std::vector< G4String > m_typesMsc
G4double MscGeomFactor() const
void SetWorkerVerbose(G4int val)
std::vector< G4String > m_regnamesMsc
G4double factorForAngleLimit
std::vector< G4String > m_procBiasedSec
G4bool Auger() const
Char_t n[5]
void SetMscGeomFactor(G4double val)
G4double maxKinEnergyCSDA
G4double dRoverRangeMuHad
std::vector< G4String > m_typesDNA
void InitialiseG4Saturation()
void SetMaxEnergyForCSDARange(G4double val)
const std::vector< G4String > & TypesPhysics() const
static constexpr double pi
Definition: G4SIunits.hh:75
G4EmParametersMessenger * theMessenger
G4double FactorForAngleLimit() const
void SetGammaSharkActive(G4bool val)
G4double minKinEnergy
static const G4double reg
void SetDeexActiveRegion(const G4String &region, G4bool fdeex, G4bool fauger, G4bool fpixe)
void SetLateralDisplacementAlg96(G4bool val)
std::vector< G4double > m_factBiasedSec
static constexpr double rad
void SetScreeningFactor(G4double val)
void SetCrossSectionBiasingFactor(G4double f, G4bool flag=true)
G4bool isElectron(G4int ityp)
std::vector< G4String > m_regnamesSubCut
G4bool LossFluctuation() const
void SetProcessBiasingFactor(const G4String &procname, G4double val, G4bool wflag)
G4int NumberOfBins() const
void SetNumberOfBins(G4int val)
std::vector< G4String > m_typesPAI
static constexpr double keV
G4double MscEnergyLimit() const
void SetUseMottCorrection(G4bool val)
const std::vector< G4String > & RegionsDNA() const
const std::vector< G4String > & RegionsMsc() const
std::vector< G4bool > m_pixe
G4bool DNAElectronMsc() const
static constexpr double GeV
void Dump() const
static constexpr double GeV
Definition: G4SIunits.hh:217
G4bool IsLocked() const
G4DNAModelSubType
G4double LowestElectronEnergy() const
G4bool Spline() const
G4String nameElectronPIXE
const std::vector< G4String > & ParticlesPAI() const
bool OnIsolated() const
std::vector< G4String > m_regnamesME
std::ostream & StreamInfo(std::ostream &os) const
void ActivateSubCutoff(G4bool val, const G4Region *region=nullptr)
static G4EmParameters * Instance()
static constexpr double pi
Definition: SystemOfUnits.h:54
void SetDNAeSolvationSubType(G4DNAModelSubType val)
G4bool Integral() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
static G4StateManager * GetStateManager()
static G4NistManager * Instance()
std::vector< G4String > m_regnamesPAI
void SetApplyCuts(G4bool val)
std::mutex G4Mutex
Definition: G4Threading.hh:84
G4bool useMottCorrection
G4bool Fluo() const
G4double lowestElectronEnergy