| Summary: | In 9.4.p02 optical photons propagate through the current material with the group velocity computed from optical properties of the preceding material | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | gum |
| Component: | processes/transportation | Assignee: | John Apostolakis <John.Apostolakis> |
| Status: | RESOLVED FIXED | ||
| Severity: | critical | CC: | Gabriele.Cosmo, kurasige |
| Priority: | P5 | ||
| Version: | 9.4 | ||
| Hardware: | All | ||
| OS: | All | ||
A fix has been introduced in tag "transport-V09-04-08". It will be included in the next public patch and release. |
The tag - transport-V09-04-05 introduced by John Apostolakis and included in p02 breaks the correct timing of optical photon tracking! The code used to read in G4Transportation::AlongStepDoIt: G4double finalVelocity = track.GetVelocity() ; .... if (fpDynamicParticle->GetDefinition()== fOpticalPhoton) { // A photon is in the medium of the final point // during the step, so it has the final velocity. deltaTime = stepLength/finalVelocity ; } The track.GetVelocity() method was actually calculating the optical photon's group velocity. John did away with this exception for optical photons. Instead, the initialVelocity is used throughout. There is a big problem for optical photons in p02 and later. My current G4 installation is geant4-09-04-ref-07. In that version of the code, during an optical photon's first step, their velocity is 1 (in units of c_light). This is so because the G4Track constructor sets: fVelocity(c_light) and G4Track::GetVelocity() now simply returns fVelocity. Optical photons usually go directly to volume boundaries. This will trigger G4ParticleChangeForTransport::UpdateStepForAlongStep which will now call for the first time: theVelocityChange = pStep->GetTrack()->CalculateVelocity(); which will update fVelocity to that of the medium going to be left behind if a refraction occurs on the boundary. The propagation time during the next step in the new medium will be updated by the velocity of the previous medium, and so on. This is a very serious error for all of our optical photon simulators! I like Oliver's idea of adding an access function for is_OpticalPhoton to G4Track. This will do away with comparing names or pointers in the G4Transportation logic. The code should read: if(track.IsOpticalPhoton()) { double finalVelocity = track.CalculateVelocityForOpticalPhoton(); deltaTime = stepLength/finalVelocity ; }