File indexing completed on 2025-01-18 10:14:08
0001
0002
0003
0004 #ifndef VECGEOM_VOLUMES_PLACEDSCALEDSHAPE_H_
0005 #define VECGEOM_VOLUMES_PLACEDSCALEDSHAPE_H_
0006
0007 #include "VecGeom/base/Global.h"
0008 #include "VecGeom/volumes/PlacedVolume.h"
0009 #include "VecGeom/volumes/UnplacedScaledShape.h"
0010 #include "VecGeom/volumes/kernel/ScaledShapeImplementation.h"
0011 #include "VecGeom/volumes/PlacedVolImplHelper.h"
0012
0013 namespace vecgeom {
0014
0015 VECGEOM_DEVICE_FORWARD_DECLARE(class PlacedScaledShape;);
0016 VECGEOM_DEVICE_DECLARE_CONV(class, PlacedScaledShape);
0017
0018 inline namespace VECGEOM_IMPL_NAMESPACE {
0019
0020 class PlacedScaledShape : public PlacedVolumeImplHelper<UnplacedScaledShape, VPlacedVolume> {
0021 using Base = PlacedVolumeImplHelper<UnplacedScaledShape, VPlacedVolume>;
0022
0023 public:
0024 #ifndef VECCORE_CUDA
0025
0026 using Base::Base;
0027 PlacedScaledShape(char const *const label, LogicalVolume const *const logicalVolume,
0028 Transformation3D const *const transformation)
0029 : Base(label, logicalVolume, transformation)
0030 {
0031 }
0032
0033 PlacedScaledShape(LogicalVolume const *const logicalVolume, Transformation3D const *const transformation)
0034 : PlacedScaledShape("", logicalVolume, transformation)
0035 {
0036 }
0037
0038 #else
0039
0040 VECCORE_ATT_DEVICE PlacedScaledShape(LogicalVolume const *const logicalVolume,
0041 Transformation3D const *const transformation, const int id, const int copy_no,
0042 const int child_id)
0043 : Base(logicalVolume, transformation, id, copy_no, child_id)
0044 {
0045 }
0046
0047 #endif
0048 VECCORE_ATT_HOST_DEVICE
0049 virtual ~PlacedScaledShape() {}
0050
0051
0052
0053 VECCORE_ATT_HOST_DEVICE
0054 UnplacedScaledShape const *GetUnplacedVolume() const
0055 {
0056 return static_cast<UnplacedScaledShape const *>(GetLogicalVolume()->GetUnplacedVolume());
0057 }
0058
0059 VECCORE_ATT_HOST_DEVICE
0060 virtual void PrintType() const override;
0061
0062
0063 void PrintType(std::ostream &os) const override;
0064
0065
0066
0067 virtual int MemorySize() const override { return sizeof(*this); }
0068
0069
0070
0071 #ifndef VECCORE_CUDA
0072 virtual VPlacedVolume const *ConvertToUnspecialized() const override;
0073 #ifdef VECGEOM_ROOT
0074 virtual TGeoShape const *ConvertToRoot() const override;
0075 #endif
0076 #ifdef VECGEOM_GEANT4
0077 virtual G4VSolid const *ConvertToGeant4() const override
0078 {
0079 return nullptr;
0080 }
0081 #endif
0082 #endif
0083 };
0084 }
0085 }
0086
0087 #endif