File indexing completed on 2025-12-16 10:33:33
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef VECGEOM_VOLUMES_PLACEDPARALLELEPIPED_H_
0010 #define VECGEOM_VOLUMES_PLACEDPARALLELEPIPED_H_
0011
0012 #include "VecGeom/base/Global.h"
0013 #include "VecGeom/volumes/PlacedVolume.h"
0014 #include "VecGeom/volumes/UnplacedVolume.h"
0015 #include "VecGeom/volumes/kernel/ParallelepipedImplementation.h"
0016 #include "VecGeom/volumes/PlacedVolImplHelper.h"
0017 #include "VecGeom/volumes/UnplacedParallelepiped.h"
0018
0019 namespace vecgeom {
0020
0021 VECGEOM_DEVICE_FORWARD_DECLARE(class PlacedParallelepiped;);
0022 VECGEOM_DEVICE_DECLARE_CONV(class, PlacedParallelepiped);
0023
0024 inline namespace VECGEOM_IMPL_NAMESPACE {
0025
0026
0027 class PlacedParallelepiped : public PlacedVolumeImplHelper<UnplacedParallelepiped, VPlacedVolume> {
0028 using Base = PlacedVolumeImplHelper<UnplacedParallelepiped, VPlacedVolume>;
0029
0030 public:
0031 #ifndef VECCORE_CUDA
0032 using Base::Base;
0033
0034
0035
0036
0037 PlacedParallelepiped(char const *const label, LogicalVolume const *const logical_volume,
0038 Transformation3D const *const transformation)
0039 : Base(label, logical_volume, transformation)
0040 {
0041 }
0042
0043
0044
0045
0046 PlacedParallelepiped(LogicalVolume const *const logical_volume, Transformation3D const *const transformation)
0047 : PlacedParallelepiped("", logical_volume, transformation)
0048 {
0049 }
0050
0051 #else
0052
0053 VECCORE_ATT_DEVICE PlacedParallelepiped(LogicalVolume const *const logical_volume,
0054 Transformation3D const *const transformation, const int id, const int copy_no,
0055 const int child_id)
0056 : Base(logical_volume, transformation, id, copy_no, child_id)
0057 {
0058 }
0059
0060 #endif
0061
0062 VECCORE_ATT_HOST_DEVICE
0063 virtual ~PlacedParallelepiped() {}
0064
0065
0066 VECCORE_ATT_HOST_DEVICE
0067 UnplacedParallelepiped const *GetUnplacedVolume() const
0068 {
0069 return static_cast<UnplacedParallelepiped const *>(GetLogicalVolume()->GetUnplacedVolume());
0070 }
0071
0072 VECCORE_ATT_HOST_DEVICE
0073 virtual void PrintType() const override;
0074 virtual void PrintType(std::ostream &s) const override;
0075
0076
0077 VECCORE_ATT_HOST_DEVICE
0078 Vector3D<Precision> const &GetDimensions() const { return GetUnplacedVolume()->GetDimensions(); }
0079
0080
0081 VECCORE_ATT_HOST_DEVICE
0082 Precision GetX() const { return GetUnplacedVolume()->GetX(); }
0083
0084
0085 VECCORE_ATT_HOST_DEVICE
0086 Precision GetY() const { return GetUnplacedVolume()->GetY(); }
0087
0088
0089 VECCORE_ATT_HOST_DEVICE
0090 Precision GetZ() const { return GetUnplacedVolume()->GetZ(); }
0091
0092
0093 VECCORE_ATT_HOST_DEVICE
0094 Precision GetAlpha() const { return GetUnplacedVolume()->GetAlpha(); }
0095
0096
0097 VECCORE_ATT_HOST_DEVICE
0098 Precision GetTheta() const { return GetUnplacedVolume()->GetTheta(); }
0099
0100
0101 VECCORE_ATT_HOST_DEVICE
0102 Precision GetPhi() const { return GetUnplacedVolume()->GetPhi(); }
0103
0104
0105 VECCORE_ATT_HOST_DEVICE
0106 Precision GetTanAlpha() const { return GetUnplacedVolume()->GetTanAlpha(); }
0107
0108
0109 VECCORE_ATT_HOST_DEVICE
0110 Precision GetTanThetaSinPhi() const { return GetUnplacedVolume()->GetTanThetaSinPhi(); }
0111
0112
0113 VECCORE_ATT_HOST_DEVICE
0114 Precision GetTanThetaCosPhi() const { return GetUnplacedVolume()->GetTanThetaCosPhi(); }
0115
0116 #ifndef VECCORE_CUDA
0117 virtual VPlacedVolume const *ConvertToUnspecialized() const override;
0118 #ifdef VECGEOM_ROOT
0119 virtual TGeoShape const *ConvertToRoot() const override;
0120 #endif
0121 #ifdef VECGEOM_GEANT4
0122 virtual G4VSolid const *ConvertToGeant4() const override;
0123 #endif
0124 #endif
0125 };
0126 }
0127 }
0128
0129 #endif