Issue detecting optical photons in 10.7 or higher


Has anyone successfully detected an optical photon in 10.7 or higher?

I define a G4LogicalSkinSurface that I attach to a logical volume, which is also designated as a sensitive detector. I correctly define the efficiency (100%) and reflectivity (0%) settings. My code works just fine in 10.6.2.

But after upgrading to 10.7, I’ve not been able to tally a “detection” event for an optical photon. Through the GUI I can see optical photons being absorbed by the sensitive detector, and yet no hits are collected. Even stranger, if I increase the reflectivity from 0% to something like 50%, all of a sudden the sensitive detector will register reflections as hits. It seems like “detection” events where a photon is absorbed go unnoticed. The patch for 10.7 does not fix the issue, but I find it interesting that the patch does fix an issue with GDML material property definitions.

I ran the optical/WLS example in the 10.7 directory and at the end of its runtime it recorded zero optical photon detections, even though an efficiency value is clearly specified in its detector construction.

Any ideas? Maybe there’s a new way to define an optical photon detection surface that I’m not aware of? But like I said, the code works in 10.6.2.


There shouldn’t be any difference in optical photon detection in 10.7. You can see detection using OpNovice2 example and macro boundary.mac.

You mention GDML–do you use a GDML volume? Can you replicate the problem without GDML?

As for wls example: I don’t know how many photons are detected in 10.6. The printout was added for 10.7.

Did you make any progress on this?

The folklore in my neck of the woods suggests that this might be related to 10.7 reverting to behaviour which disappeared sometime after 10.3. The folkloric workaround that was used in the past, and appears to be necessary once again in 10.7, is to place the sensitive detector on an infinitesimally thin volume (with identical refractive index to the surrounding material) just in front of the skin surface.

This seems absurd, so I really hope that it’s a folkloric superstition that can be eliminated by finding the documentation that shows the correct way of solving this problem.

Can anyone shed any light … into my sensitive detector?

There hasn’t been an intentional change in functionality in 10.7. (nor in 10.3). The behavior you are describing sounds incorrect, so I will investigate.

Hmmm… Could you please provide more information on your setup? I’m not sure how SDs work with optical photons.

Detection works with 10.7 in the extended LXe example. However, the examples don’t call SD->ProcessHits(). Instead, the user stepping action calls a separate function to process the hits.

Do you use the invokeSD macro command?