44 static bool EGS_RADIONUCLIDE_SOURCE_LOCAL inputSet =
false;
48 baseSource(0), q_allowed(0), decays(0), activity(1), sCount(0) {
52 err = input->
getInput(
"charge", tmp_q);
54 if (std::find(q_allowed.begin(), q_allowed.end(), -1) != q_allowed.end()
55 && std::find(q_allowed.begin(), q_allowed.end(), 0) != q_allowed.end()
56 && std::find(q_allowed.begin(), q_allowed.end(), 1) != q_allowed.end()
57 && std::find(q_allowed.begin(), q_allowed.end(), 2) != q_allowed.end()
68 q_allowed.push_back(-1);
69 q_allowed.push_back(1);
70 q_allowed.push_back(0);
71 q_allowed.push_back(2);
79 EGS_Float spectrumWeightTotal = 0;
80 disintegrationOccurred =
true;
86 egsInformation(
"**********************************************\n");
88 decays.push_back(createSpectrum(input));
98 EGS_Float spectrumMaxE = decays[i]->maxEnergy();
99 if (spectrumMaxE > Emax) {
103 spectrumWeightTotal += decays[i]->getSpectrumWeight();
107 if (decays.size() < 1) {
108 egsFatal(
"\nEGS_RadionuclideSource: Error: No spectrum of type EGS_RadionuclideSpectrum was defined.\n");
112 for (i=0; i<decays.size(); ++i) {
113 decays[i]->setSpectrumWeight(
114 decays[i]->getSpectrumWeight() / spectrumWeightTotal);
117 decays[i]->setSpectrumWeight(
118 decays[i]->getSpectrumWeight() +
119 decays[i-1]->getSpectrumWeight());
125 err = input->
getInput(
"activity", tmp_A);
133 egsInformation(
"EGS_RadionuclideSource: Activity [disintegrations/s]: %e\n",
139 err = input->
getInput(
"experiment time", experimentTime);
144 if (experimentTime > 0.) {
145 egsInformation(
"EGS_RadionuclideSource: Experiment time [s]: %e\n",
149 egsInformation(
"EGS_RadionuclideSource: Experiment time will not limit the simulation.\n");
157 err = input->
getInput(
"source type",dummy);
158 int err2 = input->
getInput(
"geometry",dummy);
160 egsWarning(
"\nEGS_RadionuclideSource: Warning: Inputs for defining the radionuclide source as an isotropic or collimated source (e.g. 'source type') are deprecated. Please see the documentation - define the type of source separately and then refer to it using the new 'base source' input.\n");
164 err = input->
getInput(
"base source",sName);
166 egsFatal(
"\nEGS_RadionuclideSource: Error: Base source must be defined\n"
167 "using 'base source = some_name'\n");
171 egsFatal(
"\nEGS_RadionuclideSource: Error: no source named %s"
172 " is defined\n",sName.c_str());
182 static char spec_msg1[] =
"EGS_RadionuclideSource::createSpectrum:";
192 bool delete_it =
false;
193 if (!input->
isA(
"spectrum")) {
196 egsWarning(
"%s no 'spectrum' input!\n",spec_msg1);
202 egsInformation(
"EGS_RadionuclideSource::createSpectrum: Initializing radionuclide spectrum...\n");
205 int err = inp->getInput(
"nuclide",nuclide);
207 err = inp->getInput(
"isotope",nuclide);
209 err = inp->getInput(
"radionuclide",nuclide);
211 egsWarning(
"%s wrong/missing 'nuclide' input\n",spec_msg1);
217 EGS_Float relativeActivity;
218 err = inp->getInput(
"relative activity",relativeActivity);
220 relativeActivity = 1;
225 string tmp_relaxType, relaxType;
226 err = inp->getInput(
"atomic relaxations", tmp_relaxType);
228 relaxType = tmp_relaxType;
233 if (inp->compare(relaxType,
"ensdf")) {
235 egsInformation(
"EGS_RadionuclideSource::createSpectrum: Fluorescence and auger from the ensdf file will be used.\n");
237 else if (inp->compare(relaxType,
"eadl")) {
239 egsInformation(
"EGS_RadionuclideSource::createSpectrum: Fluorescence and auger from the ensdf file will be ignored. EADL relaxations will be used.\n");
241 else if (inp->compare(relaxType,
"none") || inp->compare(relaxType,
"off") || inp->compare(relaxType,
"no")) {
243 egsInformation(
"EGS_RadionuclideSource::createSpectrum: Fluorescence and auger from the ensdf file will be ignored. No relaxations following radionuclide disintegrations will be modelled.\n");
246 egsFatal(
"EGS_RadionuclideSource::createSpectrum: Error: Invalid selection for 'atomic relaxations'. Use 'eadl' (default), 'ensdf' or 'off'.\n");
251 string tmp_outputBetaSpectra, outputBetaSpectra;
252 err = inp->getInput(
"output beta spectra", tmp_outputBetaSpectra);
254 outputBetaSpectra = tmp_outputBetaSpectra;
256 if (inp->compare(outputBetaSpectra,
"yes")) {
257 egsInformation(
"EGS_RadionuclideSource::createSpectrum: Beta energy spectra will be output to files.\n");
259 else if (inp->compare(outputBetaSpectra,
"no")) {
260 egsInformation(
"EGS_RadionuclideSource::createSpectrum: Beta energy spectra will not be output to files.\n");
263 egsFatal(
"EGS_RadionuclideSource::createSpectrum: Error: Invalid selection for 'output beta spectra'. Use 'no' (default) or 'yes'.\n");
267 outputBetaSpectra =
"no";
272 string tmp_alphaScoring;
273 bool scoreAlphasLocally =
false;
274 err = inp->getInput(
"alpha scoring", tmp_alphaScoring);
276 if (inp->compare(tmp_alphaScoring,
"local")) {
277 scoreAlphasLocally =
true;
278 egsInformation(
"EGS_RadionuclideSource::createSpectrum: Alpha particles will deposit energy locally, in the same region as creation.\n");
280 else if (inp->compare(tmp_alphaScoring,
"discard")) {
281 scoreAlphasLocally =
false;
282 egsInformation(
"EGS_RadionuclideSource::createSpectrum: Alpha particles will be discarded (no transport or energy deposition).\n");
285 egsFatal(
"EGS_RadionuclideSource::createSpectrum: Error: Invalid selection for 'alpha scoring'. Use 'discard' (default) or 'local'.\n");
291 string tmp_allowMultiTransition;
292 bool allowMultiTransition =
false;
293 err = inp->getInput(
"extra transition approximation", tmp_allowMultiTransition);
295 if (inp->compare(tmp_allowMultiTransition,
"on")) {
296 allowMultiTransition =
true;
297 egsInformation(
"EGS_RadionuclideSource::createSpectrum: Extra transition approximation is on. If the intensity away from a level in a radionuclide daughter is larger than the intensity feeding the level (e.g. decays to that level), then additional transitions away from that level will be sampled. They will not be correlated with decays, but the spectrum will produce emission rates to match both the decay intensities and the internal transition intensities from the ensdf file.\n");
299 else if (inp->compare(tmp_allowMultiTransition,
"off")) {
300 allowMultiTransition =
false;
301 egsInformation(
"EGS_RadionuclideSource::createSpectrum: Extra transition approximation is off.\n");
304 egsFatal(
"EGS_RadionuclideSource::createSpectrum: Error: Invalid selection for 'extra transition approximation'. Use 'off' (default) or 'on'.\n");
310 err = inp->getInput(
"ensdf file",ensdf_file);
319 ensdf_file =
egsJoinPath(ensdf_file.c_str(),
"lnhb");
320 ensdf_file =
egsJoinPath(ensdf_file.c_str(),
"ensdf");
323 char *hen_house = getenv(
"HEN_HOUSE");
326 egsWarning(
"EGS_RadionuclideSource::createSpectrum: "
327 "No active application and HEN_HOUSE not defined.\n"
328 "Assuming local directory for spectra\n");
333 ensdf_file =
egsJoinPath(ensdf_file.c_str(),
"lnhb");
334 ensdf_file =
egsJoinPath(ensdf_file.c_str(),
"ensdf");
337 ensdf_file =
egsJoinPath(ensdf_file.c_str(),nuclide.append(
".txt"));
342 ensdf_fh.open(ensdf_file.c_str(),ios::in);
343 if (!ensdf_fh.is_open()) {
344 egsWarning(
"EGS_RadionuclideSource::createSpectrum: failed to open ensdf file %s"
345 " for reading\n",ensdf_file.c_str());
361 if (decays.size() > 1 && disintegrationOccurred) {
366 for (i=0; i<decays.size(); ++i) {
367 if (uRand < decays[i]->getSpectrumWeight()) {
374 if (experimentTime <= 0. || time < experimentTime) {
384 EGS_I64 ishowerOld = decays[i]->getShowerIndex();
386 E = decays[i]->sample(rndm);
388 EGS_I64 ishowerNew = decays[i]->getShowerIndex();
389 if (ishowerNew > ishowerOld) {
390 disintegrationOccurred =
true;
391 time = lastDisintTime + -log(1.-rndm->
getUniform()) / activity * (ishowerNew - ishowerOld);
393 lastDisintTime = time;
394 ishower += (ishowerNew - ishowerOld);
397 disintegrationOccurred =
false;
403 time += decays[i]->getTime();
406 q = decays[i]->getCharge();
407 int qTemp(q), latchTemp(latch);
413 if (disintegrationOccurred) {
414 xOfDisintegration = x;
417 x = xOfDisintegration;
423 EGS_Float edep = decays[i]->getEdep();
426 int ireg = app->isWhere(x);
431 if (q_allowAll || std::find(q_allowed.begin(), q_allowed.end(), q) != q_allowed.end()) {
449 void EGS_RadionuclideSource::setUp() {
450 otype =
"EGS_RadionuclideSource";
455 description =
"Radionuclide production in base source ";
459 if (std::find(q_allowed.begin(), q_allowed.end(), -1) !=
463 if (std::find(q_allowed.begin(), q_allowed.end(), 0) != q_allowed.end()) {
466 if (std::find(q_allowed.begin(), q_allowed.end(), 1) != q_allowed.end()) {
469 if (std::find(q_allowed.begin(), q_allowed.end(), 1) != q_allowed.end()) {
479 for (
unsigned int i=0; i<decays.size(); ++i) {
492 for (
unsigned int i=0; i<decays.size(); ++i) {
496 ishower += decays[i]->getShowerIndex();
509 for (
unsigned int i=0; i<decays.size(); ++i) {
510 decays[i]->resetCounter();
519 for (
unsigned int i=0; i<decays.size(); ++i) {
533 static void setInputs() {
536 setBaseSourceInputs();
538 srcBlockInput->getSingleInput(
"library")->setValues({
"egs_radionuclide_source"});
541 srcBlockInput->addSingleInput(
"activity",
false,
"The total activity of mixture, assumed constant.");
542 srcBlockInput->addSingleInput(
"experiment time",
false,
"Time length of the experiment. Depending on the activity and decay half-life, decays sampled to occur after the experiment duration are discarded.");
543 srcBlockInput->addSingleInput(
"base source",
true,
"The name of another source you have defined, that specifies the spatial distribution (e.g. an isotropic source).");
546 EGS_RADIONUCLIDE_SOURCE_EXPORT
string getExample() {
550 # Example of egs_radionuclide_source
553 library = egs_radionuclide_source
554 base source = name of the source used to generate decay locations
555 activity = [optional, default=1] total activity of mixture,
556 assumed constant. The activity only affects the
557 emission times assigned to particles.
558 charge = [optional] list including at least one of -1, 0, 1, 2
559 to include electrons, photons, positrons and alphas.
560 Filtering is applied to ALL emissions (including
561 relaxation particles).
562 Omit this option to include all charges - this is
564 experiment time = [optional, default=0] time duration of the experiment,
565 set to 0 for no time limit. Source particles generated
566 after the experiment time are not transported.
569 must be a definition of an EGS_RadionuclideSpectrum (see link below)
576 EGS_RADIONUCLIDE_SOURCE_EXPORT shared_ptr<EGS_BlockInput> getInputs() {
580 return srcBlockInput;
586 createSourceTemplate<EGS_RadionuclideSource>(input,f,
"radionuclide "
593 const EGS_Float relativeActivity,
const string relaxType,
const string outputBetaSpectra,
const bool scoreAlphasLocally,
const bool allowMultiTransition) {
603 decays =
new EGS_Ensdf(nuclide, ensdf_file, relaxType, allowMultiTransition, verbose);
606 decays->normalizeIntensities();
612 myBetas = decays->getBetaRecords();
613 myAlphas = decays->getAlphaRecords();
614 myGammas = decays->getGammaRecords();
615 myMetastableGammas = decays->getMetastableGammaRecords();
616 myUncorrelatedGammas = decays->getUncorrelatedGammaRecords();
617 myLevels = decays->getLevelRecords();
618 xrayIntensities = decays->getXRayIntensities();
619 xrayEnergies = decays->getXRayEnergies();
620 augerIntensities = decays->getAugerIntensities();
621 augerEnergies = decays->getAugerEnergies();
628 totalGammaEnergy = 0;
629 relaxationType = relaxType;
630 scoreAlphasLocal = scoreAlphasLocally;
633 for (vector<BetaRecordLeaf *>::iterator beta = myBetas.begin();
634 beta != myBetas.end(); beta++) {
636 double energy = (*beta)->getFinalEnergy();
641 for (vector<AlphaRecord *>::iterator alpha = myAlphas.begin();
642 alpha != myAlphas.end(); alpha++) {
644 double energy = (*alpha)->getFinalEnergy();
649 for (vector<GammaRecord *>::iterator gamma = myGammas.begin();
650 gamma != myGammas.end(); gamma++) {
652 double energy = (*gamma)->getDecayEnergy();
657 for (vector<GammaRecord *>::iterator gamma = myUncorrelatedGammas.begin();
658 gamma != myUncorrelatedGammas.end(); gamma++) {
660 double energy = (*gamma)->getDecayEnergy();
665 for (
unsigned int i=0; i < xrayEnergies.size(); ++i) {
666 numSampledXRay.push_back(0);
667 if (Emax < xrayEnergies[i]) {
668 Emax = xrayEnergies[i];
671 for (
unsigned int i=0; i < augerEnergies.size(); ++i) {
672 numSampledAuger.push_back(0);
673 if (Emax < augerEnergies[i]) {
674 Emax = augerEnergies[i];
679 spectrumWeight = relativeActivity;
683 egsInformation(
"EGS_RadionuclideSpectrum: Relative activity: %f\n",relativeActivity);
693 egsInformation(
"\nSampled %s emissions:\n", decays->radionuclide.c_str());
697 egsWarning(
"EGS_RadionuclideSpectrum::printSampledEmissions: Warning: The number of disintegrations (tracked by `ishower`) is less than 1.\n");
701 egsInformation(
"Energy | Intensity per 100 decays (adjusted by %f)\n", decays->decayDiscrepancy);
702 if (myBetas.size() > 0) {
705 for (vector<BetaRecordLeaf *>::iterator beta = myBetas.begin();
706 beta != myBetas.end(); beta++) {
709 ((EGS_Float)(*beta)->getNumSampled()/(ishower+1))*100);
711 if (myAlphas.size() > 0) {
714 for (vector<AlphaRecord *>::iterator alpha = myAlphas.begin();
715 alpha != myAlphas.end(); alpha++) {
718 ((EGS_Float)(*alpha)->getNumSampled()/(ishower+1))*100);
720 if (myGammas.size() > 0) {
723 EGS_I64 totalNumSampled = 0;
724 for (vector<GammaRecord *>::iterator gamma = myGammas.begin();
725 gamma != myGammas.end(); gamma++) {
727 totalNumSampled += (*gamma)->getGammaSampled();
729 ((EGS_Float)(*gamma)->getGammaSampled()/(ishower+1))*100,
730 ((EGS_Float)(*gamma)->getICSampled()/(ishower+1))*100,
731 ((EGS_Float)(*gamma)->getIPSampled()/(ishower+1))*100
734 if (myGammas.size() > 0) {
735 if (totalNumSampled > 0) {
737 totalGammaEnergy / totalNumSampled);
743 if (myUncorrelatedGammas.size() > 0) {
744 egsInformation(
"Uncorrelated gamma records (E,Igamma,Ice,Ipp):\n");
746 for (vector<GammaRecord *>::iterator gamma = myUncorrelatedGammas.begin();
747 gamma != myUncorrelatedGammas.end(); gamma++) {
750 ((EGS_Float)(*gamma)->getGammaSampled()/(ishower+1))*100,
751 ((EGS_Float)(*gamma)->getICSampled()/(ishower+1))*100,
752 ((EGS_Float)(*gamma)->getIPSampled()/(ishower+1))*100
755 if (xrayEnergies.size() > 0) {
758 for (
unsigned int i=0; i < xrayEnergies.size(); ++i) {
760 ((EGS_Float)numSampledXRay[i]/(ishower+1))*100);
762 if (augerEnergies.size() > 0) {
765 for (
unsigned int i=0; i < augerEnergies.size(); ++i) {
767 ((EGS_Float)numSampledAuger[i]/(ishower+1))*100);
786 if (relaxParticles.size() > 0) {
803 if (currentLevel && currentLevel->levelCanDecay() && currentLevel->getEnergy() >
epsilon) {
805 for (vector<GammaRecord *>::iterator gamma = myGammas.begin();
806 gamma != myGammas.end(); gamma++) {
808 if ((*gamma)->getLevelRecord() == currentLevel) {
810 if (u < (*gamma)->getTransitionIntensity()) {
815 if ((*gamma)->getGammaIntensity() < 1) {
822 double hl = currentLevel->getHalfLife();
824 currentTime = -hl * log(1.-rndm->
getUniform()) /
825 0.693147180559945309417232121458176568075500134360255254120680009493393;
829 if (rndm->
getUniform() < (*gamma)->getMultiTransitionProb()) {
830 multiTransitions.push_back(currentLevel);
834 currentLevel = (*gamma)->getFinalLevel();
837 if (u2 < (*gamma)->getGammaIntensity()) {
839 (*gamma)->incrGammaSampled();
841 currentQ = (*gamma)->getCharge();
843 E = (*gamma)->getDecayEnergy();
845 totalGammaEnergy += E;
852 else if (u2 < (*gamma)->getICIntensity()) {
853 (*gamma)->incrICSampled();
857 if ((*gamma)->icIntensity.size()) {
863 for (
unsigned int i=0; i<(*gamma)->icIntensity.size(); ++i) {
864 if (u3 < (*gamma)->icIntensity[i]) {
866 E = (*gamma)->getDecayEnergy() - (*gamma)->getBindingEnergy(i);
871 if (relaxationType ==
"eadl") {
875 (*gamma)->relax(i,app->getEcut()-app->getRM(),app->getPcut(),rndm,edep,relaxParticles);
886 (*gamma)->incrIPSampled();
912 if (multiTransitions.size() > 0) {
913 currentLevel = multiTransitions.back();
914 multiTransitions.pop_back();
924 for (vector<BetaRecordLeaf *>::iterator beta = myBetas.begin();
925 beta != myBetas.end(); beta++) {
926 if (u < (*beta)->getBetaIntensity()) {
932 (*beta)->incrNumSampled();
933 currentQ = (*beta)->getCharge();
936 currentLevel = (*beta)->getLevelRecord();
942 if ((*beta)->getPositronIntensity() >
epsilon && rndm->
getUniform() < (*beta)->getPositronIntensity()) {
947 if (relaxationType ==
"eadl" && (*beta)->ecShellIntensity.size()) {
952 for (
unsigned int i=0; i<(*beta)->ecShellIntensity.size(); ++i) {
953 if (u3 < (*beta)->ecShellIntensity[i]) {
957 (*beta)->relax(i,app->getEcut()-app->getRM(),app->getPcut(),rndm,edep,relaxParticles);
979 E = (*beta)->getSpectrum()->sample(rndm);
986 for (vector<AlphaRecord *>::iterator alpha = myAlphas.begin();
987 alpha != myAlphas.end(); alpha++) {
988 if (u < (*alpha)->getAlphaIntensity()) {
994 (*alpha)->incrNumSampled();
995 currentQ = (*alpha)->getCharge();
998 currentLevel = (*alpha)->getLevelRecord();
1003 if (scoreAlphasLocal) {
1004 edep += (*alpha)->getFinalEnergy();
1016 for (vector<GammaRecord *>::iterator gamma = myMetastableGammas.begin();
1017 gamma != myMetastableGammas.end(); gamma++) {
1018 if (u < (*gamma)->getTransitionIntensity()) {
1025 currentLevel = (*gamma)->getLevelRecord();
1035 for (vector<GammaRecord *>::iterator gamma = myUncorrelatedGammas.begin();
1036 gamma != myUncorrelatedGammas.end(); gamma++) {
1037 if (u < (*gamma)->getTransitionIntensity()) {
1042 if ((*gamma)->getGammaIntensity() < 1) {
1047 if (u2 < (*gamma)->getGammaIntensity()) {
1049 (*gamma)->incrGammaSampled();
1051 currentQ = (*gamma)->getCharge();
1053 E = (*gamma)->getDecayEnergy();
1055 totalGammaEnergy += E;
1062 else if (u2 < (*gamma)->getICIntensity()) {
1063 (*gamma)->incrICSampled();
1067 if ((*gamma)->icIntensity.size()) {
1073 for (
unsigned int i=0; i<(*gamma)->icIntensity.size(); ++i) {
1074 if (u3 < (*gamma)->icIntensity[i]) {
1076 E = (*gamma)->getDecayEnergy() - (*gamma)->getBindingEnergy(i);
1079 if (relaxationType ==
"eadl") {
1083 (*gamma)->relax(i,app->getEcut()-app->getRM(),app->getPcut(),rndm,edep,relaxParticles);
1094 (*gamma)->incrIPSampled();
1113 for (
unsigned int i=0; i < xrayIntensities.size(); ++i) {
1114 if (u < xrayIntensities[i]) {
1116 numSampledXRay[i]++;
1119 E = xrayEnergies[i];
1128 for (
unsigned int i=0; i < augerIntensities.size(); ++i) {
1129 if (u < augerIntensities[i]) {
1131 numSampledAuger[i]++;
1134 E = augerEnergies[i];
Base class for advanced EGSnrc C++ applications.
static EGS_Application * activeApplication()
Get the active application.
int userScoring(int iarg, int ir=-1)
User scoring function for accumulation of results and VRT implementation.
const string & getHenHouse() const
Returns the HEN_HOUSE 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.
const char * getSourceDescription() const
Get a short description of this source.
static EGS_BaseSource * getSource(const string &Name)
Get a pointer to the source named Name.
virtual void resetCounter()
Reset the source state.
string description
A short source description.
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 bool storeState(ostream &data_out) const
Store the source state into the stream data_out.
The ensdf class for reading ensdf format data files.
string otype
The object type.
Beta spectrum generation for EGS_RadionuclideSpectrum.
EGS_RadionuclideSource(EGS_Input *, EGS_ObjectFactory *f=0)
Constructor from input file.
bool setState(istream &data)
Set the source state according to the data in the stream data.
bool isValid() const
Checks the validity of the source.
bool storeState(ostream &data_out) const
Store the source state to the data stream data_out.
void resetCounter()
Reset the source to a state with zero sampled particles.
EGS_I64 getNextParticle(EGS_RandomGenerator *rndm, int &q, int &latch, EGS_Float &E, EGS_Float &wt, EGS_Vector &x, EGS_Vector &u)
Gets the next particle from the radionuclide spectra.
bool addState(istream &data)
Add the source state from the stream data to the current state.
EGS_I64 getShowerIndex() const
Returns the shower index of the most recent particle.
void printSampledEmissions()
Print the sampled emission intensities.
EGS_RadionuclideSpectrum(const string nuclide, const string ensdf_file, const EGS_Float relativeActivity, const string relaxType, const string outputBetaSpectra, const bool scoreAlphasLocally, const bool allowMultiTransition)
Construct a radionuclide spectrum.
EGS_Float sample(EGS_RandomGenerator *rndm)
Sample an event from the spectrum, returns the energy of the emitted particle.
Base random number generator class. All random number generators should be derived from this class.
EGS_Float getUniform()
Returns a random number uniformly distributed between zero (inclusive) and 1 (exclusive).
A class representing 3D vectors.
EGS_Application class header file.
Attempts to fix broken math header files.
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...
EGS_InfoFunction EGS_EXPORT egsFatal
Always use this function for reporting fatal errors.
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,...
const EGS_Float epsilon
The epsilon constant for floating point comparisons.
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...
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.
int q
charge (0-photon, -1=electron)