|Message: Re: Error: local time goes back!!||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
Your process isn't all that trivial ... you are changing the direction at the boundary between volumes! The G4Navigator 'thinks' that the track is going into the next volume but you may change the direction and so the track doesn't. This can be - and is - solved in Geant4 by optical photon tracking where we may have a reflection at the boundary. I suggest you follow what is done in G4OpBounaryProcess::PostStepDoIt.
A few hints (I don't know whether they will solve your issue):
at the very start of the method - unconditionally!
if (aTrack.GetStepLength()<=kCarTolerance/2)return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
This prevents your process from being called again if the track reflects - in that case, there is a zero-length step the G4Navigator takes to relocate its internals.
> Geant4 calculates all other correlated parameters (such as the > deposited energy and momentum conservation, momentum unit vector, etc) > by itself according to the direction change?
No, Geant4 doesn't calculate anything. You tell it that if the process does nothing, the track should be unchanged. This is by calling: aParticleChange.Initialize(aTrack). We need to also call aParticleChange.ProposeVelocity(aTrack.GetVelocity()). This is because of:
but I don't know if it affects you.
You must give a momentum change with a unit vector (which you do) - there is no energy deposit and nothing checks momentum conservation.
See what happens, Peter
|Inline Depth:||Outline Depth:||Add message:|