| Summary: | The velocity is wrong in optical photon propagation | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | gum |
| Component: | track | Assignee: | kurasige |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | kurasige |
| Priority: | P5 | ||
| Version: | other | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
macro to run novice example N06
op-V09-05-00 fixed version of G4OpBoundaryProcess::DoIt |
||
|
Description
gum
2012-01-09 02:44:12 CET
Thank you for reporting the bug.
I looked over the problem.
First, fpTouuchable in G4Track is updated only at the beginning of the Step though the touchable handle to the next volume is proposed in the PostStepDoIt of G4Transportation. So, we should use the touchable handle of PostStepPoint in
G4Track::CalculateVelocityForOpticalPhoton()
So, use GetNextMaterial() instead of GetMaterial().
track-V09-02-05 is the bug fixed tag.
As for the problem that every optical photon step triggers CalculateVelocityForOpticalPhoton, I think that it is not serious because caching mechanism works.
The line
>if (!isVelocityChanged)theVelocityChange =
> pStep->GetTrack()->CalculateVelocity();
is necessary for processes other than optical.
But, I'll continue to think about better solution.
Regards,
Hisaya
Created attachment 149 [details]
op-V09-05-00 fixed version of G4OpBoundaryProcess::DoIt
The tag: op-V09-05-00 fixes this problem. G4OpBoundaryProcess::DoIt calls
aParticleChange.ProposeVelocity(aTrack.GetVelocity()) at every invocation, so
that the variable - isVelocityChanged = true - in G4ParticleChange and hence
theVelocityChange = pStep->GetTrack()->CalculateVelocity() is not requested.
Moreover, for FresnelRefraction the process calculates the finalVelocity
locally from Material2->GetMaterialPropertiesTable()->GetProperty("GROUPVEL")
instead of calling G4Track::CalculateVelocityForOpticalPhoton().
Please, replace the attached file with the one in your 9.5 installation. My
hope is that this fix makes it into patch01 for 9.5.
Again, thank you for reporting this bug and my appologies.
|