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