Hello all, as ever a novice looking for guidance on something that confuses me.
Long story short I am trying to measure dosimetry delivered by x-ray imaging, to do this I constructed an object using G4PVParameterisation and attached a dosimetry primitive scorer to it. My issue is that the results from this detector occasionally produce nans or much larger values than what I would measure in a scoring mesh.
Following are examples of this where the left image is from a macro based scoring mesh and right is from my sensitive detector.
In the sensitive detector image there are a bunch of brighter streaks appear that are not in the scoring mesh image. Occasionally these artefacts also include nans, I assume from some kind of divide by zero error. It predominantly occurs in low density materials such as G4_AIR and only very rarely appears in a material like G4_WATER. It seems to be from electrons being created as secondary particles but I don’t know what part of my code could be causing it given the how it varies depending on the material.
Information about the code;
- Following is the code I use for my ConstructSDandField
- Then we have the code I am using to build the parameterisation
- The entire file I am using when creating each run
Run.cc (5.4 KB)
- And how I am accessing data from the sensitive detector
These are based off the DICOM example for dosimetry.
I’m pretty stumped as to why these errors are only occurring sometimes and in seemingly such specific circumstances, I really hope someone here can help troubleshoot.