EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
egs_radionuclide_source.h
Go to the documentation of this file.
1 /*
2 ###############################################################################
3 #
4 # EGSnrc egs++ radionuclide source headers
5 # Copyright (C) 2015 National Research Council Canada
6 #
7 # This file is part of EGSnrc.
8 #
9 # EGSnrc is free software: you can redistribute it and/or modify it under
10 # the terms of the GNU Affero General Public License as published by the
11 # Free Software Foundation, either version 3 of the License, or (at your
12 # option) any later version.
13 #
14 # EGSnrc is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 # FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
17 # more details.
18 #
19 # You should have received a copy of the GNU Affero General Public License
20 # along with EGSnrc. If not, see <http://www.gnu.org/licenses/>.
21 #
22 ###############################################################################
23 #
24 # Author: Reid Townson, 2016
25 #
26 # Contributors: Martin Martinov
27 # Patrick Saull
28 #
29 ###############################################################################
30 */
31 
32 
38 #ifndef EGS_RADIONUCLIDE_SOURCE_
39 #define EGS_RADIONUCLIDE_SOURCE_
40 
41 #include "egs_vector.h"
42 #include "egs_base_source.h"
43 #include "egs_rndm.h"
44 #include "egs_shapes.h"
45 #include "egs_base_geometry.h"
46 #include "egs_math.h"
47 #include "egs_application.h"
48 #include "egs_ensdf.cpp"
49 
50 #include <algorithm>
51 #include <complex>
52 
53 
54 #ifdef WIN32
55 
56  #ifdef BUILD_RADIONUCLIDE_SOURCE_DLL
57  #define EGS_RADIONUCLIDE_SOURCE_EXPORT __declspec(dllexport)
58  #else
59  #define EGS_RADIONUCLIDE_SOURCE_EXPORT __declspec(dllimport)
60  #endif
61  #define EGS_RADIONUCLIDE_SOURCE_LOCAL
62 
63 #else
64 
65  #ifdef HAVE_VISIBILITY
66  #define EGS_RADIONUCLIDE_SOURCE_EXPORT __attribute__ ((visibility ("default")))
67  #define EGS_RADIONUCLIDE_SOURCE_LOCAL __attribute__ ((visibility ("hidden")))
68  #else
69  #define EGS_RADIONUCLIDE_SOURCE_EXPORT
70  #define EGS_RADIONUCLIDE_SOURCE_LOCAL
71  #endif
72 
73 #endif
74 
86 
87 public:
90  EGS_RadionuclideBetaSpectrum(EGS_Ensdf *decays, const string outputBetaSpectra) {
91 
93  rm = app->getRM();
94 
95  vector<BetaRecordLeaf *> myBetas = decays->getBetaRecords();
96 
97  for (vector<BetaRecordLeaf *>::iterator beta = myBetas.begin();
98  beta != myBetas.end(); beta++) {
99 
100  // Skip electron capture records
101  if ((*beta)->getCharge() == 1 &&
102  (*beta)->getPositronIntensity() == 0) {
103  continue;
104  }
105 
106  unsigned short int daughterZ = (*beta)->getZ();
107 
108  egsInformation("EGS_RadionuclideBetaSpectrum: "
109  "Energy, Z, A, forbidden: %f %d %d %d\n",
110  (*beta)->getFinalEnergy(), daughterZ,
111  (*beta)->getAtomicWeight(), (*beta)->getForbidden()
112  );
113 
114  const int nbin=1000;
115  EGS_Float *e = new EGS_Float [nbin];
116  EGS_Float *spec = new EGS_Float [nbin];
117  EGS_Float *spec_y = new EGS_Float [nbin];
118 
119  double de, s_y, factor, se_y;
120 
121  ncomps=1; // if we increase this, then we must fill the remainder
122  area[0]=1.0;
123  rel[0]=1.0;
124 
125  emax = (*beta)->getFinalEnergy();
126  zzz[0] = (double)daughterZ;
127  rmass = (*beta)->getAtomicWeight();
128 
129  // These are some special cases where fudge factors are used!
130  // Specify lamda[0]=4 for special shape factors
131 
132  // For Cl-36 (ref: nuc. phys. 99a, 625,(67))
133  // Only the beta- spectrum
134  if (daughterZ == 18 && (*beta)->getCharge() == -1) {
135  lamda[0] = 4;
136  }
137  // For I-129 (ref: phys. rev. 95, 458, 54))
138  // The beta- spectrum with 151 keV endpoint
139  else if (daughterZ == 54 && emax < 0.154 && emax > 0.150) {
140  lamda[0] = 4;
141  }
142  // For Cs-137 (ref: nuc. phys. 112a, 156, (68))
143  // The beta- spectrum with 1175 keV endpoint
144  else if (daughterZ == 56 && emax > 1.173 && emax < 1.177) {
145  lamda[0] = 4;
146  }
147  // For Tl-204 (ref: can. j. phys., 45, 2621, (67))
148  // There is only 1 beta- spectrum
149  else if (daughterZ == 82) {
150  lamda[0] = 4;
151  }
152  // For Bi-210 (ref: nuc. phys., 31, 293, (62))
153  // There is only 1 beta- spectrum
154  else if (daughterZ == 84) {
155  lamda[0] = 4;
156  }
157  else {
158  lamda[0] = (*beta)->getForbidden();
159  }
160 
161  // For positrons from zzz negative (just how the spectrum code
162  // was designed)
163  if ((*beta)->getCharge() == 1) {
164  zzz[0] *= -1;
165  }
166 
167  etop[0]=emax;
168 
169  // prbs july 9, 2007 moved here from before src loop.
170  // also, now tabulate based on
171  // endpoint, using roughly nbin bins across spectrum. Do this by
172  // rounding
173  // endpoint E0 up to nearest 100 keV, and dividing by NBIN to get
174  // binwidth.
175 
176  de=((int)(etop[0]*10.0+1)/10.)/nbin; // round up to nearest 100kev;
177  // /= NBIN
178  //cout << "Binwidth " << de << endl;
179 
180  for (int ib=0; ib<nbin; ib++) {
181  e[ib]=de+ib*de;
182 // egsInformation("%.12f, %.12f\n", e[ib], etop[0]);
183  }
184 
185  s_y=0.0;
186  se_y=0.0;
187  for (int ib=0; ib<nbin; ib++) {
188 
189  if (e[ib]<=emax) {
190  sp(e[ib],spec_y[ib],factor);
191  }
192  else {
193  spec_y[ib]=0.0;
194  }
195 
196  s_y=s_y+spec_y[ib];
197  se_y=se_y+spec_y[ib]*e[ib];
198  }
199 
200  for (int ib=0; ib<nbin; ib++) {
201  spec[ib]=1/de*(spec_y[ib]/s_y);
202 // cout << e[ib] << " " << spec[ib] << endl;
203  }
204 
205  EGS_AliasTable *bspec = new EGS_AliasTable(nbin,e,spec,1);
206  (*beta)->setSpectrum(bspec);
207 
208  // Write the spectrum to a file
209  if (outputBetaSpectra == "yes") {
210 
211  string fname(app->getOutputFile());
212  fname += "_" + decays->radionuclide + "_" + std::to_string(emax);
213  if (!egsIsAbsolutePath(fname)) {
214  fname = egsJoinPath(app->getAppDir(),fname);
215  }
216  fname += ".spec";
217 
218 
219  egsInformation("EGS_RadionuclideBetaSpectrum: Outputting beta spectrum to file: %s\n", fname.c_str());
220 
221  ofstream specStream;
222  specStream.open(fname.c_str());
223  for (int ib=0; ib<nbin; ib++) {
224  spec[ib]=1/de*(spec_y[ib]/s_y);
225  specStream << e[ib] << " " << spec[ib] << endl;
226  }
227  specStream.close();
228  }
229  }
230  }
231 
232 protected:
233 
234  complex<double> cgamma(complex<double> z) {
235 
236  static const int g=7;
237  static const double pi = 3.1415926535897932384626433832795028841972;
238  static const double p[g+2] = {0.99999999999980993, 676.5203681218851,
239  -1259.1392167224028,
240  771.32342877765313,
241  -176.61502916214059,
242  12.507343278686905,
243  -0.13857109526572012,
244  9.9843695780195716e-6,
245  1.5056327351493116e-7
246  };
247 
248  if (real(z)<0.5) {
249  return pi / (sin(pi*z)*cgamma(double(1.0)-z));
250  }
251 
252  z -= 1.0;
253  complex<double> x=p[0];
254  for (int i=1; i<g+2; i++) {
255  x += p[i]/(z+complex<double>(i,0));
256  }
257  complex<double> t = z + (g + double(0.5));
258 
259  return double(sqrt(2.*pi)) * pow(t,z+double(0.5)) * exp(-t) * x;
260  }
261 
262  complex<double> clgamma(complex<double> z) {
263  complex<double> u, v, h, p, r;
264 
265  static const double pi = 3.1415926535897932384626433832795028841972;
266  static const double c1 = 9.189385332046727e-1;
267  static const double c2 = 1.144729885849400;
268  static const double c[10] = {8.333333333333333e-2,
269  -2.777777777777777e-3,
270  7.936507936507936e-4,
271  -5.952380952380952e-4,
272  8.417508417508417e-4,
273  -1.917526917526917e-3,
274  6.410256410256410e-3,
275  -2.955065359477124e-2,
276  1.796443723688305e-1,
277  -1.392432216905901
278  };
279 
280  static const double hf = 0.5;
281 
282  double x = real(z);
283  double y = imag(z);
284  h = 0;
285 
286  if (y == 0 && -abs(x) == int(x)) {
287  return 0;
288  }
289  else {
290  double ya = abs(y);
291  if (x < 0) {
292  u = double(1.) - complex<double>(x, ya);
293  }
294  else {
295  u = complex<double>(x, ya);
296  }
297 
298  h = 0;
299  double ur = real(u);
300  double ui, a;
301  if (ur < 7.) {
302  ui = imag(u);
303  a = atan2(ui,ur);
304  h = u;
305  for (int i=1; i<=6-int(ur); i++) {
306  ur = ur + 1;
307  u = complex<double>(ur, ui);
308  h = h * u;
309  a = a + atan2(ui, ur);
310  }
311  h = complex<double>(hf * log(pow(real(h),2) + pow(imag(h),2)),
312  a);
313 
314  u = double(1.) + u;
315  }
316 
317  r = double(1.) / pow(u,2);
318  p = r * c[9];
319 
320  for (int i=8; i>=1; i--) {
321  p = r * (c[i] + p);
322  }
323 
324  h = c1 + (u-hf)*log(u) - u + (c[0]+p) / u - h;
325 
326  if (x < 0.) {
327  ur = double(int(x)) - 1.;
328  ui = pi * (x-ur);
329  x = pi * ya;
330  double t = exp(-x-x);
331  a = sin(ui);
332  t = x + hf * log(t*pow(a,2)+pow(hf*(1.-t),2));
333  a = atan2(cos(ui)*tanh(x),a) - ur*pi;
334  h = c2 - complex<double>(t,a) - h;
335  }
336  if (y < 0) {
337  h = conj(h);
338  }
339  }
340 
341  return h;
342  }
343 
344  void slfact(double p, double z, double radf, double xl[4]) {
345 
346  double ff[4];
347  double dfac[4]= {1.0, 3.0, 15.0, 105.0};
348  double pi,c137,az,w,rad,pr,y,x1,gk,bb,cc,dd,x2;
349 
350  complex<double> aa;
351 
352  pi = acos(-1.0);
353  c137= 137.036; // 1/ fine structure constant
354  az = z/c137;
355  w = sqrt(p*p+1.0);
356  rad = radf/386.159;
357  pr = p*rad;
358  y = az*w/p;
359 
360  for (int k=1; k<=4; k++) {
361 
362  gk = sqrt(k*k-az*az);
363  x1 = pow((pow(p,k-1)/dfac[k-1]),2);
364 
365  aa = clgamma(complex<double>(gk,y));
366  double aa_real = real(aa);
367 
368  bb=lgamma((double)k);
369  cc=lgamma(2.0*k +1.0);
370  dd=lgamma(2.0*gk+1.0);
371 
372  ff[k-1] =
373  pow(2.0*pr, 2.0*(gk-k)) *
374  exp(pi*y+2.0*(aa_real+cc-bb-dd)) *
375  (k+gk)/(2.0*k);
376 
377  x2 =
378  1.0 -
379  az*pr*(2.0*w*(2.0*k+1.0)/(p*k*(2.0*gk+1.0)) -
380  2.0*p*gk/(w*k*(2.0*gk+1.0))) -
381  2.0*k*pr*pr/((2.0*k+1.0)*(k+gk));
382  xl[k-1] = x1*ff[k-1]/ff[0]*x2;
383  }
384 
385  return;
386  }
387 
388  void bsp(double e, double &bspec, double &factor) {
389 
390  // *****************************************************************
391  // Calculates n(e) (unnormalized) for one spectral component,
392  // specified by:zz,emax,lamda, where
393  //
394  // lamda = 1 first forbidden
395  // lamda = 2 second forbidden
396  // lamda = 3 third forbidden
397  // lamda = 0 otherwise
398  // lamda = 4 for a few nuclides whose experimental shape don't
399  // fit theory. fudge factors are applied to the allowed
400  // shape.
401  // zz charge of the daughter nucleus
402  // emax maximum beta energy in mev.
403  // w and tsq in mc**2 units
404  // e and emax in mev units.
405  // v is the screening correction for atomic electrons
406  // for the thomas-fermi model of the atom
407  // v = 1.13 * (alpha)**2 * z**(4/3)
408  //
409  //
410 
411  double pi,c137,zab,v,z,x,w,psq,p,y,qsq,g,cab,f,radf;
412 
413  double xl[4];
414  complex<double> c;
415  complex<double> a;
416 
417  bspec=0.0;
418  if (e>emax) {
419  return;
420  }
421 
422  pi =acos(-1.);
423  c137=137.036; // 1/ fine structure constant
424 
425  zab = abs(zz);
426  v = 1.13*pow(zab,1.333)/pow(c137,2); // Screening correction
427  v = copysign(v,zz);
428  z = zab/c137;
429  x = sqrt(1.0-z*z); // s parameter
430  w = 1.0+(e/rm)-v; // Total energy of b particle
431  if (w<1.0000001) {
432  bspec = 0.;
433  return;
434  }
435  //if(w<1.00001) w=1.00001;
436  psq = w*w-double(1.0);
437  p = sqrt(psq); // Momemtum of beta particle
438  y = z*w/p; // eta = alpha * z * e / p
439  y = copysign(y,zz);
440  qsq = 3.83*pow(emax-e,2);
441 
442  if (e <= 1.0e-5) {
443  g=0.0; // Low energy approximation
444  if (zz>=0.0) {
445  g = qsq*2.0*pi*pow(z,(2.0*x-1.0));
446  }
447  }
448  else {
449  a = complex<double>(x,y);
450  c = cgamma(a);
451  cab = abs(c);
452  f = pow(psq,x-1.0)*exp(pi*y)*pow(cab,2);
453  g = f*p*w*qsq;
454  }
455 
456  factor = 1.0; // Necessary to calculate kurie plot (not done)
457  bspec = g;
458  if (lam == 0) {
459  return;
460  }
461 
462  radf = 1.2*pow(rmass,0.333); // Nuclear radius
463  slfact(p,zz,radf,xl);
464 
465  if (lam==1) {
466  bspec = g*(qsq*xl[0]+9.0*xl[1]);
467  return;
468  }
469  else if (lam==2) {
470  bspec = g*(pow(qsq,2)*xl[0]+30.0*qsq*xl[1]+225.0*xl[2]);
471  return;
472  }
473  else if (lam==3) {
474  bspec = g*(pow(qsq,3.0)*xl[0]+63.0*pow(qsq,2)*xl[1]+
475  1575.0*qsq*xl[2] + 11025.0*xl[3]);
476  return;
477  }
478  else { // lam==4
479 
480  // Fudge factors for nuclides whose experimental spectra don't
481  // seem to fit theory.
482 
483  // for cl36 (ref: nuc. phys. 99a, 625,(67))
484  if (zab == 18.0) {
485  bspec = bspec*(qsq*xl[0]+20.07*xl[1]);
486  }
487 
488  // for i129 (ref: phys. rev. 95, 458, 54))
489  if (zab == 54.) {
490  bspec = bspec*(psq+10.0*qsq);
491  }
492 
493  // for cs-ba137 (ref: nuc. phys. 112a, 156, (68))
494  if (zab == 56.) {
495  bspec = bspec*(qsq*xl[0]+0.045*xl[1]);
496  }
497 
498  // for tl204 (ref: can. j. phys., 45, 2621, (67))
499  if (zab == 82.) {
500  bspec = bspec*(1.0-1.677*e+ 2.77*e*e);
501  }
502 
503  // for bi210 (ref: nuc. phys., 31, 293, (62))
504  if (zab == 84.) {
505  bspec = bspec*(1.78-2.35*e+e*e);
506  }
507 
508  return;
509  }
510  }
511 
512  // Sums weighted, normalized spectral components to give total spectrum
513  void sp(double e, double &spec, double &factor) {
514 
515  double bspec;
516 
517  spec=0.0;
518  for (int icomp=0; icomp<ncomps; icomp++) {
519  zz = zzz[icomp];
520  emax= etop[icomp];
521  lam = lamda[icomp];
522  bsp(e,bspec,factor);
523  spec= spec+bspec*rel[icomp]/area[icomp];
524  }
525  }
526 
527 private:
528  EGS_Float rm;
529  double zz,emax,rmass;
530  double zzz[9],etop[9],rel[9],area[9],lamda[9];
531  int lam, ncomps;
532 };
533 
652 
653 public:
656  EGS_RadionuclideSpectrum(const string nuclide, const string ensdf_file,
657  const EGS_Float relativeActivity, const string relaxType, const string outputBetaSpectra, const bool scoreAlphasLocally, const bool allowMultiTransition);
658 
661  if (decays) {
662  delete decays;
663  }
664  if (betaSpectra) {
665  delete betaSpectra;
666  }
667  };
668 
676  EGS_Float maxEnergy() const {
677  return Emax;
678  };
679 
681  int getCharge() const {
682  return currentQ;
683  }
684 
686  double getTime() const {
687  return currentTime;
688  }
689 
691  EGS_I64 getShowerIndex() const {
692  return ishower;
693  }
694 
696  EGS_Float getEdep() const {
697  return edep;
698  }
699 
701  EGS_Float getSpectrumWeight() const {
702  return spectrumWeight;
703  }
704 
706  void setSpectrumWeight(EGS_Float newWeight) {
707  spectrumWeight = newWeight;
708  }
709 
728  unsigned int getEmissionType() const {
729  return emissionType;
730  }
731 
734  void printSampledEmissions();
735 
736  EGS_Ensdf *getRadionuclideEnsdf() {
737  return decays;
738  }
739 
740  bool storeState(ostream &data) const {
741  return egsStoreI64(data,ishower);
742  }
743 
744  bool setState(istream &data) {
745  return egsGetI64(data,ishower);
746  }
747 
748  void resetCounter() {
749  currentLevel = 0;
750  currentTime = 0;
751  ishower = -1;
752  totalGammaEnergy = 0;
753  }
754 
756  EGS_Float sample(EGS_RandomGenerator *rndm);
757 
758 private:
759 
760  EGS_Ensdf *decays;
761  vector<BetaRecordLeaf *> myBetas;
762  vector<AlphaRecord *> myAlphas;
763  vector<GammaRecord *> myGammas,
764  myMetastableGammas,
765  myUncorrelatedGammas;
766  vector<LevelRecord *> myLevels;
767  vector<double> xrayIntensities,
768  xrayEnergies,
769  augerIntensities,
770  augerEnergies;
771  vector<EGS_I64> numSampledXRay,
772  numSampledAuger;
773  vector<const LevelRecord *> multiTransitions;
775  const LevelRecord *currentLevel;
776  int currentQ;
777  unsigned int emissionType;
778  EGS_Float currentTime,
779  Emax,
780  spectrumWeight,
781  totalGammaEnergy,
782  edep;
783  EGS_I64 ishower;
784  string relaxationType;
785  bool scoreAlphasLocal;
786 
787  EGS_RadionuclideBetaSpectrum *betaSpectra;
788  EGS_Application *app;
789 };
790 
987 class EGS_RADIONUCLIDE_SOURCE_EXPORT EGS_RadionuclideSource :
988  public EGS_BaseSource {
989 
990 public:
991 
994 
997  if (baseSource)
998  if (!baseSource->deref()) {
999  delete baseSource;
1000  }
1001 
1002  for (vector<EGS_RadionuclideSpectrum * >::iterator it =
1003  decays.begin();
1004  it!=decays.end(); it++) {
1005  delete *it;
1006  *it=0;
1007  }
1008  decays.clear();
1009  };
1010 
1012  EGS_I64 getNextParticle(EGS_RandomGenerator *rndm,
1013  int &q, int &latch, EGS_Float &E, EGS_Float &wt,
1014  EGS_Vector &x, EGS_Vector &u);
1015 
1017  EGS_Float getEmax() const {
1018  return Emax;
1019  };
1020 
1022  EGS_Float getFluence() const {
1023  return (ishower+1)*(baseSource->getFluence()/sCount);
1024  };
1025 
1027  double getTime() const {
1028  return time;
1029  };
1030 
1032  double getLastTime() const {
1033  return lastDisintTime;
1034  };
1035 
1042  double getExperimentTime() const {
1043  return experimentTime;
1044  };
1045 
1047  EGS_I64 getShowerIndex() const {
1048  return ishower;
1049  };
1050 
1051  unsigned int getEmissionType() const {
1052  return emissionType;
1053  }
1054 
1057  egsInformation("\n======================================================\n");
1058  egsInformation("Start of source emissions statistics:\n");
1059  for (unsigned int i=0; i<decays.size(); ++i) {
1060  decays[i]->printSampledEmissions();
1061  }
1062  egsInformation("End of source emissions statistics\n");
1063  egsInformation("======================================================\n\n");
1064  };
1065 
1067  bool isValid() const {
1068  return baseSource;
1069  };
1070 
1076  bool storeState(ostream &data_out) const;
1077 
1084  bool addState(istream &data);
1085 
1092  void resetCounter();
1093 
1100  bool setState(istream &data);
1101 
1102  EGS_RadionuclideSpectrum *createSpectrum(EGS_Input *input);
1103 
1104  vector<EGS_Ensdf *> getRadionuclideEnsdf() {
1105  vector<EGS_Ensdf *> decayEnsdf;
1106  for (auto dec: decays) {
1107  decayEnsdf.push_back(dec->getRadionuclideEnsdf());
1108  }
1109  return decayEnsdf;
1110  }
1111 
1112 private:
1113  EGS_Application *app;
1114 
1115  EGS_I64 count;
1116  EGS_Float Emax;
1117 
1118  void setUp();
1119 
1120  string sName;
1121  EGS_I64 sCount;
1122  EGS_BaseSource *baseSource;
1123 
1124  vector<int> q_allowed;
1125  vector<EGS_RadionuclideSpectrum *> decays;
1126  EGS_Float activity;
1127 
1128  bool q_allowAll;
1129  bool disintegrationOccurred;
1130  EGS_Float time,
1131  experimentTime,
1132  lastDisintTime;
1133  EGS_I64 ishower;
1134  EGS_Vector xOfDisintegration;
1135 
1136  unsigned int emissionType;
1137 };
1138 
1139 #endif
A class for sampling random values from a given probability distribution using the alias table techni...
Base class for advanced EGSnrc C++ applications.
static EGS_Application * activeApplication()
Get the active application.
const string & getOutputFile() const
Returns the base name of the output file(s)
const string & getAppDir() const
Returns the absolute path to the user code directory.
Base source class. All particle sources must be derived from this class.
virtual bool addState(istream &data_in)
Add data from the stream data_in to the source state.
virtual void resetCounter()
Reset the source state.
virtual EGS_I64 getNextParticle(EGS_RandomGenerator *rndm, int &q, int &latch, EGS_Float &E, EGS_Float &wt, EGS_Vector &x, EGS_Vector &u)=0
Sample the next source particle from the source probability distribution.
virtual bool setState(istream &data_in)
Set the source state based on data from the stream data_in.
virtual vector< EGS_Ensdf * > getRadionuclideEnsdf()
Get the radionuclide ENSDF object from the source.
virtual bool storeState(ostream &data_out) const
Store the source state into the stream data_out.
The ensdf class for reading ensdf format data files.
Definition: egs_ensdf.h:505
A class for storing information in a tree-like structure of key-value pairs. This class is used throu...
Definition: egs_input.h:182
An object factory.
Beta spectrum generation for EGS_RadionuclideSpectrum.
EGS_RadionuclideBetaSpectrum(EGS_Ensdf *decays, const string outputBetaSpectra)
Construct beta spectra for a radionuclide.
A radionuclide source.
double getTime() const
Returns the emission time of the most recent particle.
EGS_Float getEmax() const
Returns the maximum energy out of all the spectra.
void printSampledEmissions()
Outputs the emission stats of the spectra.
EGS_Float getFluence() const
Returns the current fluence (number of disintegrations)
bool isValid() const
Checks the validity of the source.
double getLastTime() const
Returns the time of the last emission for decay.
double getExperimentTime() const
Get the total possible length of the experiment that is being modelled.
EGS_I64 getShowerIndex() const
Returns the shower index of the most recent particle.
A radionuclide spectrum.
unsigned int getEmissionType() const
Get the emission type of the most recent source particle.
EGS_Float getSpectrumWeight() const
Get the relative weight assigned to this spectrum.
EGS_Float maxEnergy() const
Returns the maximum energy that may be emitted.
EGS_I64 getShowerIndex() const
Get the shower index of the most recent emission.
double getTime() const
Get the emission time of the most recent emission.
EGS_Float getEdep() const
Get energy that should be deposited locally from relaxations/alphas.
void setSpectrumWeight(EGS_Float newWeight)
Set the relative weight assigned to this spectrum.
int getCharge() const
Get the charge of the most recent emission.
Base random number generator class. All random number generators should be derived from this class.
Definition: egs_rndm.h:90
A class representing 3D vectors.
Definition: egs_vector.h:57
EGS_Application class header file.
EGS_BaseGeometry class header file.
EGS_BaseSource class header file.
The ensdf implementation.
#define EGS_EXPORT
Export symbols from the egspp library.
Definition: egs_libconfig.h:90
Attempts to fix broken math header files.
EGS_RandomGenerator class header file.
EGS_BaseShape and shape classes header file.
EGS_Vector methods for the manipulation of 3D vectors in cartesian co-ordinates.
bool EGS_EXPORT egsStoreI64(ostream &data, EGS_I64 n)
Writes the 64 bit integer n to the output stream data and returns true on success,...
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
bool egsIsAbsolutePath(const string &path)
Does the string path represent an absolute path name?
bool EGS_EXPORT egsGetI64(istream &data, EGS_I64 &n)
Reads a 64 bit integer from the stream data and assigns it to n. Returns true on success,...
string egsJoinPath(const string &first, const string &second)
Join two path variables (or a path and a file name) using the platform specific directory separator a...