Modifying the Example WLS Simulation

_Geant4 Version:_11.1
_Operating System:_Windows Subsystem for Linux
_Compiler/Version:_gcc 13.1
_CMake Version:_3.16.3

I was trying to modify the example WLS simulation. My intended geometrical configuration requires that I use a very thin (25 - 50) micrometer WLS fiber layer inside multiple layers of glass and air. To simulate this, I only changed the fiber layer thickness in the detectorconstruction of the WLS example to 25 micron and filled the inside of the fiber layer with glass and then air. The absorption lengths of WLS materials (WLSABSLENGTH) are also on the order of micrometer. However, as soon as I changed the thickness of WLS layer to micrometer level along with the absorption lengths, I started getting the following error:

G4WT7 >
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : TRACK001
issued by : G4VParticleChange::CheckIt()
Step length and/or energy deposit are illegal
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

G4WT3 > Kinetic energy (MeV): 2.4800325e-06
G4WT6 > = : 0*[e hbar]/[2 m]
G4WT2 > G4VParticleChange::CheckIt : true path length -7.42945 mm is negative !!
G4WT3 > Position (mm) : (-41.2513,22.011241,8.0555224)
G4WT3 > Direction : (-0.87669895,-0.07377203,0.47534897)
G4WT3 > PhysicsVolume : WLSPaint
G4WT3 > Material : PMMA
G4WT2 > -----------------------------------------------
G4WT2 > G4VParticleChange Information
G4WT3 > -----------------------------------------------
G4WT3 > # of secondaries : 1
G4WT2 > TrackID : 7
G4WT6 > Position - x (mm) : -57.589313
G4WT6 > Position - y (mm) : -6.1707064
G4WT2 > ParentID : 6
G4WT3 > -----------------------------------------------
G4WT6 > Position - z (mm) : 330.95322
G4WT2 > Particle : opticalphoton
G4WT3 > Energy Deposit (MeV): 0
G4WT6 > Time (ns) : -0.0044362599
G4WT2 > Kinetic energy (MeV): 2.3381035e-06
G4WT3 > NIEL Energy Deposit (MeV): 0
G4WT6 > Proper Time (ns) : 0
G4WT2 > Position (mm) : (-22.062743,54.600689,143.23825)
G4WT3 > Track Status : StopAndKill
G4WT3 > TruePathLength (mm) : 1e-12
G4WT2 > Direction : (0.39463657,0.017520188,0.91867025)
G4WT6 > Momentum Direct - x : -0.16606044
G4WT3 > Stepping Control : 0
G4WT3 > First step in volume
G4WT6 > Momentum Direct - y : 0.87868904
G4WT2 > PhysicsVolume : WLSPaint
G4WT3 > Mass (GeV) : 0
G4WT6 > Momentum Direct - z : 0.44758184
G4WT2 > Material : PMMA
G4WT3 > Charge (eplus) : 0
G4WT6 > Kinetic Energy (MeV): 2.3357749e-06
G4WT2 > -----------------------------------------------
G4WT3 > MagneticMoment : 0
G4WT3 > = : 0*[e hbar]/[2 m]
G4WT2 > # of secondaries : 0
G4WT6 > Velocity (/c) : 0.68493151
G4WT3 > Position - x (mm) : -41.2513
G4WT2 > -----------------------------------------------
G4WT6 > Polarization - x : -0.28636946
G4WT3 > Position - y (mm) : 22.011241
G4WT2 > Energy Deposit (MeV): 0
G4WT6 > Polarization - y : -0.47729429
G4WT3 > Position - z (mm) : 8.0555224
G4WT2 > NIEL Energy Deposit (MeV): 0
G4WT6 > Polarization - z : 0.83077235
G4WT3 > Time (ns) : -0.071176844
G4WT2 > Track Status : StopAndKill

I wouldn’t worry about this error if it happened once or twice, but it happens very very often and number or occurrence increases with the number of photons generated by the gps. If I switch the absorption lengths and paint thickness to a higher value, this error goes away. I was looking at the verbose and this negative step length error occurs only when the photons are in the WLS fiber volume. Therefore, I was wondering, is it possible to simulate very thin WLS layer (on the order of micrometer) in Geant4? What could be a way to get around this error? Or we should look into different software packages for this purpose because Geant4 is not suitable for simulating WLS process for very thin layers?


I am using a the WLS process in a volume with a thickness of 1 micrometer and it works without errors. I think overlapping volumes could give you that type of error.
I had problems with optical processes inside daughter volumes other than the world volume, I worked around that placing all the volumes with the world volume as parent. It is time consuming (i.e. if you want to place a volume inside another, you have to “cut a hole” with “G4SubtractionSolid” in what would be the mother volume and place it with coordinates relative to the wv) but it worked in my case.


Hi! Thank you so much for your reply. Actually, my solution might be just doing what you suggested. I just had a few curiosities. Was your absoprtion lengths small as well (at micrometet order og mag) ? Also, instead of errors, did you receive any warning message about step lengths being too small?

You’re welcome!
Yes, I use an absorption length of 0.1 micrometer for the WLS process, enough to shift all incoming photons.
I think I received the “step too small” warnings, but they were few and did not seem to be a problem. The problem I encountered was that optical photons would go through daughter volumes without interacting in any way, no errors were thrown but the simulation did not work at all. Placing all the volumes with the world volume as parent solved this, and the “step too small” warning, too (I think, I haven’t seen it in a while).

Could you please post exactly what the changes were? I don’t understand the second part. Also, after changing the material, did you change the relevant material properties?