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