Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature renormalized photoelectric cross sections and ICRU90 recommended values for key data #322

Merged
merged 18 commits into from
Aug 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added HEN_HOUSE/data/photo_shellwise.data
Binary file not shown.
59 changes: 57 additions & 2 deletions HEN_HOUSE/egs++/egs_advanced_application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ class EGS_LOCAL EGS_TransportProperty {
options.push_back(opt);
type = 2;
};
void setOption(const int &index, const char *opt) {
options[index] = opt;
};
void getInput(EGS_Input *input) {
if (type == 1) {
EGS_Float aux;
Expand Down Expand Up @@ -496,9 +499,13 @@ int EGS_AdvancedApplication::helpInit(EGS_Input *transportp, bool do_hatch) {
rayl.addOption("custom");
EGS_TransportProperty ff_med("ff media names",24,MXMED,&ff_media);
EGS_TransportProperty ff_files("ff file names",128,MXMED, &ff_names);

EGS_TransportProperty relax("Atomic relaxations",&the_xoptions->iedgfl);
relax.addOption("Off");
relax.addOption("On");
relax.addOption("eadl");
relax.addOption("simple");

EGS_TransportProperty iphter("Photoelectron angular sampling",
&the_xoptions->iphter);
iphter.addOption("Off");
Expand Down Expand Up @@ -562,6 +569,16 @@ int EGS_AdvancedApplication::helpInit(EGS_Input *transportp, bool do_hatch) {
setRayleighData(ff_media,ff_names);
}
relax.getInput(transportp);
if (the_xoptions->iedgfl == 0 || the_xoptions->iedgfl == 3) {
the_xoptions->eadl_relax = 0;
}
else {
the_xoptions->eadl_relax = 1;
// Now, 'On' means EADL relaxation
if (the_xoptions->iedgfl == 1) {
relax.setOption(1,"eadl");
}
}
iphter.getInput(transportp);
spin.getInput(transportp);
trip.getInput(transportp);
Expand All @@ -576,6 +593,32 @@ int EGS_AdvancedApplication::helpInit(EGS_Input *transportp, bool do_hatch) {
the_etcontrol->transport_algorithm = 0;
}
bca.getInput(transportp);

if (egsEquivStr(string("mcdf-xcom "),
string(the_media->pxsec).substr(0,pxsec.size()))) {
the_xoptions->mcdf_pe_xsections = 1;
string("xcom ").copy(the_media->pxsec,16,0);
}
else if (egsEquivStr(string("mcdf-epdl "),
string(the_media->pxsec).substr(0,pxsec.size()))) {
the_xoptions->mcdf_pe_xsections = 1;
string("epdl ").copy(the_media->pxsec,16,0);
}
else {
the_xoptions->mcdf_pe_xsections = 0;
}

// iedgfl == 3 implies eadl_relax == 0
if (the_xoptions->iedgfl == 3 &&
the_xoptions->mcdf_pe_xsections == 1) {
egsWarning("\n**** Warning:"
"\n Simplified atomic relaxation not allowed"
"\n with shellwise PE cross sections. Resetting"
"\n to detailed EADL atomic relaxation!!!\n\n");
the_xoptions->eadl_relax = 1;
the_xoptions->iedgfl = 2;
relax.setOption(1,"eadl");
}
}

if (do_hatch) {
Expand Down Expand Up @@ -668,6 +711,19 @@ int EGS_AdvancedApplication::helpInit(EGS_Input *transportp, bool do_hatch) {
egsInformation("\n\nTransport parameter and cross section options:\n"
"==============================================\n");
int nc = 50;
// Recover initial input string to reflect what's actually being used
// the_media->pxsec was already used in egsHatch() to read photon data
if (the_xoptions->mcdf_pe_xsections &&
egsEquivStr(string("xcom "),
string(the_media->pxsec).substr(0,pxsec.size()))) {
string("mcdf-xcom ").copy(the_media->pxsec,16,0);
}
else if (the_xoptions->mcdf_pe_xsections &&
egsEquivStr(string("epdl "),
string(the_media->pxsec).substr(0,pxsec.size()))) {
string("mcdf-epdl ").copy(the_media->pxsec,16,0);
}

if (!isspace(the_media->pxsec[0])) {
pxsec.info(nc);
}
Expand Down Expand Up @@ -715,7 +771,6 @@ int EGS_AdvancedApplication::helpInit(EGS_Input *transportp, bool do_hatch) {
if (efield.size()==3 || bfield.size()==3) {
estepem.info(nc);
}

egsInformation("==============================================\n\n");

delete [] ind;
Expand Down Expand Up @@ -776,7 +831,7 @@ void EGS_AdvancedApplication::setEIIData(EGS_I32 len) {
the_xoptions->eii_flag = 0;
}
else if (str_eii == on) {
strcpy(the_media->eiixsec,ik.c_str());
ik.copy(the_media->eiixsec,16,0);
}
}

Expand Down
13 changes: 12 additions & 1 deletion HEN_HOUSE/egs++/egs_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#
# Author: Iwan Kawrakow, 2005
#
# Contributors:
# Contributors: Ernesto Mainegra-Hing
#
###############################################################################
*/
Expand Down Expand Up @@ -331,3 +331,14 @@ bool egsIsAbsolutePath(const string &path) {
#endif
}

bool egsEquivStr(const string &a, const string &b) {
unsigned int sz = a.size();
if (b.size() != sz) {
return false;
}
for (unsigned int i = 0; i < sz; ++i)
if (tolower(a[i]) != tolower(b[i])) {
return false;
}
return true;
}
3 changes: 2 additions & 1 deletion HEN_HOUSE/egs++/egs_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#
# Author: Iwan Kawrakow, 2005
#
# Contributors:
# Contributors: Ernesto Mainegra-Hing
#
###############################################################################
*/
Expand Down Expand Up @@ -225,5 +225,6 @@ int EGS_EXPORT egsGetEndian();
*/
bool EGS_EXPORT egsIsAbsolutePath(const string &path);

bool EGS_EXPORT egsEquivStr(const string &a, const string &b);

#endif
20 changes: 13 additions & 7 deletions HEN_HOUSE/gui/egs_inprz/include/tooltips.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,21 +442,25 @@ static const char* sources[] = {
#define BREMS_ANG_SAMPLING "If KM: complete modified Koch-Motz 2BS used." \
"\nIf Simple: only leading term used."

#define BOUND_COMPTON "If On, Compton scattering treated in the Impuls Approximation," \
#define BOUND_COMPTON "If On, Compton scattering treated with the RIA model," \
"\nelse treated with Klein-Nishina. Make sure to turn it on for" \
"\nlow energy applications. Default is On."
#define PE_ANG_SAMPLING "If Off, photo-electrons get direction of `mother' photon," \
"\nelse Sauter's formula used (which is, striktly speaking," \
"\nvalid only for K-shell photo-absorption)."

#define RAYLEIGH_SCAT "Turns on/off coherent (Rayleigh) scattering." \
"\nDefault is Off. Should be turned on for low energy" \
"\napplications but needs PEGS4 data set with data."
#define RAYLEIGH_SCAT "Turns on/off coherent (Rayleigh) scattering." \
"\nShould be turned on for low energy applications." \
"\nDefault is On."

#define RELAXATION_TIP "If On, shell vacancies relaxed via emission of fluorescent X-Rays," \
"\nAuger and Koster-Cronig electrons (element and shell sampled from" \
"\nappropriate cross sections). Make sure to turn this option on for" \
"\nlow energy applications. Default is On."
"\nlow energy applications. Default is EADL (On)."\
"\n On: Full EADL atomic relaxation"\
"\n Off: No atomic relaxation"\
"\n EADL: Full EADL atomic relaxation"\
"\n simple: Atomic relaxations for K, L1-L3,<M>, and <N> shells"

#define ESTEPE_ALGORITHM "Algorithm used to take into account lateral and longitudinal" \
"\ncorrelations in a condensed history step."
Expand All @@ -466,9 +470,11 @@ static const char* sources[] = {
"\nICRU radiative stopping powers)."

#define PHOTON_XSECTION "Select photon cross section compilation." \
"\n si: Default photon cross section (Storm&Israel)" \
"\n xcom: Data taken directly from the XCOM library" \
"\n si: Data taken from the compilation by Storm&Israel" \
"\n xcom: Data taken directly from the XCOM library (default)" \
"\n epdl: Data taken directly from the EPDL97 library" \
"\n mcdf-xcom: Renormalized photoelectric xsections, XCOM for the rest" \
"\n mcdf-epdl: Renormalized photoelectric xsections, EPDL for the rest" \
"\nPEGS4: Data taken directly from the PEGS4 file" \
"\n\nThe prefix for any other photon cross setion compilation" \
"\nplaced in $HEN_HOUSE/data/ in the form prefix_*.data" \
Expand Down
3 changes: 3 additions & 0 deletions HEN_HOUSE/gui/egs_inprz/src/inputRZForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3815,6 +3815,9 @@ for(QStringList::Iterator it = ini.begin(); it != ini.end(); ++it ) {
prefix += (*it);
}
}
/* Insert prefixes requesting use of either xcom or epdl library
* with renormalized photoelectric xsections */
prefix +="mcdf-xcom"; prefix +="mcdf-epdl";
/* Insert prefix "pegs4" which requests use of the pegs4 data */
prefix +="PEGS4";

Expand Down
12 changes: 11 additions & 1 deletion HEN_HOUSE/gui/egs_inprz/ui/inputRZ.ui
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>5</number>
<number>7</number>
</property>
<property name="iconSize">
<size>
Expand Down Expand Up @@ -8228,6 +8228,16 @@ Will start in /pegs4/density_corrections/ subdirectory off the directory selecte
<string>Off in Regions</string>
</property>
</item>
<item>
<property name="text">
<string>eadl</string>
</property>
</item>
<item>
<property name="text">
<string>simple</string>
</property>
</item>
</widget>
</item>
</layout>
Expand Down
9 changes: 6 additions & 3 deletions HEN_HOUSE/interface/egs_c_interface2.macros
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,13 @@ REPLACE {;COMIN/USEFUL/;} WITH {
REPLACE {;COMIN/X-OPTIONS/;} WITH {
;common/xsection_options/ ibrdst, iprdst, ibr_nist, spin_effects,
ibcmp,iraylr,iedgfl,iphter,pair_nrc,itriplet,
radc_flag,eii_flag,iphotonuc;
radc_flag,eii_flag,iphotonuc,
eadl_relax, mcdf_pe_xsections;
$INTEGER ibrdst, iprdst, ibr_nist,eii_flag,iphotonuc,
ibcmp,iraylr,iedgfl,iphter,pair_nrc,
radc_flag,itriplet;
$LOGICAL spin_effects;
$LOGICAL eadl_relax, mcdf_pe_xsections;
};

" Again, to remove geometry dependence make e_max_rr and i_do_rr sclars"
Expand Down Expand Up @@ -293,7 +295,8 @@ REPLACE {$set-region-by-region-defaults;} WITH {;
ecut = 0; pcut = 0; smaxir = $MAX-SMAX;
ecut_new = 0; pcut_new = 0; smax_new = $MAX-SMAX;
rhor = 1; rhor_new = 1;
ibcmp = $IBCMP-DEFAULT; iraylr = 0; iphotonuc=$IPHOTONUCR-DEFAULT;
ibcmp = $IBCMP-DEFAULT;
iraylr = $IRAYLR-DEFAULT; iphotonuc=$IPHOTONUCR-DEFAULT;
iedgfl = $IEDGFL-DEFAULT; iphter = $IPHTER-DEFAULT;
i_do_rr = 0; e_max_rr = 0; e_max_rr_new = 0;
};
Expand Down Expand Up @@ -512,7 +515,7 @@ APPEND {;COMIN/X-OPTIONS/;} TO {$COMIN-PHOTO;};
APPEND {;COMIN/X-OPTIONS/;} TO {$COMIN-PHOTON;};
APPEND {;COMIN/X-OPTIONS/;} TO {$COMIN-EII-INIT;};
APPEND {;COMIN/X-OPTIONS/;} TO {$COMIN-INIT-TRIPLET;};
APPEND {;COMIN/X-OPTIONS/;} TO {$COMIN-GET-TRANSPORTP;};
"APPEND {;COMIN/X-OPTIONS/;} TO {$COMIN-GET-TRANSPORTP;}; already there"
APPEND {;COMIN/X-OPTIONS/;} TO {$COMIN-MOLLER;};
APPEND {;COMIN/X-OPTIONS/;} TO {$COMIN-RADC-INIT;};
APPEND {;COMIN/X-OPTIONS/;} TO {$COMIN-INIT-NIST-BREMS;};
Expand Down
8 changes: 6 additions & 2 deletions HEN_HOUSE/interface/egs_interface2.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ struct EGS_XOptions {

Can be set in the input file using
\verbatim
Pair angular samplin= Off or Simple or KM
Pair angular sampling= Off or Simple or KM
\endverbatim
*/
EGS_I32 iprdst;
Expand Down Expand Up @@ -466,7 +466,7 @@ struct EGS_XOptions {

/*! Atomic relaxations flag. If set to 1 (the default), vacancies
created in shells with binding energies above 1 keV will be relaxed
by fluorscent, Auger and Coster-Kronig transitions. Vacancies
by fluorescent, Auger and Coster-Kronig transitions. Vacancies
can be currently created after photo-absorption, bound Compton scattering
and electron inelastic scattering (if eii_flag is not 0).
If set to 0, the binding energy will be given to the photo-electron
Expand Down Expand Up @@ -546,6 +546,10 @@ struct EGS_XOptions {
*/
EGS_I32 iphotonuc;

EGS_I32 eadl_relax;

EGS_I32 mcdf_pe_xsections;

};

/*! \brief A structure corresponding to the \c egs_vr common block
Expand Down
4 changes: 4 additions & 0 deletions HEN_HOUSE/omega/progs/gui/beamnrc/beamnrc_gui.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ global numopts options
}
# Place PEGS4 option to end of the list
set options(photon_xsections,0) $xsect
set options(photon_xsections,[expr $numopts(photon_xsections)-1]) "mcdf-xcom"
set numopts(photon_xsections) [expr $numopts(photon_xsections)+1]
set options(photon_xsections,[expr $numopts(photon_xsections)-1]) "mcdf-epdl"
set numopts(photon_xsections) [expr $numopts(photon_xsections)+1]
set options(photon_xsections,[expr $numopts(photon_xsections)-1]) "PEGS4"
} else {
# If for some reason no photon data available, one can still use the
Expand Down
Loading