00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #define INCLXX_IN_GEANT4_MODE 1
00034
00035 #include "globals.hh"
00036
00044 #ifndef G4INCLINTERSECTION_HH
00045 #define G4INCLINTERSECTION_HH 1
00046
00047 #include "G4INCLThreeVector.hh"
00048 #include <utility>
00049
00050 namespace G4INCL {
00056 struct Intersection {
00057 Intersection(const G4bool e, const G4double t, const ThreeVector &p) :
00058 exists(e), time(t), position(p) {}
00059 G4bool exists;
00060 G4double time;
00061 ThreeVector position;
00062 };
00063
00064 class IntersectionFactory {
00065 public:
00076 static inline Intersection getEarlierTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r) {
00077 return getTrajectoryIntersection(x0, p, r, true);
00078 }
00079 static inline Intersection getLaterTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r) {
00080 return getTrajectoryIntersection(x0, p, r, false);
00081 }
00082 static inline std::pair<Intersection,Intersection> getTrajectoryIntersections(const ThreeVector &x0, const ThreeVector &p, const G4double r) {
00083 return std::make_pair(
00084 getTrajectoryIntersection(x0, p, r, true),
00085 getTrajectoryIntersection(x0, p, r, false)
00086 );
00087 }
00088 private:
00089 static Intersection getTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r, const G4bool earliest);
00090 };
00091 }
00092
00093 #endif