File indexing completed on 2026-04-17 08:35:36
0001 #ifndef VECGEOM_PLANAR_IMPL_H
0002 #define VECGEOM_PLANAR_IMPL_H
0003
0004 #include <VecGeom/surfaces/surf/SurfaceHelper.h>
0005
0006 namespace vgbrep {
0007
0008
0009
0010 template <typename Real_t>
0011 struct SurfaceHelper<SurfaceType::kPlanar, Real_t> {
0012
0013 SurfaceHelper() = default;
0014
0015 VECGEOM_FORCE_INLINE
0016 VECCORE_ATT_HOST_DEVICE
0017
0018
0019
0020
0021 bool Inside(Vector3D<Real_t> const &point, bool flip, Real_t tol = vecgeom::kToleranceStrict<Real_t>)
0022 {
0023 int flipsign = !flip ? 1 : -1;
0024 return point.z() < flipsign * tol;
0025 }
0026
0027 VECGEOM_FORCE_INLINE
0028 VECCORE_ATT_HOST_DEVICE
0029
0030
0031
0032
0033
0034
0035 bool Intersect(Vector3D<Real_t> const &point, Vector3D<Real_t> const &dir, bool left_side, Real_t &distance,
0036 bool &two_solutions, Real_t &safety)
0037 {
0038
0039 bool surfhit = left_side ^ (dir[2] < 0);
0040 distance = -point[2] / vecgeom::NonZero(dir[2]);
0041 safety = point[2];
0042 return surfhit;
0043 }
0044
0045 VECGEOM_FORCE_INLINE
0046 VECCORE_ATT_HOST_DEVICE
0047
0048
0049
0050
0051
0052
0053 bool Safety(Vector3D<Real_t> const &point, bool left_side, Real_t &distance, Vector3D<Real_t> &onsurf) const
0054 {
0055 distance = left_side ? -point[2] : point[2];
0056
0057 onsurf.Set(point[0], point[1], 0);
0058 return distance > -vecgeom::kToleranceDist<Real_t>;
0059 }
0060 };
0061
0062 }
0063
0064 #endif