Skip to content

Commit

Permalink
Fix bug in scoring medium dose.
Browse files Browse the repository at this point in the history
Query whether region is real (using app->isRealRegion(ir))
before including in medium dose.  Caused segmentation faults
for geometries in which default medium is not defined.
  • Loading branch information
blakewalters committed Mar 1, 2016
1 parent 2d2d41d commit 23e4657
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,11 @@ void EGS_DoseScoring::reportResults() {
vector<EGS_Float> massM(nmedia,0);
int imed = 0;
for (int ir=0; ir<nreg; ir++) {
if(app->isRealRegion(ir)) {
imed = app->getMedium(ir);
EGS_Float volume = vol.size() > 1 ? vol[ir]:vol[0];
massM[imed] += app->getMediumRho(imed)*volume;
}
}
if (normE==1) {
egsInformation("\n\n==> Summary of media dosimetry (per particle)\n");
Expand Down

0 comments on commit 23e4657

Please sign in to comment.