Bug in G4Parameterised Volume

Have what I can only assume to be a bug when creating a sensitive detector volume using G4PhantomParameterisation. When I use SetRegularStructureID(1) it results in a bunch of scattering events creating nans (see right image below). From what I can tell these nans occur in mostly low density materials and come from electrons being produced as secondary particles. The following images show the results from my sensitive detector on two different colour scales, left to show the rough structure of my detector which is just a grid of G4_WATER voxels in a G4_AIR background and right to show all the areas that produced nans.

I am working with an adapted version of RE03 that I changed to use G4PVParameterised. Previous attempts working from the dicom example also resulted in this problem. Would anyone mind running my code to see if it reproduces on different machines or otherwise share any inside on how geant4 simulations could create nans? I’ve it here

CMakeLists.txt (2.2 KB)
RE02ActionInitialization.hh (2.1 KB)
RE02DetectorConstruction.hh (5.7 KB)
RE02EventAction.hh (2.3 KB)
RE02NestedPhantomParameterisation.hh (6.4 KB)
RE02PrimaryGeneratorAction.hh (2.6 KB)
RE02PSCellFlux.hh (2.8 KB)
RE02PSEnergyDeposit.hh (2.4 KB)
RE02PSFlatSurfaceCurrent.hh (3.0 KB)
RE02PSFlatSurfaceFlux.hh (3.1 KB)
RE02PSNofStep.hh (2.4 KB)
RE02RunAction.hh (3.3 KB)
RE02PSPassageCellFlux.hh (2.7 KB)
RE02Run.hh (4.3 KB)
RE02ActionInitialization.cc (2.6 KB)
RE02DetectorConstruction.cc (10.7 KB)
RE02EventAction.cc (3.1 KB)
RE02NestedPhantomParameterisation.cc (2.6 KB)
RE02PrimaryGeneratorAction.cc (3.4 KB)
RE02PSPassageCellFlux.cc (3.6 KB)
RE02Run.cc (9.0 KB)
RE02RunAction.cc (10.2 KB)
RE02PSCellFlux.cc (3.5 KB)
RE02PSEnergyDeposit.cc (3.6 KB)
RE02PSFlatSurfaceCurrent.cc (3.8 KB)
RE02PSFlatSurfaceFlux.cc (3.7 KB)
RE02PSNofStep.cc (3.5 KB)
RE02.cc (5.7 KB)

1 Like

Adding to my confusion, I typically start the program using the following commands

Resulting in nans as per above, however when I run the sensitive detector alongside a scoring volume according to following

it does not create nans sensitive within the detector but does show the following warning

Shouldn’t these commands be independent from each other? Is there something obvious I am doing wrong here or is my Geant4 install broken?

When I print out all the hits associated with a track that created a nan I get something like the following where some of the hits are good and a lot of them are undefined.

I am using windows btw

Hey James,

Would it be possible for you to bundle all the needed files into a single tar.gz? I believe it’d make things simpler for those who want to try to look your case.

Hey dkonst,
The forum only seems to have a limited number of approved file types