File indexing completed on 2025-01-18 10:14:08
0001
0002
0003
0004
0005
0006
0007 #ifndef VECGEOM_VOLUMES_PLACEDCUTTUBE_H_
0008 #define VECGEOM_VOLUMES_PLACEDCUTTUBE_H_
0009
0010 #include "VecGeom/base/Global.h"
0011 #include "VecGeom/volumes/PlacedVolume.h"
0012 #include "VecGeom/volumes/UnplacedVolume.h"
0013 #include "VecGeom/volumes/kernel/CutTubeImplementation.h"
0014 #include "VecGeom/volumes/PlacedVolImplHelper.h"
0015 #include "VecGeom/volumes/UnplacedCutTube.h"
0016
0017 namespace vecgeom {
0018
0019 VECGEOM_DEVICE_FORWARD_DECLARE(class PlacedCutTube;);
0020 VECGEOM_DEVICE_DECLARE_CONV(class, PlacedCutTube);
0021
0022 inline namespace VECGEOM_IMPL_NAMESPACE {
0023
0024 class PlacedCutTube : public PlacedVolumeImplHelper<UnplacedCutTube, VPlacedVolume> {
0025 using Base = PlacedVolumeImplHelper<UnplacedCutTube, VPlacedVolume>;
0026
0027 public:
0028 #ifndef VECCORE_CUDA
0029
0030 using Base::Base;
0031 PlacedCutTube(char const *const label, LogicalVolume const *const logicalVolume,
0032 Transformation3D const *const transformation)
0033 : Base(label, logicalVolume, transformation)
0034 {
0035 }
0036
0037 PlacedCutTube(LogicalVolume const *const logicalVolume, Transformation3D const *const transformation)
0038 : PlacedCutTube("", logicalVolume, transformation)
0039 {
0040 }
0041 #else
0042 VECCORE_ATT_DEVICE PlacedCutTube(LogicalVolume const *const logicalVolume,
0043 Transformation3D const *const transformation, const int id, const int copy_no,
0044 const int child_id)
0045 : Base(logicalVolume, transformation, id, copy_no, child_id)
0046 {
0047 }
0048 #endif
0049
0050 VECCORE_ATT_HOST_DEVICE
0051 virtual ~PlacedCutTube() {}
0052
0053 VECCORE_ATT_HOST_DEVICE
0054 UnplacedCutTube const *GetUnplacedVolume() const
0055 {
0056 return static_cast<UnplacedCutTube const *>(GetLogicalVolume()->GetUnplacedVolume());
0057 }
0058
0059 VECCORE_ATT_HOST_DEVICE
0060 virtual void PrintType() const override;
0061 virtual void PrintType(std::ostream &s) const override;
0062
0063 VECCORE_ATT_HOST_DEVICE
0064 VECGEOM_FORCE_INLINE
0065 Precision rmin() const { return GetUnplacedVolume()->rmin(); }
0066
0067 VECCORE_ATT_HOST_DEVICE
0068 VECGEOM_FORCE_INLINE
0069 Precision rmax() const { return GetUnplacedVolume()->rmax(); }
0070
0071 VECCORE_ATT_HOST_DEVICE
0072 VECGEOM_FORCE_INLINE
0073 Precision z() const { return GetUnplacedVolume()->z(); }
0074
0075 VECCORE_ATT_HOST_DEVICE
0076 VECGEOM_FORCE_INLINE
0077 Precision sphi() const { return GetUnplacedVolume()->sphi(); }
0078
0079 VECCORE_ATT_HOST_DEVICE
0080 VECGEOM_FORCE_INLINE
0081 Precision dphi() const { return GetUnplacedVolume()->dphi(); }
0082
0083 VECCORE_ATT_HOST_DEVICE
0084 VECGEOM_FORCE_INLINE
0085 Vector3D<Precision> BottomNormal() const { return GetUnplacedVolume()->BottomNormal(); }
0086
0087 VECCORE_ATT_HOST_DEVICE
0088 VECGEOM_FORCE_INLINE
0089 Vector3D<Precision> TopNormal() const { return GetUnplacedVolume()->TopNormal(); }
0090
0091
0092
0093 VECGEOM_FORCE_INLINE
0094 virtual int MemorySize() const override { return sizeof(*this); }
0095
0096 #ifndef VECCORE_CUDA
0097 virtual VPlacedVolume const *ConvertToUnspecialized() const override;
0098 #ifdef VECGEOM_ROOT
0099 virtual TGeoShape const *ConvertToRoot() const override;
0100 #endif
0101 #ifdef VECGEOM_GEANT4
0102 virtual G4VSolid const *ConvertToGeant4() const override;
0103 #endif
0104 #endif
0105 };
0106
0107 }
0108 }
0109
0110 #endif