Problem 1015 - Neverending simulation loop (G4SubtractionSolid, G4Paraboloid, G4OpticalPhoton)
Summary: Neverending simulation loop (G4SubtractionSolid, G4Paraboloid, G4OpticalPhoton)
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/solids (show other problems)
Version: 9.1
Hardware: Apple Mac OS X
: P2 normal
Assignee: tatiana.nikitina
URL:
Depends on:
Blocks:
 
Reported: 2008-06-30 21:51 CEST by Jonathan Toebbe
Modified: 2008-07-17 08:59 CEST (History)
2 users (show)

See Also:


Attachments
Detector construction showing exactly what I'm doing (7.52 KB, text/plain)
2008-06-30 21:51 CEST, Jonathan Toebbe
Details

Note You need to log in before you can comment on or make changes to this problem.
Description Jonathan Toebbe 2008-06-30 21:51:28 CEST
Created attachment 26 [details]
Detector construction showing exactly what I'm doing

I'm trying to implement an off-axis parabolic mirror by using a  
G4SubtractionSolid. I construct a cylinder and a paraboloid, and then  
subtract the paraboloid (offset appropriately by a G4Transform3D)  
from the cylinder. To test my mirror, I have constructed a  
rudimentary simulation that centers my mirror (made of perfectly  
reflective silver) in a world volume filled with air and fire a  
collimated beam of optical photons at the mirror.

Photons are launched in the +x-direction, and I control the  
orientation of the mirror. When the mirror is aligned parallel to the  
incoming beam, Geant initializes the photon... and then sits there  
forever... Here is an example of the output:

> Idle> /run/beamOn 1
> /run/beamOn 1
>
> [CUT OUT EXCESS VERBOSITY]
>
> Start closing geometry.
> G4GeometryManager::ReportVoxelStats -- Voxel Statistics
>
>     Total memory consumed for geometry optimisation:   0 kByte
>     Total CPU time elapsed for geometry optimisation: 0 seconds
> Start Run processing.
>
> ********************************************************************** 
> ***********************************
> * G4Track Information:   Particle = opticalphoton,   Track ID =  
> 1,   Parent ID = 0
> ********************************************************************** 
> ***********************************
>
> Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng  
> TrackLeng  NextVolume ProcName
>     0     -200    -12.8    -8.02  2.48e-06        0         
> 0         0       World initStep



When I tilt the mirror to *any other angle* (including being off by  
only 1.0*deg from parallel), Geant tracks the photons successfully.  
Here's a sample output when the mirror was only 1.0*deg away from  
being aligned the way I need it to be:

> Idle> /run/beamOn 1
> /run/beamOn 1
>
> [IDENTICAL EXCESS VERBOSITY SNIPPED]
>
> Start Run processing.
>
> ********************************************************************** 
> ***********************************
> * G4Track Information:   Particle = opticalphoton,   Track ID =  
> 1,   Parent ID = 0
> ********************************************************************** 
> ***********************************
>
> Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng  
> TrackLeng  NextVolume ProcName
>     0     -200    -4.22    -3.69  2.48e-06        0         
> 0         0       World initStep
>  Photon at Boundary!
>  Old Momentum Direction: (1,0,0)
>  Old Polarization:       (1,0,0)
>  New Momentum Direction:  
> (-0.05293133382954407,0.02184222449822722,-0.9983592495329496)
>  New Polarization:        
> (0.05293133382954407,-0.02184222449822722,0.9983592495329496)
>  *** SpikeReflection ***
>     1     3.48    -4.22    -3.69  2.48e-06        0      203        
> 203      Mirror Transportation
>     2     3.48    -4.22    -3.69  2.48e-06        0        0        
> 203       World Transportation
>     3    -22.8     6.64     -500  2.48e-06        0      497        
> 701  OutOfWorld Transportation
>
> Run terminated.
> Run Summary
>   Number of events processed : 1
>   User=0s Real=0s Sys=0s
> 1 event has been kept for refreshing and/or reviewing.


The only difference I observe in the failed run is some mention of  
the geometry optimization. I'm very new to Geant, and thus reached  
the limits of my ability to debug things very rapidly. Please help!

Thanks,
Jon Toebbe <jtoebbe@mines.edu>
Comment 1 tatiana.nikitina 2008-07-11 09:48:38 CEST
Dear Jonathan,

Thank you for reporting this problem.
I could reproduce it and I'm working on the fix.

Best Regards,
Tatiana 
Comment 2 tatiana.nikitina 2008-07-17 08:59:18 CEST
 The problem was in G4Paraboloid in DistanceOut(p,v), mainly the numerical precision error in solving quadratic equation when one of the cofficient is very small. The fix will be available in the next release.