| Summary: | optical photons propopgating at wrong velocity | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | ps |
| Component: | processes/transportation | Assignee: | John Apostolakis <John.Apostolakis> |
| Status: | RESOLVED FIXED | ||
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | 5.1 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
|
Description
ps
2003-07-09 06:09:03 CEST
Linux tar file has been added which contains a short version of the program which also shows the bug. Just under 600 lines of code in total. Sample output is also included, showing the problem. I believe I have traced the problem to a calculation in:
G4VParticleChange* G4Transportation::AlongStepDoIt
In it the time is updated with the following logic:
G4double finalVelocity = track.GetVelocity() ;
G4double initialVelocity = stepData.GetPreStepPoint()->GetVelocity() ;
G4double stepLength = track.GetStepLength() ;
if (finalVelocity > 0.0)
{
G4double meanInverseVelocity ;
// deltaTime = stepLength/finalVelocity ;
meanInverseVelocity = 0.5
* ( 1.0 / initialVelocity + 1.0 / finalVelocity ) ;
deltaTime = stepLength * meanInverseVelocity ;
}
The problem is that the velocity of the PreStepPoint at a boundary is the
velocity in optical medium #1 while the velocity of the PostStepPoint is that of
medium #2 upon refraction. Similarly, upon reflection, the PreStepPoint velocity
is that of medium #2 (remember there is a 'null' step - zero length step - upon
reflection and then the PreStepPoint of the next step points to medium #2),
while the PostStepPoint is back in medium #1.
The optical photon, of course, moves with the velocity of medium #2 upon
refraction and the velocity of medium #1 upon reflection and not their mean! The
fix requires special logic for the optical photon, just like in
G4Track::GetVelocity(), such that only the PostStepPoint velocity is used to
update the time-of-flight.
Thank you for being diligent.
Peter Gumplinger
For optical photons we now use the velocity to use the one for the relevant medium - not the average of initial and final values. This change was included in Geant4 5.2 patch 1 (27 August 2003) Thanks again for your report. Best regards, John Apostolakis |