Problem 1826 - Problem with G4OpBoundaryProcess
Summary: Problem with G4OpBoundaryProcess
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/optical (show other problems)
Version: 10.1
Hardware: All Linux
: P5 trivial
Assignee: gum
URL:
Depends on:
Blocks:
 
Reported: 2016-02-10 07:57 CET by tetsuma-yaguchi@kylab.sci.waseda.ac.jp
Modified: 2016-02-17 00:16 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description tetsuma-yaguchi@kylab.sci.waseda.ac.jp 2016-02-10 07:57:51 CET
I didn't get proper light distribution in optical simulation with the LUT model.
I found a problem with G4OpBoundaryProcess.cc and made a little change in it.
It seems to work.



diff G4OpBoundaryProcess.cc


841a842,844
>               NewMomentum =
>                 NewMomentum.rotate(anglePhotonToNormal-thetaRad,
>                                    PerpendicularVectorTheta);
846a850,852
>                NewMomentum =
>                  NewMomentum.rotate(anglePhotonToNormal-thetaRad,
>                                     PerpendicularVectorTheta);
850,852c856
<               NewMomentum =
<                  NewMomentum.rotate(anglePhotonToNormal-thetaRad,
<                                     PerpendicularVectorTheta);
---
Comment 1 gum 2016-02-10 20:24:46 CET
Sorry, what exactly did you change, and why?
Comment 2 tetsuma-yaguchi@kylab.sci.waseda.ac.jp 2016-02-11 05:06:59 CET
(In reply to comment #1)
> Sorry, what exactly did you change, and why?

I changed a part of "void G4OpBoundaryProcess::DielectricLUT()", line 751-809 of file G4OpBoundaryProcess.cc.

I moved 
"NewMomentum = NewMomentum.rotate(anglePhotonToNormal-thetaRad,PerpendicularVectorTheta);" 
from line 799-801 to  above line 791 and to above line 796.

I think "NewMomentum" must be rotated around "PerpendicularVectorTheta" before definition of "PerpendicularVectorPhi" at line 791 and 796.
Comment 3 gum 2016-02-17 00:16:35 CET
this is now fixed with tag: op-V10-02-00

The code in G4OpBoundaryProcess::DielectricLUT now reads:

              PerpendicularVectorTheta = NewMomentum.cross(theGlobalNormal);
              if (PerpendicularVectorTheta.mag() < kCarTolerance )
                          PerpendicularVectorTheta = NewMomentum.orthogonal();
              NewMomentum =
                 NewMomentum.rotate(anglePhotonToNormal-thetaRad,
                                    PerpendicularVectorTheta);
              PerpendicularVectorPhi =
                                  PerpendicularVectorTheta.cross(NewMomentum);
              NewMomentum = NewMomentum.rotate(-phiRad,PerpendicularVectorPhi);

e.g. the sequence of rotations are:

P_perp_theta = P x N
P_new = rotate P by theta around P_perp_theta
P_perp_phi = P_perp_theta x P_new
P_new_prime = rotate P_new by phi around P_perp_phi

thanks to Tetsuma Yaguchi