Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:26:19

0001 // This file is part of VecGeom and is distributed under the
0002 // conditions in the file LICENSE.txt in the top directory.
0003 // For the full list of authors see CONTRIBUTORS.txt and `git log`.
0004 
0005 /// \brief Declaration of the data structure for the tessellated shape.
0006 /// \file volumes/PlacedTessellated.h
0007 /// \author Mihaela Gheata (CERN/ISS)
0008 
0009 #ifndef VECGEOM_VOLUMES_PLACEDTESSELLATED_H_
0010 #define VECGEOM_VOLUMES_PLACEDTESSELLATED_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/TessellatedImplementation.h"
0016 #include "VecGeom/volumes/PlacedVolImplHelper.h"
0017 #include "VecGeom/volumes/UnplacedTessellated.h"
0018 
0019 namespace vecgeom {
0020 
0021 VECGEOM_DEVICE_FORWARD_DECLARE(class PlacedTessellated;);
0022 VECGEOM_DEVICE_DECLARE_CONV(class, PlacedTessellated);
0023 
0024 inline namespace VECGEOM_IMPL_NAMESPACE {
0025 
0026 /// Class representing a placed tessellated volume.
0027 class PlacedTessellated : public PlacedVolumeImplHelper<UnplacedTessellated, VPlacedVolume> {
0028   using Base = PlacedVolumeImplHelper<UnplacedTessellated, VPlacedVolume>;
0029 
0030 public:
0031 #ifndef VECCORE_CUDA
0032   // constructor inheritance;
0033   using Base::Base;
0034 
0035   /// Constructor
0036   /// @param label Name of logical volume
0037   /// @param logicalVolume The logical volume to be positioned
0038   /// @param transformation The positioning transformation
0039   PlacedTessellated(char const *const label, LogicalVolume const *const logicalVolume,
0040                     Transformation3D const *const transformation)
0041       : Base(label, logicalVolume, transformation)
0042   {
0043   }
0044 
0045   /// Constructor
0046   /// @param logicalVolume The logical volume to be positioned
0047   /// @param transformation The positioning transformation.
0048   PlacedTessellated(LogicalVolume const *const logicalVolume, Transformation3D const *const transformation)
0049       : PlacedTessellated("", logicalVolume, transformation)
0050   {
0051   }
0052 #else
0053   /// CUDA version of constructor
0054   __device__ PlacedTessellated(LogicalVolume const *const logicalVolume, Transformation3D const *const transformation,
0055                                const int id)
0056       : Base(logicalVolume, transformation, id)
0057   {
0058   }
0059 #endif
0060 
0061   /// Destructor
0062   VECCORE_ATT_HOST_DEVICE
0063   virtual ~PlacedTessellated() {}
0064 
0065   /// Getter for the UnplacedTessellated
0066   VECCORE_ATT_HOST_DEVICE
0067   UnplacedTessellated const *GetUnplacedVolume() const
0068   {
0069     return static_cast<UnplacedTessellated 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 #ifndef VECCORE_CUDA
0077   /** @brief Memory size in bytes */
0078   VECGEOM_FORCE_INLINE
0079   virtual int MemorySize() const override { return sizeof(*this); }
0080 
0081   virtual VPlacedVolume const *ConvertToUnspecialized() const override;
0082 
0083 #ifdef VECGEOM_ROOT
0084   virtual TGeoShape const *ConvertToRoot() const override { return nullptr; }
0085 #endif
0086 #ifdef VECGEOM_GEANT4
0087   G4VSolid const *ConvertToGeant4() const override;
0088 #endif
0089 #endif // VECCORE_CUDA
0090 };
0091 } // namespace VECGEOM_IMPL_NAMESPACE
0092 } // namespace vecgeom
0093 
0094 #endif // VECGEOM_VOLUMES_PLACEDTUBE_H_