699{
700
702
704
706 {
707 return ;
708 }
709
711 {
715 }
716
717
718
719
720
721
722 fpState->fPhysicalStep =
DBL_MAX;
724
725 double proposedTimeStep =
DBL_MAX;
726 G4VProcess* processWithPostStepGivenByTimeStep(0);
727
728
729 fPostStepDoItProcTriggered = fpProcessInfo->MAXofPostStepLoops;
730 fPostStepAtTimeDoItProcTriggered = fpProcessInfo->MAXofPostStepLoops;
731
732
733
734
735
736 for(size_t np=0; np < fpProcessInfo->MAXofPostStepLoops; np++)
737 {
738 fpCurrentProcess = (
G4VITProcess*) (*fpProcessInfo->fpPostStepGetPhysIntVector)[np];
739 if (fpCurrentProcess== 0)
740 {
741 (fpState->fSelectedPostStepDoItVector)[np] =
InActivated;
742 continue;
743 }
744
747
748
749 fPhysIntLength = fpCurrentProcess->
750 PostStepGPIL( *fpTrack,
751 fpState->fPreviousStepSize,
752 &fCondition );
754
755 switch (fCondition)
756 {
762 break;
763
765
766 G4Exception(
"G4ITStepProcessor::DefinePhysicalStepLength()",
"ITStepProcessor0008",
768 break;
769
771 (fpState->fSelectedPostStepDoItVector)[np] =
Forced;
772 break;
773
776 break;
777
778 default:
779 (fpState->fSelectedPostStepDoItVector)[np] =
InActivated;
780 break;
781 }
782
784 {
785 for(size_t nrest=np+1; nrest < fpProcessInfo->MAXofPostStepLoops; nrest++)
786 {
787 (fpState->fSelectedPostStepDoItVector)[nrest] =
InActivated;
788 }
789 return;
790 }
791 else
792 {
793 if(fPhysIntLength < fpState->fPhysicalStep )
794 {
795
796
797
799 {
800 fPhysIntLength *= -1;
801 if(fPhysIntLength < proposedTimeStep)
802 {
803 proposedTimeStep = fPhysIntLength;
804 fPostStepAtTimeDoItProcTriggered = np;
805 processWithPostStepGivenByTimeStep = fpCurrentProcess;
806 }
807 }
808 else
809 {
810 fpState->fPhysicalStep = fPhysIntLength;
812 fPostStepDoItProcTriggered =
G4int(np);
815 }
816 }
817 }
818 }
819
820
821 fpState->proposedSafety =
DBL_MAX;
822 G4double safetyProposedToAndByProcess = fpState->proposedSafety;
823
824 for(size_t kp=0; kp < fpProcessInfo->MAXofAlongStepLoops; kp++)
825 {
826 fpCurrentProcess = (
G4VITProcess*) (*fpProcessInfo->fpAlongStepGetPhysIntVector)[kp];
827 if (fpCurrentProcess== 0) continue;
828
829
831 fPhysIntLength = fpCurrentProcess-> AlongStepGPIL( *fpTrack,
832 fpState->fPreviousStepSize,
833 fpState->fPhysicalStep,
834 safetyProposedToAndByProcess,
835 &fGPILSelection );
836
837 if(fPhysIntLength < fpState->fPhysicalStep)
838 {
839 fpState->fPhysicalStep = fPhysIntLength;
840
841
842
843
845 {
849 }
850
851
852 if(kp == fpProcessInfo->MAXofAlongStepLoops-1)
853 {
855
856 if(! fpTransportation)
857 {
859 exceptionDescription << "No transportation process found " ;
860 G4Exception(
"G4ITStepProcessor::DoDefinePhysicalStepLength",
"ITStepProcessor0009",
862 }
863
865
866
869 else
871 }
872 }
873 else
874 {
875 if(kp == fpProcessInfo->MAXofAlongStepLoops-1)
876 {
878
879 if(! fpTransportation)
880 {
882 exceptionDescription << "No transportation process found " ;
883 G4Exception(
"G4ITStepProcessor::DoDefinePhysicalStepLength",
"ITStepProcessor0010",
885 }
886
888 }
889 }
890
891 if(proposedTimeStep < fTimeStep)
892 {
893 if(fPostStepAtTimeDoItProcTriggered<fpProcessInfo->MAXofPostStepLoops)
894 {
895 if ((fpState->fSelectedPostStepDoItVector)[fPostStepAtTimeDoItProcTriggered] ==
897 {
898 (fpState->fSelectedPostStepDoItVector)[fPostStepAtTimeDoItProcTriggered] =
NotForced;
899
900
903
904 fTimeStep = proposedTimeStep;
905
906 fpTransportation->
ComputeStep(*fpTrack,*fpStep,fTimeStep,fpState->fPhysicalStep);
907 }
908 }
909 }
910 else
911 {
912 if (fPostStepDoItProcTriggered<fpProcessInfo->MAXofPostStepLoops)
913 {
914 if ((fpState->fSelectedPostStepDoItVector)[fPostStepDoItProcTriggered] ==
916 {
917 (fpState->fSelectedPostStepDoItVector)[fPostStepDoItProcTriggered] =
919 }
920 }
921 }
922
924
925
926
927
928 if (safetyProposedToAndByProcess < fpState->proposedSafety)
929
930 fpState->proposedSafety = safetyProposedToAndByProcess;
931 else
932
933 safetyProposedToAndByProcess = fpState->proposedSafety;
934
935 }
936
939}
void SetNavigatorState(G4ITNavigatorState_Lock *)
G4ITNavigatorState_Lock * GetNavigatorState()
virtual void ComputeStep(const G4Track &, const G4Step &, const double timeStep, double &spaceStep)
G4TrackingInformation * GetTrackingInfo()
void SetProcessDefinedStep(const G4VProcess *aValue)
G4StepPoint * GetPostStepPoint() const
G4VPhysicalVolume * GetNextVolume() const
G4bool ProposesTimeStep() const
size_t GetProcessID() const
void SetProcessState(G4ProcessState_Lock *aProcInfo)
G4double GetInteractionTimeLeft()
std::ostringstream G4ExceptionDescription