////////////////////////////////////////////////////////////////////////////////////////// /// \class RAT::SphericalSubregion /// /// \brief A pure virtual class that defines subregions. A subregion is a feature on an otherwise /// symmetric spherical shell. If a subregion can be reached by a straight track from a point /// within the shell, GEANT will check for intersections. /// /// \author Aksel Hallin aksel.hallin@ualberta.ca /// /// Revision History: \n /// 2014-05-16 Aksel Hallin /// ///\detail This class is used to segment a G4VSolid that is built around a spherical shell into smaller units. Only /// features within a given segment need to be checked for intersection, interiorness, etc. /// ///////////////////////////////////////////////////////////////////////////////////////// #ifndef RAT__SphericalSubregion__ #define RAT__SphericalSubregion__ #include "G4VSolid.hh" #include class SphericalSubregion{ public: /// DistanceToIn Spherical subregion implementation to provide G4VSolid routine. virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &n, const G4double dInner[2], const G4double dOuter[2])const= 0; /// DistanceToIn A spherical subregion needs to implement this to provide G4VSolid routines. virtual G4double DistanceToIn(const G4ThreeVector &p)const = 0; /// DistanceToOut A spherical subregion needs to implement this to provide G4VSolid routines. virtual G4double DistanceToOut(const G4ThreeVector &p)const = 0; /// Inside A spherical subregion needs to implement this to provide G4VSolid routines. virtual EInside Inside(const G4ThreeVector &p)const=0; /// SurfaceNormal A spherical subregion needs to implement this to provide G4VSolid routines. G4ThreeVector SurfaceNormal(const G4ThreeVector &p) { G4bool isValid; return SurfaceNormal(p, isValid); } /// SurfaceNormal A spherical subregion needs to implement this to provide G4VSolid routines. virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p, G4bool &isValid)const = 0; /// OverlapsRegion tests whether the spherical region bounded by the four corners overlaps with this specific /// spherical subregion. This returns true if any event within the sector bounded by those four corners and the /// inner and outer spherical shell radii can intersect with a straight line path. Intersections that require /// passing through a spherical surface first return false. /// @param[in] corners[4] defines the spherical section. virtual G4bool OverlapsRegion(const G4ThreeVector [4])const {return true;} }; #endif