Problem 1151

Summary: Problem in volume assignment for regular navigation
Product: Geant4 Reporter: Pedro.Arce
Component: geometry/navigationAssignee: Pedro.Arce
Status: RESOLVED FIXED    
Severity: trivial CC: Gabriele.Cosmo, John.Apostolakis, Vladimir.Ivantchenko
Priority: P5    
Version: other   
Hardware: PC   
OS: Linux   
Attachments: DICOM example with phantom to reproduce the problem

Description Pedro.Arce 2010-11-18 11:32:10 CET
I have found a bug in the assigning of volumes, that I think is due to the msc. I found it while running with G4RegularNavigation, because I do many checks that point is properly allocated, but I am afraid it may happen for any case. I run the DICOM example with a simple phantom 1X10X10 voxels that extends X:-100,100 Y:-100,100 Z:0,100
It seems that msc located the step in the voxels, while it is outside. I run the geant4.9.4.cand00, but I have seen the error message many times in all geant4 versions. I thought it was a problem of precision, but you see that after it is wrongly located, it stays locating it wrongly even if it travels far apart. I switched on the G4Navigator::LocateGlobalPointAndSetup() verbosity in case it may help you. I am attaching a tar ball with the code to reproduce the problem. Just run

dicom run.mac

---------------------------------------------------------------------------------------------------------------------------------------------------
   19     16.5     1.19     95.9     0.532  0.00475    0.722      29.8     Patient eIoni
*** G4Navigator:LocateGlobalPointAndSetup: ***
    Called with arguments:
    Globalpoint = (16.503871,1.1884498,95.875869)
    RelativeSearch = 1
    ----- Upon entering:
*** G4Navigator::LocateGlobalPointAndSetup(): ***
    Invoked Inside() for solid: Voxel. Solid replied: -kInside-
    For local point p: (16.50387104924103,-8.811550150994499,0.8758694503247426)
    Return value = new volume = Patient
    ----- Upon exiting:
*** G4Navigator:LocateGlobalPointAndSetup: ***
    Called with arguments:
    Globalpoint = (16.503871,1.1884498,95.875869)
    RelativeSearch = 1
    ----- Upon entering:
*** G4Navigator::LocateGlobalPointAndSetup(): ***
    Invoked Inside() for solid: Voxel. Solid replied: -kInside-
    For local point p: (16.50387104924103,-8.811550150994499,0.8758694503247426)
    Return value = new volume = Patient
    ----- Upon exiting:
   20     16.9     2.24      100     0.506   0.0258     4.49      34.3     Patient msc
*** G4Navigator:LocateGlobalPointAndSetup: ***
    Called with arguments:
    Globalpoint = (16.901778,2.2419983,100.12456)
    RelativeSearch = 1
    ----- Upon entering:
*** G4Navigator::LocateGlobalPointAndSetup(): ***
    Invoked Inside() for solid: Voxel. Solid replied: -kOutside-
    For local point p: (16.90177758789581,-7.758001692894469,5.124564165943895)
*** G4Navigator::LocateGlobalPointAndSetup(): ***
    Invoked Inside() for solid: PhantomContainer. Solid replied: -kOutside-
    For local point p: (16.90177758789581,2.241998307105531,50.12456416594389)
*** G4Navigator::LocateGlobalPointAndSetup(): ***
    Invoked Inside() for solid: WorldSolid. Solid replied: -kInside-
    For local point p: (16.90177758789581,2.241998307105531,100.1245641659439)
    Return value = new volume = World
    ----- Upon exiting:

*** G4Exception : Bad-location-of-point
      issued by : G4Navigator::ComputeStep()
Point is relocated in voxels, while it should be outside!
*** This is just a warning message.
   21     17.5     3.45      102     0.486   0.0172     2.63      36.9     Patient eIoni
   22     17.6     4.33      104     0.474   0.0119     1.61      38.5     Patient eIoni
   23     18.4     5.35      106     0.457   0.0158     2.32      40.8     Patient eIoni
   24       19     5.48      108     0.441   0.0149     2.34      43.2     Patient eIoni
   25     19.3      5.7      112     0.414   0.0277     4.54      47.7     Patient msc
   26     19.4     5.71      112      0.41  9.3e-05   0.0538      47.7     Patient eIoni
   27     19.4     5.72      112      0.39 4.51e-05   0.0339      47.8     Patient eIoni
   28     19.4     6.18      113     0.383    0.005    0.974      48.8     Patient eIoni
   29     18.9     6.34      114     0.374  0.00784     1.35      50.1     Patient eIoni
   30     18.5     6.91      116     0.361   0.0114     1.65      51.8     Patient eIoni
   31     18.4     7.09      116     0.357   0.0029    0.521      52.3     Patient eIoni
Comment 1 Pedro.Arce 2010-11-18 11:35:04 CET
Created attachment 93 [details]
DICOM example with phantom to reproduce the problem
Comment 2 Gabriele Cosmo 2010-11-18 11:49:07 CET
Should be analyzed the code which is currently included in G4Navigator for the case of regular navigation, where an anomalous call to:
  LocateGlobalPointAndSetup( pGlobalpoint, &pDirection, true, true );
is made in ComputeStep() (line 711).
The DICOM example should also be reviewed, fixes were introduced in the latest version included in the latest candidate tag (geant4-09-04-cand-00), which are not taken into account in this version of the DICOM code you attached.
Comment 3 Pedro.Arce 2010-11-18 14:48:55 CET
The call to LocateGlobalPointAndSetup is done to relocate the point, as I found problems with msc volume location. And I think also for the comment there
            // if physical process limits the step, the voxel will not be the
            // one given by ComputeStepSkippingEqualMaterials() and the local
            // point will be wrongly calculated.
although sincerely I do not understand what I meant when I wrote that three years ago.

If this is not put, the calculation of voxel number gives an exception becuase the point is outside the phantom:

   56     11.7    -71.6     1.76     0.403    0.014     2.24       124     Patient eIoni
   57     9.95    -70.8  -0.0173     0.381   0.0176     2.64       126     Patient eIoni
ERROR - G4PhantomParameterisation::GetReplicaNo()
        localPoint - (9.95346,-70.8122,-50.0173) - is outside container solid: PhantomContaine


*** G4Exception : InvalidSetup
      issued by : G4PhantomParameterisation::GetReplicaNo()
Point outside voxels!
*** Fatal Error In Argument *** core dump ***

*** G4Exception: Aborting execution ***

I will try to reproduce the problem without regular navigation.
Comment 4 Pedro.Arce 2012-09-14 12:26:54 CEST
New geant4 has reviewed msc geometry logic, and should solve the problem. I am not able to reproduce the problem.