-
Notifications
You must be signed in to change notification settings - Fork 146
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++ 3ddose output and change getMass to getVolume #759
Conversation
I've tested the changes to egs_nd_geometry and egs_dose_scoring by comparing an ausgab object 3ddose file with egs_chamber results (where I calculate mass by hand), and I get the exact same dose and uncertainty per voxel. I have also performed checks of all of the geometries that were changed using egs_brachy, which was also changed to modify to use getVolume instead of getMass, and things seems to be working well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to merge this in asap. It could include one more change, while we're at it:
--- a/HEN_HOUSE/egs++/egs_advanced_application.cpp
+++ b/HEN_HOUSE/egs++/egs_advanced_application.cpp
@@ -1171,7 +1171,8 @@ void EGS_AdvancedApplication::resetRNGState() {
//************************************************************
// Returns density for medium ind
EGS_Float EGS_AdvancedApplication::getMediumRho(int ind) {
- return the_media->rho[ind];
+ // Handle a negative index for vacuum
+ return ind < 0 ? 0.0 : the_media->rho[ind];
}
I just don't have permission to push to Martin's branch.
8605006
to
843d966
Compare
Rebased on develop, no conflict. |
843d966
to
114cbbb
Compare
Applied astyle, only whitespace changes. |
Honestly, a little surprised, but I'll take it. :) |
Surprised that there is no rebase conflict, or that it is being merged in? 😆 |
Added Reid's patch (see above); changed ternary if-expression to if-statement. To squash before merging. |
Change the egs_base_geometry getMass virtual function to a getVolume function that returns region volume instead of mass. Typically, initGeometry() is invoked before any media data is read in the application, hence getMass was unreliable. The getMass function was replaced with a getVolume function, which only depends on internal gemoetry definitions. The geometries in egs_autoenvelope, egs_nd_geometry, egs_rz, and egs_spheres are affected. The ausgab dose scoring object which outputs a 3ddose file was also changed to reflect the change from getMass to getVolume. This modification of egs_dose_scoring also now properly accounts for relativeRho in the mass calculation. Also, handle vacuum medium index appropriately in getMediumRho.
cbbf9be
to
b960dd3
Compare
Squashed the commits and fix typo in commit message. No code change. |
The egs_base_geometry getMass virtual function is exchanged with
a getVolume function that returns region volume instead of mass.
This change was performed because typically, initGeometry() is
invoked before any media data is read in egs_applications, thus
getMass' dependence on medium data could be unreliable. The
getMass function was thus replaced with a getVolume function,
which only relies on internal gemoetry definitions to return a
value.
The geometries in egs_autoenvelope, egs_nd_geometry, egs_rz,
and egs_spheres are affected. The ausgab dose scoring object
which outputs a 3ddose file was also changed to reflect the
change from getMass to getVolume. This modification of
egs_dose_scoring also now includes relativeRho in the mass
calculation.