Problem 1128

Summary: Volume assignment with multiple-scattering does not correspond to point for a very small volume
Product: Geant4 Reporter: Pedro.Arce
Component: processes/electromagneticAssignee: Vladimir.Ivantchenko
Status: RESOLVED FIXED    
Severity: major CC: Gabriele.Cosmo, John.Apostolakis
Priority: P4    
Version: 9.3   
Hardware: PC   
OS: Linux   
Attachments: events visualisation

Description Pedro.Arce 2010-07-13 14:04:19 CEST
Created attachment 84 [details]
events visualisation

I build a very small geometry with the text file utility:

:ROTM RM0 0. 0. 0. 

:VOLU world BOX 1.*um 1.*um 1.*um G4_Galactic
:VIS world OFF

:VOLU NanoPin TUBE 0.*nm 250./26.*nm 250./2.*nm G4_Ta
:PLACE NanoPin 1 world RM0 0. 0. 0.
:COLOR NanoPin 0 0 1

Then I send an electron of 30 keV :

/gun/particle e-
/gun/energy 30 keV
/tracking/verbose 1
/run/beamOn 10

It tells me often that msc happens in the NanoPin volume, while the coordinates are outside:

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0        0        0        0      0.03        0        0         0     NanoPin initStep
    1 7.92e-06 -5.46e-06 8.12e-05    0.0299 7.73e-05 9.97e-05  9.97e-05     NanoPin msc
    2 3.04e-05 -1.66e-05 0.000168    0.0299 1.73e-05 9.97e-05  0.000199     NanoPin msc
    3 5.49e-07 -6.57e-05 0.000239    0.0295 0.000399 9.97e-05  0.000299     NanoPin msc
    4 -7.1e-05 -9.48e-05 0.000286    0.0295 4.89e-05 9.97e-05  0.000399     NanoPin msc
    5 -0.000139 -0.00012  0.00034    0.0293 0.000199 9.97e-05  0.000499     NanoPin msc
    6 -0.000182 -0.000195 0.000368    0.0287 0.000514 9.97e-05  0.000598     NanoPin msc
    7 -0.00021 -0.00026 0.000423    0.0264  0.00234 9.97e-05  0.000698     NanoPin msc
    8 -0.000173 -0.000341  0.00042    0.0249  0.00152 9.97e-05  0.000798     NanoPin msc
    9 -0.000185 -0.000428 0.000412    0.0237  0.00114 9.97e-05  0.000897     NanoPin msc
   10 -0.000137 -0.000493 0.000445     0.021  0.00275 9.97e-05  0.000997     NanoPin msc
   11 -0.000126 -0.000577 0.000459    0.0188  0.00224 0.000101    0.0011     NanoPin msc
   12 -0.000208 -0.000561 0.000419    0.0176  0.00116 0.000115   0.00121     NanoPin msc
   13 -0.000274 -0.000537 0.000378    0.0164  0.00118 9.97e-05   0.00131     NanoPin msc
   14 -0.000324 -0.000593 0.000355    0.0146  0.00184 9.97e-05   0.00141     NanoPin msc
   15 -0.000377 -0.000621 0.000303    0.0132  0.00142 0.000106   0.00152     NanoPin msc
   16 -0.00035 -0.000563 0.000268    0.0125 0.000633 9.97e-05   0.00162     NanoPin msc
   17 -0.000322 -0.000519 0.000218    0.0116 0.000896 9.97e-05   0.00172     NanoPin msc
   18 -0.000309 -0.000543 0.000282    0.0112 0.000437 0.000101   0.00182     NanoPin msc
   19 -0.000249 -0.00058 0.000258    0.0104 0.000824 0.000115   0.00193     NanoPin msc
   20 -0.000188 -0.000608 0.000268   0.00838  0.00199 0.000106   0.00204     NanoPin msc
   21 -0.000222 -0.000562 0.000266   0.00773 0.000645 9.97e-05   0.00214     NanoPin msc
   22 -0.000218 -0.000554 0.000239         0  0.00773 0.000298   0.00244     NanoPin eIoni


If a use a gamma it is always right 
    0        0        0        0      0.03        0        0         0     NanoPin initStep
    1        0        0 0.000125      0.03        0 0.000125  0.000125       world Transportation
    2        0        0    0.001      0.03        0 0.000875     0.001  OutOfWorld Transportation
=

If I change the energy to 3 MeV and the dimensions of the tube to 0. 10.*um 125.*um it still happens, while if I change the dimensions to 0. 100.*um 125.*um I do not see any problem in 100 events.

