File indexing completed on 2025-01-30 10:26:24
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef VECGEOM_VOLUMES_TORUSSTRUCT2_H_
0009 #define VECGEOM_VOLUMES_TORUSSTRUCT2_H_
0010 #include "VecGeom/base/Global.h"
0011 #include "VecGeom/volumes/Wedge_Evolution.h"
0012 #include "VecGeom/volumes/UnplacedTube.h"
0013
0014 namespace vecgeom {
0015
0016 inline namespace VECGEOM_IMPL_NAMESPACE {
0017
0018 using GenericUnplacedTube = SUnplacedTube<TubeTypes::UniversalTube>;
0019
0020
0021
0022
0023 template <typename T = double>
0024 struct TorusStruct2 {
0025
0026 T fRmin;
0027 T fRmax;
0028 T fRtor;
0029 T fSphi;
0030 T fDphi;
0031 T fRmin2;
0032 T fRmax2;
0033 T fRtor2;
0034 evolution::Wedge fPhiWedge;
0035 GenericUnplacedTube fBoundingTube;
0036
0037 VECCORE_ATT_HOST_DEVICE
0038 TorusStruct2(const T rmin, const T rmax, const T rtor, const T sphi, const T dphi)
0039 : fRmin(rmin), fRmax(rmax), fRtor(rtor), fSphi(sphi), fDphi(dphi), fRmin2(rmin * rmin), fRmax2(rmax * rmax),
0040 fRtor2(rtor * rtor), fPhiWedge(dphi, sphi), fBoundingTube(0, 1, 1, 0, dphi)
0041 {
0042 fBoundingTube = GenericUnplacedTube(fRtor - fRmax - kTolerance, fRtor + fRmax + kTolerance, fRmax, sphi, dphi);
0043 }
0044
0045 VECCORE_ATT_HOST_DEVICE
0046 T rmin() const { return fRmin; }
0047
0048 VECCORE_ATT_HOST_DEVICE
0049 T rmax() const { return fRmax; }
0050
0051 VECCORE_ATT_HOST_DEVICE
0052 T rtor() const { return fRtor; }
0053
0054 VECCORE_ATT_HOST_DEVICE
0055 T sphi() const { return fSphi; }
0056
0057 VECCORE_ATT_HOST_DEVICE
0058 T dphi() const { return fDphi; }
0059
0060 VECCORE_ATT_HOST_DEVICE
0061 T rmin2() const { return fRmin2; }
0062
0063 VECCORE_ATT_HOST_DEVICE
0064 T rmax2() const { return fRmax2; }
0065
0066 VECCORE_ATT_HOST_DEVICE
0067 T rtor2() const { return fRtor2; }
0068
0069 VECCORE_ATT_HOST_DEVICE
0070 evolution::Wedge GetWedge() const { return fPhiWedge; }
0071
0072 VECCORE_ATT_HOST_DEVICE
0073 GenericUnplacedTube const &GetBoundingTube() const { return fBoundingTube; }
0074 };
0075 }
0076 }
0077
0078 #endif