574{
575#ifdef G4VERBOSE
577 {
578 G4cout <<
" G4DNABrownianTransportation::AlongStepGetPhysicalInteractionLength - track ID: "
582 }
583#endif
584
587 track, previousStepSize, currentMinimumStep, currentSafety,
588 selection);
589
590 if(geometryStepLength==0)
591 {
592
593 if(
State(fGeometryLimitedStep))
594 {
595
597
599 State(fCurrentTouchableHandle)->GetHistory());
600
604 newTouchable, true);
605
607 {
608 return 0;
609 }
610
611 State(fCurrentTouchableHandle) = newTouchable;
612
613
614
615
616
617
618
619
620
621
622
623
624 geometryStepLength =
626 track, previousStepSize, currentMinimumStep, currentSafety,
627 selection);
628
629 }
630 }
631
632
633
634
635
636
637
638
640 {
641
643 geometryStepLength = distanceToBoundary;
644 }
645
646
647
648
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
679
680
681 if(diffusionCoefficient <= 0)
682 {
683 State(fGeometryLimitedStep) =
false;
686 return 0;
687 }
688
689
690 State(fComputeLastPosition) =
false;
691 State(fTimeStepReachedLimit) =
false;
692
693 if (
State(fGeometryLimitedStep))
694 {
695
696
697
698
700 {
702 {
703 State(theInteractionTimeLeft) = (geometryStepLength * geometryStepLength)
704 / (diffusionCoefficient);
705 }
706 else
707 {
708 State(theInteractionTimeLeft) = (currentSafety * currentSafety)
709 / (diffusionCoefficient);
710
711
712
713
714
715 }
716 State(fComputeLastPosition) =
true;
717 }
718 else
719
720
721 {
723 State(theInteractionTimeLeft) = 1 / (4 * diffusionCoefficient)
724 * pow(geometryStepLength / InvErfc(
State(fRandomNumber)),2);
725
726 State(fTransportEndPosition) = geometryStepLength*
728 }
729
731 {
733
734
735
736
737
738 if (
State(theInteractionTimeLeft) < minTimeStepAllowed)
739 {
740 State(theInteractionTimeLeft) = minTimeStepAllowed;
741 State(fTimeStepReachedLimit) =
true;
742 State(fComputeLastPosition) =
true;
743 }
744 }
746
747 {
748 State(fTimeStepReachedLimit) =
true;
751 {
752 State(fComputeLastPosition) =
true;
753 }
754 }
755
756 State(fCandidateEndGlobalTime) =
758
759 State(fEndGlobalTimeComputed) =
true;
760
761 State(fPathLengthWasCorrected) =
false;
762 }
763 else
764 {
765
766 geometryStepLength = 2
767 * sqrt(diffusionCoefficient *
State(theInteractionTimeLeft))
769 State(fPathLengthWasCorrected) =
true;
770
771 State(fTransportEndPosition) = geometryStepLength*
773 }
774
775#ifdef G4VERBOSE
776
778 {
780 << "G4DNABrownianTransportation::AlongStepGetPhysicalInteractionLength = "
782 << " | trackID = "
786 }
787#endif
788
789
790
791
792 return geometryStepLength;
793}
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double, G4double currentMinimumStep, G4double ¤tSafety, G4GPILSelection *selection)
G4ITNavigator * fLinearNavigator
G4double GetDiffusionCoefficient() const
G4VPhysicalVolume * GetVolume() const
G4double GetGlobalTime() const
const G4String & GetName() const
static G4VScheduler * Instance()
virtual double GetLimitingTimeStep() const
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
virtual void UpdateYourself(G4VPhysicalVolume *pPhysVol, const G4NavigationHistory *history=nullptr)
virtual G4double GetDistanceToBoundary(const G4Track &)=0