-
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
A generic fluence scoring ausgab object (AO) #836
A generic fluence scoring ausgab object (AO) #836
Conversation
This should be rebased for merging onto develop. |
HEN_HOUSE/egs++/ausgab_objects/egs_fluence_scoring/egs_fluence_scoring.cpp
Outdated
Show resolved
Hide resolved
HEN_HOUSE/egs++/ausgab_objects/egs_fluence_scoring/egs_fluence_scoring.cpp
Outdated
Show resolved
Hide resolved
HEN_HOUSE/egs++/ausgab_objects/egs_fluence_scoring/egs_fluence_scoring.cpp
Outdated
Show resolved
Hide resolved
@mainegra can you change the target branch to develop; and perhaps rebase on develop? 🙏🏻 |
Will do when I get to a PC. Probably this afternoon .... 😉 |
@ftessier I am working on the documentation for this AO frantically. Needs a bit of work. Once I have a basic, decent, draft I will change the target to develop and rebase. Cheers! |
No worries, no rush! 😃 |
b633f13
to
5e97422
Compare
Rebased on develop. |
@ftessier I managed to push the latest commits. PR should be ready for merge. There is some decent (hopefully) documentation for this AO. I also added the link |
HEN_HOUSE/egs++/ausgab_objects/egs_fluence_scoring/egs_fluence_scoring.h
Outdated
Show resolved
Hide resolved
HEN_HOUSE/egs++/ausgab_objects/egs_fluence_scoring/egs_fluence_scoring.h
Outdated
Show resolved
Hide resolved
HEN_HOUSE/egs++/ausgab_objects/egs_fluence_scoring/egs_fluence_scoring.h
Outdated
Show resolved
Hide resolved
HEN_HOUSE/egs++/ausgab_objects/egs_fluence_scoring/egs_fluence_scoring.h
Show resolved
Hide resolved
0f13900
to
b33f10b
Compare
Squash commits and adjust commit messages. No code change, with original branch (rebased on |
Large formatting commit after running astyle on modified files. This is a format-only commit, no functional change. |
cb0ea18
to
726e25c
Compare
726e25c
to
25c8110
Compare
Same as before, simply removed a spurious EOL space. |
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.
Nice job, @mainegra! I didn't subject this to exhaustive testing, but I did try out planar and volumetric fluence output (along with spectra) for one simulation and the output was clear and straightforward (once I figured out that the Volume=
input is not optional in volumetric scoring), and I can already see using this AO quite a bit. On my machine (Mac running clang c++), though, compilation failed with:
egs_fluence_scoring.cpp:1399:22: error: invalid suffix 'D' on floating constant
if (norm_u != 1.0D+0) {
Once I removed the D+0
it compiled fine. I suspect this error wouldn't show up with g++, but maybe should be addressed for generality.
@mainegra, what was the intent of the |
- EGS_Interpolator: increase array size when creating an interpolator based on an array of value pairs to have an extra bin to prevent round-off errors. This is also done by PEGS4 when determining fit parameters for each interval. The extra bin uses the same parameters as the previous one, i.e., it extrapolates. - Add auxiliary methods to application classes to get electron step size, energy deposited and app source type. - Fluence scoring: at a plane, in regions for all particles.
Get proper stopping power interpolator depending on charge.
- Add "clean" target for dose and fluence scoring objects (instead of manually deleting files when building the ausgab object). Need to add to the rest of the ausgab objects! - One can now define DEBUG=-DDEBUG to turn on some debugging messages that I found useful. - Add MYDEF for user defines: use MYDEF=-DDEBUG to activate debugging messages and variables.
Reworked the classes for planar and volumetric fluence scoring to descend from a common base class which contains many commonalities, to avoid code duplication. Should have started that way!
Add auxiliary functions to application classes, required by the fluence scoring ausgab object.
- Add a method to get the charge of a base source, which returns -99 by default, matching the unknown type of the fluence scoring ausgab object. A base source does not know the charge of its particles unless it is later derived from a simple source. For instance a collection of sources, a beam source, or a phase space source will contain multiple type of particles. - Sources derived from the class EGS_SimpleSource return the source particle's charge. - Add a method to get source charge from the application.
Add an application-level method to obtain the maximum energy of the source. This proves useful for ausgab objects that need this information.
- Add option to define regions from where to score planar fluence to improve efficiency of charged particle calculations. - Move many common tasks to the base class EGS_FluenceScoring. - Fix group scoring region definitions. - Improve logic for defining scoring regions in planar scoring class. - Document classes with Doxygen comments.
- Add the ability to divide fluence in total and primary fluence. - Add the ability to calculate integral and differential fluence. - Improve output format. - Investigate the effect of scoring integral charged particle fluence using either EDEP (within differential scoring block) or directly TVSTEP: a) Identical for FLURZ-like calculation b) Small, negligible differences using stprO3 and stpwrO5 This allows extraction of the integral fluence scoring from the blocks for differential fluence. When one is only interested in the integral fluence, the calculation is up to 10% faster using a TVSTEP-based approach. Current implementation allows switching between EDEP-based and TVSTEP-based integral fluence calculation via the pre-processor define USETVSTEP. To use TVSTEP-based integral dose calculation use: make MYDEFS=-DUSETVSTEP Next iteration will only use the TVSTEP-based approach for integral fluence as both approaches result in negligible differences. - Add mechanism to track the distribution of number of energy bins covered when spreading EDEP. This is activated via the define variable DEBUG: to use it, build the fluence scoring ausgab object using: make MYDEFS=-DDEBUG One can also trace the difference between the step derived from spreading EDEP over the energy grid and TVSTEP via DEBUG.
- Add input blocks to define the energy grid and the scoring options based on the scoring type. - Improve output format.
Remove example for base class and add specific blocks for planar an volumetric scoring inputs.
- Remove initial approach to score charged particle integral fluence from each contribution to the differential fluence. Now is uses TVSTEP and computes integral fluence in one go. - Remove checks for pre-processor directive USETVSTEP as it not needed anymore. - Polish documentation.
59f6204
to
14fa724
Compare
Rebased on develop. |
Scores fluence in user-defined regions (
volumetric
) or at a circular or rectangular field (planar
) located in an arbitrary position in space. Scoring can be done for either photons, electrons or positrons. Scoring for multiple particle types, can be accomplished by defining as many fluence scoring AOs as required.