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