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

Fix egs++ iaea phsp scoring electron energy #1077

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Changes from 1 commit
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
Next Next commit
Fix egs++ iaea phsp writing electron energy
Fix a bug in egs_phsp_scoring where the electron energy for IAEA
phase-spaces was written as the total energy instead of the kinetic
energy.
  • Loading branch information
rtownson committed Nov 15, 2023
commit 47c8560962b5cf46d65a543b3040da7cc69ab971
Original file line number Diff line number Diff line change
Expand Up @@ -254,20 +254,30 @@ void EGS_PhspScoring::storeParticle(EGS_I64 ncase) {
if (app->top_p.q==0) {
countg++;
}
if (app->top_p.E-abs(app->top_p.q)*prm > emax) {
emax = app->top_p.E-abs(app->top_p.q)*prm;
double ke = app->top_p.E-abs(app->top_p.q)*prm;
if (ke > emax) {
emax = ke;
}
if (app->top_p.q != 0 && app->top_p.E - prm < emin) {
emin = app->top_p.E - prm;
}

//store particle data in p_stack

// Store kinetic energy for IAEA format phsp, and total energy for egsphsp
double E;
if (oformat == 0) {
E = app->top_p.E;
} else if (oformat == 1) {
E = ke;
}

//set -ve energy marker if this is a new primary hist.
double E = app->top_p.E;
if (ncase != last_case) {
E = -E;
last_case = ncase;
}

//store particle data in p_stack
p_stack[phsp_index].E = E;
p_stack[phsp_index].wt = app->top_p.wt;
p_stack[phsp_index].x = app->top_p.x.x;
Expand Down