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 #
28 ###############################################################################
29 */
30 
31 
37 #ifndef EGS_RADIONUCLIDE_SOURCE_
38 #define EGS_RADIONUCLIDE_SOURCE_
39 
40 #include "egs_vector.h"
41 #include "egs_base_source.h"
42 #include "egs_rndm.h"
43 #include "egs_shapes.h"
44 #include "egs_base_geometry.h"
45 #include "egs_math.h"
46 #include "egs_application.h"
47 #include "egs_ensdf.cpp"
48 
49 #include <algorithm>
50 #include <complex>
51 
52 
53 #ifdef WIN32
54 
55  #ifdef BUILD_RADIONUCLIDE_SOURCE_DLL
56  #define EGS_RADIONUCLIDE_SOURCE_EXPORT __declspec(dllexport)
57  #else
58  #define EGS_RADIONUCLIDE_SOURCE_EXPORT __declspec(dllimport)
59  #endif
60  #define EGS_RADIONUCLIDE_SOURCE_LOCAL
61 
62 #else
63 
64  #ifdef HAVE_VISIBILITY
65  #define EGS_RADIONUCLIDE_SOURCE_EXPORT __attribute__ ((visibility ("default")))
66  #define EGS_RADIONUCLIDE_SOURCE_LOCAL __attribute__ ((visibility ("hidden")))
67  #else
68  #define EGS_RADIONUCLIDE_SOURCE_EXPORT
69  #define EGS_RADIONUCLIDE_SOURCE_LOCAL
70  #endif
71 
72 #endif
73 
85 
86 public:
89  EGS_RadionuclideBetaSpectrum(EGS_Ensdf *decays, const string outputBetaSpectra) {
90 
92  rm = app->getRM();
93 
94  vector<BetaRecordLeaf *> myBetas = decays->getBetaRecords();
95 
96  for (vector<BetaRecordLeaf *>::iterator beta = myBetas.begin();
97  beta != myBetas.end(); beta++) {
98 
99  // Skip electron capture records
100  if ((*beta)->getCharge() == 1 &&
101  (*beta)->getPositronIntensity() == 0) {
102  continue;
103  }
104 
105  unsigned short int daughterZ = (*beta)->getZ();
106 
107  egsInformation("EGS_RadionuclideBetaSpectrum: "
108  "Energy, Z, A, forbidden: %f %d %d %d\n",
109  (*beta)->getFinalEnergy(), daughterZ,
110  (*beta)->getAtomicWeight(), (*beta)->getForbidden()
111  );
112 
113  const int nbin=1000;
114  EGS_Float *e = new EGS_Float [nbin];
115  EGS_Float *spec = new EGS_Float [nbin];
116  EGS_Float *spec_y = new EGS_Float [nbin];
117 
118  double de, s_y, factor, se_y;
119 
120  ncomps=1; // if we increase this, then we must fill the remainder
121  area[0]=1.0;
122  rel[0]=1.0;
123 
124  emax = (*beta)->getFinalEnergy();
125  zzz[0] = (double)daughterZ;
126  rmass = (*beta)->getAtomicWeight();
127 
128  // These are some special cases where fudge factors are used!
129  // Specify lamda[0]=4 for special shape factors
130 
131  // For Cl-36 (ref: nuc. phys. 99a, 625,(67))
132  // Only the beta- spectrum
133  if (daughterZ == 18 && (*beta)->getCharge() == -1) {
134  lamda[0] = 4;
135  }
136  // For I-129 (ref: phys. rev. 95, 458, 54))
137  // The beta- spectrum with 151 keV endpoint
138  else if (daughterZ == 54 && emax < 0.154 && emax > 0.150) {
139  lamda[0] = 4;
140  }
141  // For Cs-137 (ref: nuc. phys. 112a, 156, (68))
142  // The beta- spectrum with 1175 keV endpoint
143  else if (daughterZ == 56 && emax > 1.173 && emax < 1.177) {
144  lamda[0] = 4;
145  }
146  // For Tl-204 (ref: can. j. phys., 45, 2621, (67))
147  // There is only 1 beta- spectrum
148  else if (daughterZ == 82) {
149  lamda[0] = 4;
150  }
151  // For Bi-210 (ref: nuc. phys., 31, 293, (62))
152  // There is only 1 beta- spectrum
153  else if (daughterZ == 84) {
154  lamda[0] = 4;
155  }
156  else {
157  lamda[0] = (*beta)->getForbidden();
158  }
159 
160  // For positrons from zzz negative (just how the spectrum code
161  // was designed)
162  if ((*beta)->getCharge() == 1) {
163  zzz[0] *= -1;
164  }
165 
166  etop[0]=emax;
167 
168  // prbs july 9, 2007 moved here from before src loop.
169  // also, now tabulate based on
170  // endpoint, using roughly nbin bins across spectrum. Do this by
171  // rounding
172  // endpoint E0 up to nearest 100 keV, and dividing by NBIN to get
173  // binwidth.
174 
175  de=((int)(etop[0]*10.0+1)/10.)/nbin; // round up to nearest 100kev;
176  // /= NBIN
177  //cout << "Binwidth " << de << endl;
178 
179  for (int ib=0; ib<nbin; ib++) {
180  e[ib]=de+ib*de;
181 // egsInformation("%.12f, %.12f\n", e[ib], etop[0]);
182  }
183 
184  s_y=0.0;
185  se_y=0.0;
186  for (int ib=0; ib<nbin; ib++) {
187 
188  if (e[ib]<=emax) {
189  sp(e[ib],spec_y[ib],factor);
190  }
191  else {
192  spec_y[ib]=0.0;
193  }
194 
195  s_y=s_y+spec_y[ib];
196  se_y=se_y+spec_y[ib]*e[ib];
197  }
198 
199  for (int ib=0; ib<nbin; ib++) {
200  spec[ib]=1/de*(spec_y[ib]/s_y);
201 // cout << e[ib] << " " << spec[ib] << endl;
202  }
203 
204  EGS_AliasTable *bspec = new EGS_AliasTable(nbin,e,spec,1);
205  (*beta)->setSpectrum(bspec);
206 
207  // Write the spectrum to a file
208  if (outputBetaSpectra == "yes") {
209 
210  ostringstream ostr;
211  ostr << decays->radionuclide << "_" << emax << ".spec";
212 
213  egsInformation("EGS_RadionuclideBetaSpectrum: Outputting beta spectrum to file: %s\n", ostr.str().c_str());
214 
215  ofstream specStream;
216  specStream.open(ostr.str().c_str());
217  for (int ib=0; ib<nbin; ib++) {
218  spec[ib]=1/de*(spec_y[ib]/s_y);
219  specStream << e[ib] << " " << spec[ib] << endl;
220  }
221  specStream.close();
222  }
223  }
224  }
225 
226 protected:
227 
228  complex<double> cgamma(complex<double> z) {
229 
230  static const int g=7;
231  static const double pi = 3.1415926535897932384626433832795028841972;
232  static const double p[g+2] = {0.99999999999980993, 676.5203681218851,
233  -1259.1392167224028,
234  771.32342877765313,
235  -176.61502916214059,
236  12.507343278686905,
237  -0.13857109526572012,
238  9.9843695780195716e-6,
239  1.5056327351493116e-7
240  };
241 
242  if (real(z)<0.5) {
243  return pi / (sin(pi*z)*cgamma(double(1.0)-z));
244  }
245 
246  z -= 1.0;
247  complex<double> x=p[0];
248  for (int i=1; i<g+2; i++) {
249  x += p[i]/(z+complex<double>(i,0));
250  }
251  complex<double> t = z + (g + double(0.5));
252 
253  return double(sqrt(2.*pi)) * pow(t,z+double(0.5)) * exp(-t) * x;
254  }
255 
256  complex<double> clgamma(complex<double> z) {
257  complex<double> u, v, h, p, r;
258 
259  static const double pi = 3.1415926535897932384626433832795028841972;
260  static const double c1 = 9.189385332046727e-1;
261  static const double c2 = 1.144729885849400;
262  static const double c[10] = {8.333333333333333e-2,
263  -2.777777777777777e-3,
264  7.936507936507936e-4,
265  -5.952380952380952e-4,
266  8.417508417508417e-4,
267  -1.917526917526917e-3,
268  6.410256410256410e-3,
269  -2.955065359477124e-2,
270  1.796443723688305e-1,
271  -1.392432216905901
272  };
273 
274  static const double hf = 0.5;
275 
276  double x = real(z);
277  double y = imag(z);
278  h = 0;
279 
280  if (y == 0 && -abs(x) == int(x)) {
281  return 0;
282  }
283  else {
284  double ya = abs(y);
285  if (x < 0) {
286  u = double(1.) - complex<double>(x, ya);
287  }
288  else {
289  u = complex<double>(x, ya);
290  }
291 
292  h = 0;
293  double ur = real(u);
294  double ui, a;
295  if (ur < 7.) {
296  ui = imag(u);
297  a = atan2(ui,ur);
298  h = u;
299  for (int i=1; i<=6-int(ur); i++) {
300  ur = ur + 1;
301  u = complex<double>(ur, ui);
302  h = h * u;
303  a = a + atan2(ui, ur);
304  }
305  h = complex<double>(hf * log(pow(real(h),2) + pow(imag(h),2)),
306  a);
307 
308  u = double(1.) + u;
309  }
310 
311  r = double(1.) / pow(u,2);
312  p = r * c[9];
313 
314  for (int i=8; i>=1; i--) {
315  p = r * (c[i] + p);
316  }
317 
318  h = c1 + (u-hf)*log(u) - u + (c[0]+p) / u - h;
319 
320  if (x < 0.) {
321  ur = double(int(x)) - 1.;
322  ui = pi * (x-ur);
323  x = pi * ya;
324  double t = exp(-x-x);
325  a = sin(ui);
326  t = x + hf * log(t*pow(a,2)+pow(hf*(1.-t),2));
327  a = atan2(cos(ui)*tanh(x),a) - ur*pi;
328  h = c2 - complex<double>(t,a) - h;
329  }
330  if (y < 0) {
331  h = conj(h);
332  }
333  }
334 
335  return h;
336  }
337 
338  void slfact(double p, double z, double radf, double xl[4]) {
339 
340  double ff[4];
341  double dfac[4]= {1.0, 3.0, 15.0, 105.0};
342  double pi,c137,az,w,rad,pr,y,x1,gk,bb,cc,dd,x2;
343 
344  complex<double> aa;
345 
346  pi = acos(-1.0);
347  c137= 137.036; // 1/ fine structure constant
348  az = z/c137;
349  w = sqrt(p*p+1.0);
350  rad = radf/386.159;
351  pr = p*rad;
352  y = az*w/p;
353 
354  for (int k=1; k<=4; k++) {
355 
356  gk = sqrt(k*k-az*az);
357  x1 = pow((pow(p,k-1)/dfac[k-1]),2);
358 
359  aa = clgamma(complex<double>(gk,y));
360  double aa_real = real(aa);
361 
362  bb=lgamma((double)k);
363  cc=lgamma(2.0*k +1.0);
364  dd=lgamma(2.0*gk+1.0);
365 
366  ff[k-1] =
367  pow(2.0*pr, 2.0*(gk-k)) *
368  exp(pi*y+2.0*(aa_real+cc-bb-dd)) *
369  (k+gk)/(2.0*k);
370 
371  x2 =
372  1.0 -
373  az*pr*(2.0*w*(2.0*k+1.0)/(p*k*(2.0*gk+1.0)) -
374  2.0*p*gk/(w*k*(2.0*gk+1.0))) -
375  2.0*k*pr*pr/((2.0*k+1.0)*(k+gk));
376  xl[k-1] = x1*ff[k-1]/ff[0]*x2;
377  }
378 
379  return;
380  }
381 
382  void bsp(double e, double &bspec, double &factor) {
383 
384  // *****************************************************************
385  // Calculates n(e) (unnormalized) for one spectral component,
386  // specified by:zz,emax,lamda, where
387  //
388  // lamda = 1 first forbidden
389  // lamda = 2 second forbidden
390  // lamda = 3 third forbidden
391  // lamda = 0 otherwise
392  // lamda = 4 for a few nuclides whose experimental shape don't
393  // fit theory. fudge factors are applied to the allowed
394  // shape.
395  // zz charge of the daughter nucleus
396  // emax maximum beta energy in mev.
397  // w and tsq in mc**2 units
398  // e and emax in mev units.
399  // v is the screening correction for atomic electrons
400  // for the thomas-fermi model of the atom
401  // v = 1.13 * (alpha)**2 * z**(4/3)
402  //
403  //
404 
405  double pi,c137,zab,v,z,x,w,psq,p,y,qsq,g,cab,f,radf;
406 
407  double xl[4];
408  complex<double> c;
409  complex<double> a;
410 
411  bspec=0.0;
412  if (e>emax) {
413  return;
414  }
415 
416  pi =acos(-1.);
417  c137=137.036; // 1/ fine structure constant
418 
419  zab = abs(zz);
420  v = 1.13*pow(zab,1.333)/pow(c137,2); // Screening correction
421  v = copysign(v,zz);
422  z = zab/c137;
423  x = sqrt(1.0-z*z); // s parameter
424  w = 1.0+(e/rm)-v; // Total energy of b particle
425  if (w<1.0000001) {
426  bspec = 0.;
427  return;
428  }
429  //if(w<1.00001) w=1.00001;
430  psq = w*w-double(1.0);
431  p = sqrt(psq); // Momemtum of beta particle
432  y = z*w/p; // eta = alpha * z * e / p
433  y = copysign(y,zz);
434  qsq = 3.83*pow(emax-e,2);
435 
436  if (e <= 1.0e-5) {
437  g=0.0; // Low energy approximation
438  if (zz>=0.0) {
439  g = qsq*2.0*pi*pow(z,(2.0*x-1.0));
440  }
441  }
442  else {
443  a = complex<double>(x,y);
444  c = cgamma(a);
445  cab = abs(c);
446  f = pow(psq,x-1.0)*exp(pi*y)*pow(cab,2);
447  g = f*p*w*qsq;
448  }
449 
450  factor = 1.0; // Necessary to calculate kurie plot (not done)
451  bspec = g;
452  if (lam == 0) {
453  return;
454  }
455 
456  radf = 1.2*pow(rmass,0.333); // Nuclear radius
457  slfact(p,zz,radf,xl);
458 
459  if (lam==1) {
460  bspec = g*(qsq*xl[0]+9.0*xl[1]);
461  return;
462  }
463  else if (lam==2) {
464  bspec = g*(pow(qsq,2)*xl[0]+30.0*qsq*xl[1]+225.0*xl[2]);
465  return;
466  }
467  else if (lam==3) {
468  bspec = g*(pow(qsq,3.0)*xl[0]+63.0*pow(qsq,2)*xl[1]+
469  1575.0*qsq*xl[2] + 11025.0*xl[3]);
470  return;
471  }
472  else { // lam==4
473 
474  // Fudge factors for nuclides whose experimental spectra don't
475  // seem to fit theory.
476 
477  // for cl36 (ref: nuc. phys. 99a, 625,(67))
478  if (zab == 18.0) {
479  bspec = bspec*(qsq*xl[0]+20.07*xl[1]);
480  }
481 
482  // for i129 (ref: phys. rev. 95, 458, 54))
483  if (zab == 54.) {
484  bspec = bspec*(psq+10.0*qsq);
485  }
486 
487  // for cs-ba137 (ref: nuc. phys. 112a, 156, (68))
488  if (zab == 56.) {
489  bspec = bspec*(qsq*xl[0]+0.045*xl[1]);
490  }
491 
492  // for tl204 (ref: can. j. phys., 45, 2621, (67))
493  if (zab == 82.) {
494  bspec = bspec*(1.0-1.677*e+ 2.77*e*e);
495  }
496 
497  // for bi210 (ref: nuc. phys., 31, 293, (62))
498  if (zab == 84.) {
499  bspec = bspec*(1.78-2.35*e+e*e);
500  }
501 
502  return;
503  }
504  }
505 
506  // Sums weighted, normalized spectral components to give total spectrum
507  void sp(double e, double &spec, double &factor) {
508 
509  double bspec;
510 
511  spec=0.0;
512  for (int icomp=0; icomp<ncomps; icomp++) {
513  zz = zzz[icomp];
514  emax= etop[icomp];
515  lam = lamda[icomp];
516  bsp(e,bspec,factor);
517  spec= spec+bspec*rel[icomp]/area[icomp];
518  }
519  }
520 
521 private:
522  EGS_Float rm;
523  double zz,emax,rmass;
524  double zzz[9],etop[9],rel[9],area[9],lamda[9];
525  int lam, ncomps;
526 };
527 
646 
647 public:
650  EGS_RadionuclideSpectrum(const string nuclide, const string ensdf_file,
651  const EGS_Float relativeActivity, const string relaxType, const string outputBetaSpectra, const bool scoreAlphasLocally, const bool allowMultiTransition);
652 
655  if (decays) {
656  delete decays;
657  }
658  if (betaSpectra) {
659  delete betaSpectra;
660  }
661  };
662 
670  EGS_Float maxEnergy() const {
671  return Emax;
672  };
673 
675  int getCharge() const {
676  return currentQ;
677  }
678 
680  double getTime() const {
681  return currentTime;
682  }
683 
685  EGS_I64 getShowerIndex() const {
686  return ishower;
687  }
688 
690  EGS_Float getEdep() const {
691  return edep;
692  }
693 
695  EGS_Float getSpectrumWeight() const {
696  return spectrumWeight;
697  }
698 
700  void setSpectrumWeight(EGS_Float newWeight) {
701  spectrumWeight = newWeight;
702  }
703 
722  unsigned int getEmissionType() const {
723  return emissionType;
724  }
725 
728  void printSampledEmissions();
729 
730  EGS_Ensdf *getRadionuclideEnsdf() {
731  return decays;
732  }
733 
734  bool storeState(ostream &data) const {
735  return egsStoreI64(data,ishower);
736  }
737 
738  bool setState(istream &data) {
739  return egsGetI64(data,ishower);
740  }
741 
742  void resetCounter() {
743  currentLevel = 0;
744  currentTime = 0;
745  ishower = -1;
746  totalGammaEnergy = 0;
747  }
748 
750  EGS_Float sample(EGS_RandomGenerator *rndm);
751 
752 private:
753 
754  EGS_Ensdf *decays;
755  vector<BetaRecordLeaf *> myBetas;
756  vector<AlphaRecord *> myAlphas;
757  vector<GammaRecord *> myGammas,
758  myMetastableGammas,
759  myUncorrelatedGammas;
760  vector<LevelRecord *> myLevels;
761  vector<double> xrayIntensities,
762  xrayEnergies,
763  augerIntensities,
764  augerEnergies;
765  vector<EGS_I64> numSampledXRay,
766  numSampledAuger;
767  vector<const LevelRecord *> multiTransitions;
769  const LevelRecord *currentLevel;
770  int currentQ;
771  unsigned int emissionType;
772  EGS_Float currentTime,
773  Emax,
774  spectrumWeight,
775  totalGammaEnergy,
776  edep;
777  EGS_I64 ishower;
778  string relaxationType;
779  bool scoreAlphasLocal;
780 
781  EGS_RadionuclideBetaSpectrum *betaSpectra;
782  EGS_Application *app;
783 };
784 
981 class EGS_RADIONUCLIDE_SOURCE_EXPORT EGS_RadionuclideSource :
982  public EGS_BaseSource {
983 
984 public:
985 
988 
991  if (baseSource)
992  if (!baseSource->deref()) {
993  delete baseSource;
994  }
995 
996  for (vector<EGS_RadionuclideSpectrum * >::iterator it =
997  decays.begin();
998  it!=decays.end(); it++) {
999  delete *it;
1000  *it=0;
1001  }
1002  decays.clear();
1003  };
1004 
1006  EGS_I64 getNextParticle(EGS_RandomGenerator *rndm,
1007  int &q, int &latch, EGS_Float &E, EGS_Float &wt,
1008  EGS_Vector &x, EGS_Vector &u);
1009 
1011  EGS_Float getEmax() const {
1012  return Emax;
1013  };
1014 
1016  EGS_Float getFluence() const {
1017  return (ishower+1)*(baseSource->getFluence()/sCount);
1018  };
1019 
1021  double getTime() const {
1022  return time;
1023  };
1024 
1031  double getExperimentTime() const {
1032  return experimentTime;
1033  };
1034 
1036  EGS_I64 getShowerIndex() const {
1037  return ishower;
1038  };
1039 
1040  unsigned int getEmissionType() const {
1041  return emissionType;
1042  }
1043 
1046  egsInformation("\n======================================================\n");
1047  egsInformation("Start of source emissions statistics:\n");
1048  for (unsigned int i=0; i<decays.size(); ++i) {
1049  decays[i]->printSampledEmissions();
1050  }
1051  egsInformation("End of source emissions statistics\n");
1052  egsInformation("======================================================\n\n");
1053  };
1054 
1056  bool isValid() const {
1057  return baseSource;
1058  };
1059 
1065  bool storeState(ostream &data_out) const;
1066 
1073  bool addState(istream &data);
1074 
1081  void resetCounter();
1082 
1089  bool setState(istream &data);
1090 
1091  EGS_RadionuclideSpectrum *createSpectrum(EGS_Input *input);
1092 
1093  vector<EGS_Ensdf *> getRadionuclideEnsdf() {
1094  vector<EGS_Ensdf *> decayEnsdf;
1095  for (auto dec: decays) {
1096  decayEnsdf.push_back(dec->getRadionuclideEnsdf());
1097  }
1098  return decayEnsdf;
1099  }
1100 
1101 private:
1102  EGS_Application *app;
1103 
1104  EGS_I64 count;
1105  EGS_Float Emax;
1106 
1107  void setUp();
1108 
1109  string sName;
1110  EGS_I64 sCount;
1111  EGS_BaseSource *baseSource;
1112 
1113  vector<int> q_allowed;
1114  vector<EGS_RadionuclideSpectrum *> decays;
1115  EGS_Float activity;
1116 
1117  bool q_allowAll;
1118  bool disintegrationOccurred;
1119  EGS_Float time,
1120  experimentTime,
1121  lastDisintTime;
1122  EGS_I64 ishower;
1123  EGS_Vector xOfDisintegration;
1124 
1125  unsigned int emissionType;
1126 };
1127 
1128 #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.
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:492
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 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:67
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 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,...