Problem 446 - G4ForceCondition and Stepping
Summary: G4ForceCondition and Stepping
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: tracking (show other problems)
Version: 4.1
Hardware: PC Linux
: P2 normal
Assignee: Katsuya.Amako
URL:
Depends on:
Blocks:
 
Reported: 2003-01-10 18:33 CET by savage
Modified: 2003-01-14 16:43 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 savage 2003-01-10 18:33:40 CET
I'm assuming this behavior isn't intended:

It appears the Stepping Manager ignores proposed step sizes from discrete
processes that give a G4ForceCondition of ExclusivelyForced, Conditionally, or
Forced.  This occurs even if the process suggests the smallest step size.  If
the first discrete process gives a condition ExclusivelyForced, no other process
can propose a step size, which defaults to DBL_MAX.

The offending portion of code in G4SteppingManager2.cc, method
DefinePhysicalStepLength(), is:

     switch (fCondition) {
     case ExclusivelyForced:
       (*fSelectedPostStepDoItVector)[np] = 4;
       fStepStatus = fExclusivelyForcedProc;
           fStep->GetPostStepPoint()
                                 ->SetProcessDefinedStep(fCurrentProcess);
       break;
     case Conditionally:
       (*fSelectedPostStepDoItVector)[np] = 3;
       break;
     case Forced:
       (*fSelectedPostStepDoItVector)[np] = 2;
       break;
     default:
       (*fSelectedPostStepDoItVector)[np] = 0;
       if(physIntLength < PhysicalStep ){
         PhysicalStep = physIntLength;
         fStepStatus = fPostStepDoItProc;
         fPostStepDoItProcTriggered = G4int(np);
         fStep->GetPostStepPoint()
              ->SetProcessDefinedStep(fCurrentProcess);
       }
     }
     if (fCondition==ExclusivelyForced) return;  // Take note the 'return' at
here !!!
   }

I'm guessing the "if(physIntLength < PhysicalStep)" statement should be moved
outside the switch statement, but remain before the "if
(fCondition==ExclusivelyForced)" statement.  As it stands now, PhysicalStep (the
variable used for the actual step size) is only updated with the process'
proposed step (stored in physIntLength) if the switch reaches the default block.

I've looked at the source for the 5.0 release and this behavior exists (the
switch statement has the new case StronglyForced that will also ignore step size).
Comment 1 Takashi.Sasaki 2003-01-14 16:14:59 CET
We do not understant what is this user's problem. The code pointed
out by the user works as our intention.
Comment 2 savage 2003-01-14 16:44:59 CET
Then perhaps you can include this in the documentation.  No where did it mention
(even in the code) that the value returned by
PostStepGetPhysicalInteractionLength() would be ignored for these other values
of G4ForceCondition.  So if I wish to ensure a discrete process is invoked by
setting the flag to Forced, that process can no longer suggest a step size,
leaving the step at the mercy of only other processes.  Why is this behavior
intended?