You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If a source collection includes multiple transformations of the same base source, then, when determining the fluence for the source collection, the fluence for each transformed source, regardless of source's weight in the collection, ends up being equal to the total fluence for all of the transformed sources. Thus, you end up with an erroneously high fluence for the source collection. This is due to the fact that getFluence in a transformed source calls getFluence of the base source, so every particle used from the base source ends up counting towards the fluence of every transformed source (using the same base source) in the collection.
To Reproduce
The following simple code (using 521icru.pegs4dat) reproduces the behaviour:
The output from the dose scoring object indicates that fluence=100000, where one would expect 50000 (i.e. the no. of histories, since beam area = 1 cm^2). This is because in the source collection, the fluence from both e_beam and transformed_e_beam are set to 50000, even though transformed_e_beam isn't used (i.e. has weight 0). If you use a different base source for transformed_e_beam, this could just be a copy of e_beam with a different source name, then the fluence for the source collection will be 50000 as expected.
Expected behavior
I would expect the fluence of each transformed source in the collection to scale based on the source's weight.
Operating system
Linux
Windows
macOS
Other:
EGSnrc version
develop branch.
The text was updated successfully, but these errors were encountered:
Describe the bug
If a source collection includes multiple transformations of the same base source, then, when determining the fluence for the source collection, the fluence for each transformed source, regardless of source's weight in the collection, ends up being equal to the total fluence for all of the transformed sources. Thus, you end up with an erroneously high fluence for the source collection. This is due to the fact that getFluence in a transformed source calls getFluence of the base source, so every particle used from the base source ends up counting towards the fluence of every transformed source (using the same base source) in the collection.
To Reproduce
The following simple code (using 521icru.pegs4dat) reproduces the behaviour:
The output from the dose scoring object indicates that fluence=100000, where one would expect 50000 (i.e. the no. of histories, since beam area = 1 cm^2). This is because in the source collection, the fluence from both e_beam and transformed_e_beam are set to 50000, even though transformed_e_beam isn't used (i.e. has weight 0). If you use a different base source for transformed_e_beam, this could just be a copy of e_beam with a different source name, then the fluence for the source collection will be 50000 as expected.
Expected behavior
I would expect the fluence of each transformed source in the collection to scale based on the source's weight.
Operating system
EGSnrc version
develop branch.
The text was updated successfully, but these errors were encountered: