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);
118 const G4double time = (position-x0).dot(velocityUnitVector)/scalarVelocity;
125 return getTrajectoryIntersection(x0, p, r,
true);
129 return getTrajectoryIntersection(x0, p, r,
false);
133 return std::make_pair(
134 getTrajectoryIntersection(x0, p, r,
true),
135 getTrajectoryIntersection(x0, p, r,
false)