573{
574#ifdef G4VERBOSE
576 {
577 G4cout <<
" G4DNABrownianTransportation::AlongStepGetPhysicalInteractionLength - track ID: "
581 }
582#endif
583
586 track, previousStepSize, currentMinimumStep, currentSafety,
587 selection);
588
589 if(geometryStepLength==0)
590 {
591
592 if(
State(fGeometryLimitedStep))
593 {
594
596
598 State(fCurrentTouchableHandle)->GetHistory());
599
603 newTouchable, true);
604
606 {
607 return 0;
608 }
609
610 State(fCurrentTouchableHandle) = newTouchable;
611
612
613
614
615
616
617
618
619
620
621
622
623 geometryStepLength =
625 track, previousStepSize, currentMinimumStep, currentSafety,
626 selection);
627
628 }
629 }
630
631
632
633
634
635
636
637
639 {
640
642 geometryStepLength = distanceToBoundary;
643 }
644
645
646
647
649
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
678
679
680 if(diffusionCoefficient <= 0)
681 {
682 State(fGeometryLimitedStep) =
false;
685 return 0;
686 }
687
688
689 State(fComputeLastPosition) =
false;
690 State(fTimeStepReachedLimit) =
false;
691
692 if (
State(fGeometryLimitedStep))
693 {
694
695
696
697
699 {
701 {
702 State(theInteractionTimeLeft) = (geometryStepLength * geometryStepLength)
703 / (diffusionCoefficient);
704 }
705 else
706 {
707 State(theInteractionTimeLeft) = (currentSafety * currentSafety)
708 / (diffusionCoefficient);
709
710
711
712
713
714 }
715 State(fComputeLastPosition) =
true;
716 }
717 else
718
719
720 {
722 State(theInteractionTimeLeft) = 1 / (4 * diffusionCoefficient)
723 * pow(geometryStepLength / InvErfc(
State(fRandomNumber)),2);
724
725 State(fTransportEndPosition) = geometryStepLength*
727 }
728
730 {
732
733
734
735
736
737 if (
State(theInteractionTimeLeft) < minTimeStepAllowed)
738 {
739 State(theInteractionTimeLeft) = minTimeStepAllowed;
740 State(fTimeStepReachedLimit) =
true;
741 State(fComputeLastPosition) =
true;
742 }
743 }
745
746 {
747 State(fTimeStepReachedLimit) =
true;
750 {
751 State(fComputeLastPosition) =
true;
752 }
753 }
754
755 State(fCandidateEndGlobalTime) =
757
758 State(fEndGlobalTimeComputed) =
true;
759
760 State(fPathLengthWasCorrected) =
false;
761 }
762 else
763 {
764
765 geometryStepLength = 2
766 * sqrt(diffusionCoefficient *
State(theInteractionTimeLeft))
768 State(fPathLengthWasCorrected) =
true;
769
770 State(fTransportEndPosition) = geometryStepLength*
772 }
773
774#ifdef G4VERBOSE
775
777 {
779 << "G4DNABrownianTransportation::AlongStepGetPhysicalInteractionLength = "
781 << " | trackID = "
785 }
786#endif
787
788
789
790
791 return geometryStepLength;
792}
G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double, G4double currentMinimumStep, G4double ¤tSafety, G4GPILSelection *selection) override
G4ITNavigator * fLinearNavigator
G4double GetDiffusionCoefficient() const
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
virtual void UpdateYourself(G4VPhysicalVolume *pPhysVol, const G4NavigationHistory *history=nullptr)
G4VPhysicalVolume * GetVolume() const
G4double GetGlobalTime() const
const G4String & GetName() const
static G4VScheduler * Instance()
virtual double GetLimitingTimeStep() const
virtual G4double GetDistanceToBoundary(const G4Track &)=0