File indexing completed on 2025-01-18 10:13:59
0001
0002
0003
0004
0005
0006
0007 #ifndef VECGEOM_VOLUMES_KERNEL_SHAPETYPES_HYPETYPES_H_
0008 #define VECGEOM_VOLUMES_KERNEL_SHAPETYPES_HYPETYPES_H_
0009
0010 #include <string>
0011
0012 namespace vecgeom {
0013
0014 VECGEOM_DEVICE_DECLARE_NS_CONV(HypeTypes, struct, UniversalHype, UniversalHype);
0015
0016 #ifndef VECGEOM_NO_SPECIALIZATION
0017 VECGEOM_DEVICE_DECLARE_NS_CONV(HypeTypes, struct, NonHollowHype, UniversalHype);
0018 VECGEOM_DEVICE_DECLARE_NS_CONV(HypeTypes, struct, HollowHype, UniversalHype);
0019 #endif
0020
0021 inline namespace VECGEOM_IMPL_NAMESPACE {
0022 namespace HypeTypes {
0023
0024 #define DEFINE_HYPE_TYPE(name) \
0025 struct name { \
0026 VECCORE_ATT_HOST_DEVICE \
0027 static char const *toString() { return #name; } \
0028 }
0029
0030
0031
0032 DEFINE_HYPE_TYPE(UniversalHype);
0033
0034
0035 DEFINE_HYPE_TYPE(NonHollowHype);
0036
0037
0038 DEFINE_HYPE_TYPE(HollowHype);
0039
0040 #undef DEFINE_HYPE_TYPE
0041
0042
0043 enum ETreatmentType { kYes = 0, kNo, kUnknown };
0044
0045
0046 template <typename T>
0047 struct NeedsRminTreatment {
0048 static const ETreatmentType value = kYes;
0049 };
0050 template <>
0051 struct NeedsRminTreatment<NonHollowHype> {
0052 static const ETreatmentType value = kNo;
0053 };
0054
0055 template <>
0056 struct NeedsRminTreatment<UniversalHype> {
0057 static const ETreatmentType value = kUnknown;
0058 };
0059
0060 template <typename T, typename UnplacedHype>
0061 VECGEOM_FORCE_INLINE
0062 VECCORE_ATT_HOST_DEVICE
0063 bool checkInnerSurfaceTreatment(const UnplacedHype &hype)
0064 {
0065
0066 if (NeedsRminTreatment<T>::value != kUnknown)
0067 return NeedsRminTreatment<T>::value == kYes;
0068 else
0069 return hype.InnerSurfaceExists();
0070 }
0071
0072 }
0073 }
0074 }
0075
0076 #endif