Problem 1071 - Improper exit normal vector for rotated G4Polyhedra
Summary: Improper exit normal vector for rotated G4Polyhedra
Status: RESOLVED DUPLICATE of problem 1059
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry/navigation (show other problems)
Version: 9.2
Hardware: PC Linux
: P4 minor
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2009-06-26 10:00 CEST by Ko Abe
Modified: 2009-06-26 13:09 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Ko Abe 2009-06-26 10:00:38 CEST
I made hex solid using G4Polyhedra inside world volume. I gave the refractive indexes for these and generated optical photons from outside of this solid toward the hex solid. 
Without rotation of the solid, angle of refraction for both entering and exiting from this solid are proper. However after rotation, while angle for entering is proper, exiting angle is always improper. 

I found that ExitNormal for this G4Polyhedra is improper.

It looks that validExitNormal for this hex solid is always false, and calculation of ExitNormal is done in G4Navigator::ComputeStep at following part, 

    if(fValidExitNormal)
    {
      // Convention: fExitNormal is in the 'grand-mother' coordinate system
      //
      fGrandMotherExitNormal= fExitNormal;
    }
    else
    {  
      // We must calculate the normal anyway (in order to have it if requested)
      //
      G4ThreeVector finalLocalPoint =
        fLastLocatedPointLocal + localDirection*Step;

      // Now fGrandMotherExitNormal is in the 'grand-mother' coordinate system
      //
      fGrandMotherExitNormal =
        motherLogical->GetSolid()->SurfaceNormal(finalLocalPoint);

      const G4RotationMatrix* mRot = motherPhysical->GetRotation();
      if( mRot )
      { 
        fGrandMotherExitNormal *= (*mRot);
      }
    }
  }

Isn't this 
"fGrandMotherExitNormal *= (*mRot);" 
wrong?
Since motherPhysical->GetRotation() returns rotation for frame, I think 
"fGrandMotherExitNormal *= mRot -> inverse();" 
is proper.

Thanks,  Ko Abe
Comment 1 Gabriele Cosmo 2009-06-26 13:09:58 CEST
The problem has been already addressed for #1059 and the fix made available in 9.3-beta release.
A future patch to 9.2 will include it as well.

*** This problem has been marked as a duplicate of problem 1059 ***