[Gate-users] problem about the new version of GATE (V3.0) (bug?)

yuxuan.zhang at di.mdacc.tmc.edu yuxuan.zhang at di.mdacc.tmc.edu
Tue Aug 8 19:43:31 CEST 2006

Sorry I forgot to attach the test bench result in the former email,
here it is.


Recently I installed the new version of the GATE v3.0 into my computer
with Geant4.8.0.p01, CLHEP2.0.2.2, and the compiler is gcc4.0.1 and
the Linux version is Scientific Linux CERN.

After I installed the GATE, I ran the test bench of the PET and the result
is shown here as the attachment. From the result, you will see there are
only 7 sectors in the detector ring, which should be 8. 
Then I checked with my own camera geometry and every time the sector 
was short of 1 as what I have defined.

I checked the source code of GATE and find such code in 
void GateAngularRepeater::PushMyPlacements(const G4RotationMatrix& 
                                             const G4ThreeVector& 
                                             G4double )
  G4double dphi ;
  if ( m_angularSpan == 360. *deg)
  dphi = GetAngularPitch_1();
  if ( m_angularSpan != 360. *deg)
  dphi = GetAngularPitch_2();

I think that the comparision of two float type like this ( m_angularSpan 
== 360. *deg)
is dangeous, sometimes it works fine but sometimes it may give wrong 
result based on what
kind of compiler, system or cpu are used.

So I changed the code as this:

  if ( m_angularSpan < 360.0005 *deg &&  m_angularSpan > 359.9995 *deg)
  dphi = GetAngularPitch_1();
  dphi = GetAngularPitch_2();

After recompile the Gate, now the result seems ok.

I also checked the old versions of GATE, they were all coded in the same 
way and I didn't have
this problem before. So I think it mostly caused by the different compiler 
This just a reminder to you if you have the same proble in your computer.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20060808/97e22031/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: benchmarkPET.gif
Type: image/gif
Size: 23754 bytes
Desc: not available
URL: <http://lists.opengatecollaboration.org/mailman/private/gate-users/attachments/20060808/97e22031/attachment.gif>

More information about the Gate-users mailing list