487 fPositionChanged =
false;
493 tPathLength = geomLength;
513 tPathLength =
std::min(tPathLength, physStepLimit);
516 if(tPathLength < range && tPathLength > geomMin) {
527 if(r2 > minDisplacement2) {
529 fPositionChanged =
true;
536 if(postSafety > 0.0 && dispR <= postSafety) {
537 fNewPosition += displacement;
543 if(dispR < postSafety) {
544 fNewPosition += displacement;
548 }
else if(fDispBeyondSafety && 0.0 == postSafety) {
549 fNewPosition += displacement;
551 std::min(2.0*dispR, geomLength*(physStepLimit/tPathLength - 1.0));
553 G4double safety = postSafety + dispR;
565 fNewDirection, maxshift, &dist, &safety)
566 && std::abs(dist) < maxshift) {
577 tPathLength *= (1.0 + dist/geomLength);
578 fNewPosition += dist*fNewDirection;
582 maxshift =
std::min(maxshift, geomLength);
583 if(0.0 < maxshift + dist) {
586 G4double R2 = (postpoint - point).mag2();
589 for(
G4int i=0; i<10; ++i) {
592 point, fNewDirection, maxshift, &dist, &safety)
593 && std::abs(newdist + dist) < maxshift) {
594 point += dist*fNewDirection;
595 G4double R2new = (postpoint - point).mag2();
598 if(dist >= 0.0 || R2new > R2) {
break; }
600 fNewPosition = point;
606 tPathLength *= (1.0 + newdist/geomLength);
609 fNewPosition += displacement*(postSafety/dispR - 1.0);
614 fNewPosition += displacement*(postSafety/dispR - 1.0);
617 }
else if(postSafety > geomMin) {
618 fNewPosition += displacement*(postSafety/dispR);
622 fPositionChanged =
false;
625 if(fPositionChanged) {
const G4ThreeVector * GetMomentumDirection() const
void ReLocateWithinVolume(const G4ThreeVector &pGlobalPoint)
G4double GetStepLength() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4ParticleChangeForMSC fParticleChange
virtual G4double ComputeTrueStepLength(G4double geomPathLength)
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
const G4ParticleDefinition const G4Material *G4double range
const G4ThreeVector & GetPosition() const
G4double GetRange(const G4ParticleDefinition *part, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
void ProposeTrueStepLength(G4double truePathLength)
G4double ComputeSafety(const G4ThreeVector &pGlobalPoint, G4double maxRadius=DBL_MAX)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
void ProposePosition(const G4ThreeVector &finalPosition)
static constexpr double nm
G4StepPoint * GetPostStepPoint() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4bool RecheckDistanceToCurrentBoundary(const G4ThreeVector &pGlobalPoint, const G4ThreeVector &pDirection, const G4double pCurrentProposedStepLength, G4double *prDistance, G4double *prNewSafety=0) const
virtual G4ThreeVector & SampleScattering(const G4ThreeVector &, G4double safety)