The visualisation confirms that msc is happening outside the tube.
Comment 1 Gabriele Cosmo 2010-07-13 14:31:11 CEST
The fact that the problem occurs only when multiple-scattering is involved, suggests that is cannot be a pure geometry problem.
PS: in order to make sure that the point is indeed outside the volume, you should increase the precision of the output to show more mantissa...
Comment 2 Pedro.Arce 2010-07-13 16:17:35 CEST
Indeed I also found eBrem or eIoni processes, although it is true that msc is the first one. For example (with a geometry 0. 10.*um 125.*um)

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0        0        0        0         3        0        0         0     NanoPin initStep
    1  0.00928  0.00372    0.057       2.9   0.0954   0.0643    0.0643     NanoPin msc
    2 -0.00233   0.0625    0.047      2.77    0.139   0.0643     0.129     NanoPin msc
    3  -0.0059   0.0959 -0.00318      2.66    0.105   0.0643     0.193     NanoPin msc
    4   0.0112    0.135  -0.0459      2.55    0.113   0.0643     0.257     NanoPin msc
    5   0.0602    0.148  -0.0778      2.31    0.242   0.0643     0.322     NanoPin msc
    6   0.0908    0.198  -0.0769      2.22     0.09   0.0643     0.386     NanoPin msc
    7    0.074    0.208   -0.132      2.11    0.103   0.0643      0.45     NanoPin msc
    8   0.0976    0.203   -0.186      2.02   0.0917   0.0643     0.514     NanoPin msc
    9     0.13     0.16   -0.207      1.85    0.169   0.0643     0.579     NanoPin msc
   10    0.158    0.158   -0.256      1.78   0.0765   0.0643     0.643     NanoPin msc
   11    0.181    0.209   -0.268      1.68    0.095   0.0643     0.707     NanoPin msc
   12    0.165    0.262    -0.26      1.59   0.0954   0.0643     0.772     NanoPin msc
   13    0.133    0.303   -0.241      1.41    0.171   0.0643     0.836     NanoPin msc
   14     0.14     0.33   -0.193      1.31    0.101   0.0668     0.903     NanoPin msc
   15    0.144    0.352   -0.139       1.2    0.115   0.0731     0.976     NanoPin msc
   16    0.169     0.38  -0.0917       1.1    0.101   0.0799      1.06     NanoPin msc
   17    0.136    0.424  -0.0644     0.986    0.112   0.0855      1.14     NanoPin msc
   18    0.108    0.457    -0.11     0.842    0.144   0.0958      1.24     NanoPin msc
   19    0.155    0.431   -0.136     0.655    0.187    0.104      1.34     NanoPin msc
   20    0.164    0.457   -0.153    0.0902    0.133   0.0474      1.39     NanoPin eBrem
   21    0.164    0.457   -0.154         0   0.0902   0.0152       1.4     NanoPin eIoni


P.S: you can see that the tube extends from -0.125 to 0.125 in Z, and 0.01 in radius, so it is clearly outside. This can also be seen looking at the scattering points in the figure I attached
Comment 3 Pedro.Arce 2010-07-14 22:09:37 CEST
The problem sems to be the multiple scattering model. With WentzelVI and GoudsmitSaunderson ut does not appear, while with Urban90, Urban92 and
Urban93 it does.
Comment 4 Vladimir.Ivantchenko 2010-07-29 11:17:08 CEST
Hello Pedro,

I need tar file with the problematic application. In fact, I not yet understand what it is and is there real problem or all is a problem of the printout.

VI
Comment 5 Pedro.Arce 2010-07-29 12:35:11 CEST
Hi Vladimir,

You just have to take examples extended/persistency/P03 and replace g4geom.txt by

:ROTM RM0 0. 0. 0. 

:VOLU world BOX 1.*um 1.*um 1.*um G4_Galactic
:VIS world OFF

:VOLU NanoPin TUBE 0.*nm 250./26.*nm 250./2.*nm G4_Ta
:PLACE NanoPin 1 world RM0 0. 0. 0.
:COLOR NanoPin 0 0 1

and run.mac by

/tracking/verbose 1

/run/initialize

/gun/particle e-
/gun/energy 30 keV
/run/beamOn 10



I have also tried with geant4.9.4.beta01. The visualisation confirms that the track is outside the tube, while the printing says it is in the tube volume.
Comment 6 Vladimir.Ivantchenko 2010-07-29 20:17:10 CEST
Hi Pedro,
The problem connect with not correct value of safety, so should be discussed with geometry working group members. Your example emphasize the problem which has low probability in other geometries.

VI
Comment 7 John Apostolakis 2010-09-08 17:58:46 CEST
I made an inspection of the safety in the Tubs - and the estimation appears valid.

The problem appears to be due to Multiple Scattering rounding down the displacement to the value of the safety.  Because of the cylinder geometry this means that the point arrives at the surface with high probability (if the original endpoint is on the axis.)

As the Multiple Scattering does *not* change the volume ( to keep it consistent ), the Navigation after this is confused.

This is a preliminary conclusion - but an improvement of the relevant code is being prepared.
Comment 8 Vladimir.Ivantchenko 2010-09-24 20:40:56 CEST
The fix path Geant4 testing and will appear in the next reference version.