34#define INCLXX_IN_GEANT4_MODE 1
45#ifndef G4INCLINTERSECTION_HH
46#define G4INCLINTERSECTION_HH 1
66 namespace IntersectionFactory {
106 ThreeVector velocityUnitVector = v / scalarVelocity;
108 ThreeVector positionTransverse = x0 - velocityUnitVector * x0.
dot(velocityUnitVector);
109 const G4double impactParameter = positionTransverse.
mag();
112 G4double distanceZ2 = r2 - impactParameter * impactParameter;
116 const G4double distanceZ = std::sqrt(distanceZ2);
117 const ThreeVector position = positionTransverse + velocityUnitVector * (earliest ? -distanceZ : distanceZ);
133 return std::make_pair(
G4double dot(const ThreeVector &v) const
Intersection getTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &v, const G4double r, const G4bool earliest)
Intersection getLaterTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r)
Compute the second intersection of a straight particle trajectory with a sphere.
Intersection getEarlierTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r)
Compute the first intersection of a straight particle trajectory with a sphere.
std::pair< Intersection, Intersection > getTrajectoryIntersections(const ThreeVector &x0, const ThreeVector &p, const G4double r)
Compute both intersections of a straight particle trajectory with a sphere.
Intersection-point structure.
Intersection(const G4bool e, const G4double t, const ThreeVector &p)