StepTooSmall errors in optical simulation with curve

Hello all,
I am encountering some unexpected results in my optical simulation. My setup is modified from the OpNovice2 example. There are three simple geometric volumes, a small rectangle (acting as a scintillator), a long rectangle (acting as a light guide), and a small cylinder (acting as a PMT).

Using this setup and generating optical photons isotopically from the center of the scintillator, I find that 99 percent of the photons that reach the light guide also reach the PMT. (This is the expected result)
If I slightly alter the geometry to have a curved light guide (using G4Tubs) but approximate a uncurved setup by using a very small bend angle (0.001 radians) over a long distance (200 cm), then only 36 percent of the photons make it through to the PMT.

After some investigation, I have found that using 5000 initial photons produces about 775,000 StepTooSmall errors that look like this:

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : OpBoun06
      issued by : G4OpBoundaryProcess
G4OpBoundaryProcess: Opticalphoton step length: 1.08169e-09 mm.
This is larger than the threshold 1e-09 mm to set status StepTooSmall.
Boundary scattering may be incorrect.
*** Step size warnings stopped.

*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

I think it may be related to this bug report: [2510 – boundary reallocation step doesn't happen] although it does say that this issue has been resolved.

A colleague (who does not know anything about geant4) thought maybe Geant4 could be quantizing the bend into discrete segments that have are not optically touching, allowing some photons to slip through. I know that the visualization engine breaks curves into small segments, but I do not know how the physics engine handles curves.

Does anyone know what could be causing this many photons to escape?

Thanks in advance for any help or suggestions,
Angelo Rosso


I’d like to investigate this. Would you be willing to share more detailed information about the geometry, including relevant material properties of the light guide and the world (whatever is on the other side of the light guide surface), and the surface properties of the light guide.

The boundary process uses a step size of 0 to denote the photon is remaining in the original volume. The step status is set to StepTooSmall (a bad name, as it’s not too small). This is a flag to keep the material properties of the original volume.

Sometimes, the step size isn’t exactly 0. We added a small threshold (1e-9 mm) to account for this. Occasionally there are small steps larger than the threshold, and it’s not clear what the correct behaviour is.

In your case, because you see this many times with apparently incorrect results, something is going wrong. I don’t yet know what.

If you are using a G4Tub, the surface should really be curved, without kinks or joins. If you do have a lot of edges, for example using a tessellated surface, there may be problems because the determination of the surface normal at the edge is not clear.

Thank you for helping out,

The light guide and “scintillator” are made of the G4_GLASS_PLATE material and the word is full of the G4_AIR material. I am setting the RINDEX to be 1.5 at every energy level for the glass and 1.0 for the air.

I also notice that the problem is much more prevalent when the light guide is very long. For example if I set the bend angle to be 0.001 radians and the length to be 200 cm (bend radius of 200000 cm) the efficiency is around 36% but if I reduce the length to 20 cm (bend radius of 20000 cm), then the efficiency is 98% which is almost the expected result.

Could there be some sort of overflow in a calculation because of the large bend radius?

If it is useful, the code is on github GitHub - arosso17/Light-Guide-MC.