Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:33:33

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 /// Declaration of the placed tetrahedron volume
0006 /// @file volumes/PlacedTet.h
0007 /// @author Raman Sehgal, Evgueni Tcherniaev
0008 
0009 #ifndef VECGEOM_VOLUMES_PLACEDTET_H_
0010 #define VECGEOM_VOLUMES_PLACEDTET_H_
0011 
0012 #include "VecGeom/base/Global.h"
0013 
0014 #include "VecGeom/volumes/PlacedVolume.h"
0015 #include "VecGeom/volumes/UnplacedVolume.h"
0016 #include "VecGeom/volumes/kernel/TetImplementation.h"
0017 #include "VecGeom/volumes/PlacedVolImplHelper.h"
0018 #include "VecGeom/volumes/UnplacedTet.h"
0019 
0020 namespace vecgeom {
0021 
0022 VECGEOM_DEVICE_FORWARD_DECLARE(class PlacedTet;);
0023 VECGEOM_DEVICE_DECLARE_CONV(class, PlacedTet);
0024 
0025 inline namespace VECGEOM_IMPL_NAMESPACE {
0026 
0027 /// Class for the positioned tetrahedron volume
0028 class PlacedTet : public PlacedVolumeImplHelper<UnplacedTet, VPlacedVolume> {
0029   using Base = PlacedVolumeImplHelper<UnplacedTet, VPlacedVolume>;
0030 
0031 public:
0032 #ifndef VECCORE_CUDA
0033   // constructor inheritance;
0034   using Base::Base;
0035 
0036   /// Constructor
0037   /// @param label Name of logical volume
0038   /// @param logicalVolume The logical volume to be positioned
0039   /// @param transformation The positioning transformation
0040   PlacedTet(char const *const label, LogicalVolume const *const logicalVolume,
0041             Transformation3D const *const transformation)
0042       : Base(label, logicalVolume, transformation)
0043   {
0044   }
0045 
0046   /// Constructor
0047   /// @param logicalVolume The logical volume to be positioned
0048   /// @param transformation The positioning transformation.
0049   PlacedTet(LogicalVolume const *const logicalVolume, Transformation3D const *const transformation)
0050       : PlacedTet("", logicalVolume, transformation)
0051   {
0052   }
0053 #else
0054   /// CUDA version of constructor
0055   VECCORE_ATT_DEVICE PlacedTet(LogicalVolume const *const logicalVolume, Transformation3D const *const transformation,
0056                                const int id, const int copy_no, const int child_id)
0057       : Base(logicalVolume, transformation, id, copy_no, child_id)
0058   {
0059   }
0060 #endif
0061   /// Destructor
0062   VECCORE_ATT_HOST_DEVICE
0063   virtual ~PlacedTet() {}
0064 
0065   /// Getter for the tetrahedron vertices
0066   /// @param [out] p0 Point given as 3D vector
0067   /// @param [out] p1 Point given as 3D vector
0068   /// @param [out] p2 Point given as 3D vector
0069   /// @param [out] p3 Point given as 3D vector
0070   VECCORE_ATT_HOST_DEVICE
0071   VECGEOM_FORCE_INLINE
0072   void GetVertices(Vector3D<Precision> &p0, Vector3D<Precision> &p1, Vector3D<Precision> &p2,
0073                    Vector3D<Precision> &p3) const
0074   {
0075     GetUnplacedVolume()->GetVertices(p0, p1, p2, p3);
0076   }
0077 
0078   VECCORE_ATT_HOST_DEVICE
0079   virtual void PrintType() const override;
0080   virtual void PrintType(std::ostream &os) const override;
0081 
0082 // Comparison specific
0083 #ifndef VECCORE_CUDA
0084   virtual VPlacedVolume const *ConvertToUnspecialized() const override;
0085 #ifdef VECGEOM_ROOT
0086   virtual TGeoShape const *ConvertToRoot() const override
0087   {
0088     return nullptr; // There is no suitable TGeo shape 2018.07.18
0089   }
0090 #endif
0091 #ifdef VECGEOM_GEANT4
0092   virtual G4VSolid const *ConvertToGeant4() const override;
0093 #endif
0094 #endif // VECCORE_CUDA
0095 };
0096 
0097 } // namespace VECGEOM_IMPL_NAMESPACE
0098 } // namespace vecgeom
0099 
0100 #endif