G4Track Information - gamma - TrackLength grows but X,Y,Z (position) does not change

_Geant4 Version: 11.1.1 (as included in Gate 9.3)
_Operating System: Ubuntu LTS 22.04
_Compiler/Version: n.a.
_CMake Version: n.a


Hi!

To simulate the x-ray irradiation on nanoparticle systems I am shooting x-ray gammas corresponding to a 40kV Molybdenum anode on a nanoparticle system. To better explain to my colleauges what happens during the simulation I use verbose level 2:

/tracking/storeTrajectory             1
/tracking/verbose 2

Now, looking through the output I have noticed that there are some gammas that have a travel length of about 5 um, but the X, Y, Z position doesn’t change.

*********************************************************************************************************
Distance: 0 mm
* G4Track Information:   Particle = gamma,   Track ID = 1,   Parent ID = 0
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
0 -0.000375 0.000297      2.5   0.00226        0        0         0 sourceHole_phys initStep
1 -0.000375 0.000297      2.5   0.00226        0  2.5e-07   2.5e-07 detectorGammaIn_phys Transportation
2 -0.000375 0.000297      2.5   0.00226        0    5e-07   7.5e-07 SampleCell_phys Transportation
3 -0.000375 0.000297      2.5   0.00226        0   0.0044    0.0044 AccumulationRegion_phys Transportation
4 -0.000375 0.000297      2.5   0.00226        0  4.4e-05   0.00444 Nanosystem_phys Transportation
5 -0.000375 0.000297      2.5   0.00226        0  4.5e-05   0.00449 TMDC_NP_phys Transportation
6 -0.000375 0.000297      2.5   0.00226        0    1e-05    0.0045 Nanosystem_phys Transportation
7 -0.000375 0.000297      2.5   0.00226        0  4.5e-05   0.00454 AccumulationRegion_phys Transportation
8 -0.000375 0.000297      2.5   0.00226        0  1.6e-05   0.00456 Nanosystem_phys Transportation
9 -0.000375 0.000297      2.5   0.00226        0  4.5e-05   0.00461 TMDC_NP_phys Transportation
10 -0.000375 0.000297      2.5   0.00226        0    1e-05   0.00462 Nanosystem_phys Transportation
11 -0.000375 0.000297      2.5   0.00226        0  4.5e-05   0.00466 AccumulationRegion_phys Transportation
12 -0.000375 0.000297      2.5   0.00226        0  1.6e-05   0.00468 Nanosystem_phys Transportation
13 -0.000375 0.000297      2.5   0.00226        0  4.5e-05   0.00472 TMDC_NP_phys Transportation
14 -0.000375 0.000297      2.5         0 0.000306 4.49e-06   0.00473 TMDC_NP_phys phot
:----- List of 2ndaries - #SpawnInStep=  2(Rest= 0,Along= 0,Post= 2), #SpawnTotal=  2 ---------------
: -0.000375  0.000297       2.5  0.000374                 e-
: -0.000375  0.000297       2.5   0.00158                 e-
:----------------------------------------------------------------- EndOf2ndaries Info ---------------

*********************************************************************************************************

In case of electrons with similar tracklength the X/Y/Z positions do change.

Is this a bug, or is this a feature that I don’t understand? Thanks for your help!

What are the range cuts for electrons? If it is 5 um that would be your answer and expected behaviour.

This isn’t a bug, it’s printout precision. Your X,Y,Z, coordinate values each have just three digits of precision, and four orders of magnitude difference in values. The step length at each step is a few tens of nanometers (4.5e-5 mm = 45 nm), with the cumulative step length just a few microns.

If you adjust your geometry construction so that you place the target at (0,0,0) in the world volume, and launch your source gammas from Z = -2.5 mm, then I’d expect you’ll see the coordinate changes you expect being printed out.

I suggest to use an improved version of SteppingVerbose.
Copy lines 57-59 of exampleB1.cc

The range cut for electrons and photons in that volume is 1 nm.

For electrons I see the X/Y/Z data changing. Why would there be a particle type dependent difference in precision?

* G4Track Information:   Particle = e-,   Track ID = 2,   Parent ID = 1
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
0 0.000215 0.000192      2.5    0.0151        0        0         0 TMDC_NP_phys initStep
1 0.000213 0.000194      2.5    0.0151        0 3.48e-06  3.48e-06 TMDC_NP_phys msc
2 0.000209 0.000199      2.5    0.0151        0 6.43e-06  9.91e-06 Nanosystem_phys Transportation
3  0.00019 0.000224      2.5    0.0151        0 3.41e-05   4.4e-05 AccumulationRegion_phys Transportation
4 0.000178  0.00024      2.5    0.0151 1.95e-05 2.18e-05  6.58e-05 Nanosystem_phys Transportation
5 0.000141 0.000287      2.5     0.015 9.45e-05 6.41e-05   0.00013 AccumulationRegion_phys Transportation
6 7.47e-05 0.000373      2.5     0.015 1.58e-05 0.000117  0.000247 SampleCell_phys Transportation
7 3.34e-05 0.000426      2.5    0.0149 8.67e-05 7.29e-05   0.00032 SampleCell_phys msc
8 7.79e-06 0.000461      2.5    0.0148 0.000112 4.57e-05  0.000366 SampleCell_phys msc
9 -1.57e-05 0.000497      2.5    0.0147 1.97e-05 4.42e-05   0.00041 SampleCell_phys msc
10 -4.82e-05 0.000531      2.5    0.0147        0 4.86e-05  0.000459 SampleCell_phys msc
11 -4.83e-05 0.000531      2.5    0.0147  1.6e-07 1.39e-07  0.000459 SampleCell_phys msc
12 -0.000127 0.000618      2.5    0.0145 0.000236 0.000121   0.00058 SampleCell_phys msc
13 -0.000167 0.000771      2.5    0.0145        0 0.000158  0.000738 SampleCell_phys msc
14 -0.000253  0.00102      2.5    0.0142 0.000323 0.000271   0.00101 SampleCell_phys msc

Even if the step length is just a few 1e-6 mm long there is a change in X/Y/Z.

What do you think why does this bug / feature show itself only for photons? For electrons in the same context I do see a change in the position coordinates (my comment above), even in the small scale of just a few 10s of nanometers.