Draft: Print geometry path in case of e.g. GSL error during calculation #117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces new path information in case of an error during KEMField calculations. Example (the second-to-last line is added by this PR):
However, support with testing and potentially extending this PR would be great, since while this is very useful for debugging e.g. bugs like #69 , in its current implementation it may have a few potential downsides:
Regarding 1., there are two potential solutions to keeping this feature when loading geometry from a cache: Loading the geometry from the cache for coefficients but keeping path information from a freshly built version of the geometry or storing and loading the path information as well - probably the former is more reasonable.
Regarding 2., if this actually turns out to be a problem, the solution could be to link the original
KGPathAware
fCurrentElement
to eachKShape
as a pointer to dynamically get the path instead of having it saved as a long string, which however introduces a dependency between KEMField and KGeoBag also outside the KGeoBag interface. It has to be noted that geometry elements already contain strings in the location that is now used for storing the path information, which may or may not already be optimizable. The corresponding name (passed toKShape
s usingKNamed::SetName
inKGBEMConverter
) however is probably never used (KShape
s usually overwriteName()
;KSurface
, which is used to wrap theKShape
s inKGBEMConverter
, overwritesGetName()
to callName()
, so the name set withSetName
is probably inaccessible for objects created byKGBEMConverter
).