File indexing completed on 2026-07-05 08:47:40
0001
0002
0003
0004 #ifndef VECGEOM_VOLUMES_UNPLACEDCOAXIALCONES_H_
0005 #define VECGEOM_VOLUMES_UNPLACEDCOAXIALCONES_H_
0006
0007 #include "VecGeom/base/Cuda.h"
0008 #include "VecGeom/base/Global.h"
0009 #include "VecGeom/base/AlignedBase.h"
0010 #include "VecGeom/base/Vector3D.h"
0011 #include "VecGeom/volumes/UnplacedVolume.h"
0012 #include "VecGeom/volumes/CoaxialConesStruct.h" // the pure CoaxialCones struct
0013 #include "VecGeom/volumes/kernel/CoaxialConesImplementation.h"
0014 #include "VecGeom/volumes/UnplacedVolumeImplHelper.h"
0015
0016 namespace vecgeom {
0017
0018 VECGEOM_DEVICE_FORWARD_DECLARE(class UnplacedCoaxialCones;);
0019 VECGEOM_DEVICE_DECLARE_CONV(class, UnplacedCoaxialCones);
0020
0021 inline namespace VECGEOM_IMPL_NAMESPACE {
0022
0023 class UnplacedCoaxialCones : public UnplacedVolumeImplHelper<CoaxialConesImplementation>, public AlignedBase {
0024
0025 private:
0026 CoaxialConesStruct<Precision> fCoaxialCones;
0027
0028 public:
0029
0030
0031
0032
0033 VECCORE_ATT_HOST_DEVICE
0034 UnplacedCoaxialCones() { ComputeBBox(); }
0035
0036 VECCORE_ATT_HOST_DEVICE
0037 UnplacedCoaxialCones(unsigned int numOfCones, Precision *rmin1Vect, Precision *rmax1Vect, Precision *rmin2Vect,
0038 Precision *rmax2Vect, Precision dz, Precision sphi, Precision dphi)
0039 : fCoaxialCones(numOfCones, rmin1Vect, rmax1Vect, rmin2Vect, rmax2Vect, dz, sphi, dphi)
0040 {
0041 ComputeBBox();
0042 }
0043
0044 VECCORE_ATT_HOST_DEVICE
0045 VECGEOM_FORCE_INLINE
0046 virtual ESolidType GetType() const override { return ESolidType::coaxialcones; }
0047
0048 VECCORE_ATT_HOST_DEVICE
0049 CoaxialConesStruct<Precision> const &GetStruct() const { return fCoaxialCones; }
0050
0051 VECCORE_ATT_HOST_DEVICE
0052 void Extent(Vector3D<Precision> &, Vector3D<Precision> &) const override;
0053
0054 Precision Capacity() const override { return fCoaxialCones.fCubicVolume; }
0055
0056 Precision SurfaceArea() const override { return fCoaxialCones.fSurfaceArea; }
0057
0058 VECCORE_ATT_HOST_DEVICE
0059 virtual bool Normal(Vector3D<Precision> const &p, Vector3D<Precision> &normal) const override
0060 {
0061 return fCoaxialCones.Normal(p, normal);
0062 }
0063
0064 std::string GetEntityType() const { return "CoaxialCones"; }
0065
0066 std::ostream &StreamInfo(std::ostream &os) const;
0067
0068 public:
0069 virtual int MemorySize() const final { return sizeof(*this); }
0070
0071 VECCORE_ATT_HOST_DEVICE
0072 virtual void Print() const override;
0073
0074 virtual void Print(std::ostream &os) const override;
0075
0076 #ifdef VECGEOM_CUDA_INTERFACE
0077 virtual size_t DeviceSizeOf() const override { return DevicePtr<cuda::UnplacedCoaxialCones>::SizeOf(); }
0078 virtual DevicePtr<cuda::VUnplacedVolume> CopyToGpu() const override;
0079 virtual DevicePtr<cuda::VUnplacedVolume> CopyToGpu(DevicePtr<cuda::VUnplacedVolume> const gpu_ptr) const override;
0080 #endif
0081
0082 #ifndef VECCORE_CUDA
0083
0084
0085 static VPlacedVolume *Create(LogicalVolume const *const logical_volume, Transformation3D const *const transformation,
0086 VPlacedVolume *const placement = NULL);
0087
0088 VPlacedVolume *SpecializedVolume(LogicalVolume const *const volume, Transformation3D const *const transformation,
0089 VPlacedVolume *const placement) const override;
0090 #else
0091 VECCORE_ATT_DEVICE
0092 static VPlacedVolume *Create(LogicalVolume const *const logical_volume, Transformation3D const *const transformation,
0093 const int id, const int copy_no, const int child_id,
0094 VPlacedVolume *const placement = NULL);
0095 VECCORE_ATT_DEVICE VPlacedVolume *SpecializedVolume(LogicalVolume const *const volume,
0096 Transformation3D const *const transformation, const int id,
0097 const int copy_no, const int child_id,
0098 VPlacedVolume *const placement) const override;
0099
0100 #endif
0101 };
0102 }
0103 }
0104
0105 #endif