Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:08

0001 /// 2014: initial version (J. De Fine Licht + S. Wenzel)
0002 /// 2015: cleanup; move to PlacedVolImplHelper (Sandro Wenzel)
0003 
0004 #ifndef VECGEOM_VOLUMES_PLACEDBOX_H_
0005 #define VECGEOM_VOLUMES_PLACEDBOX_H_
0006 
0007 #include "VecGeom/base/Global.h"
0008 
0009 #include "VecGeom/volumes/PlacedVolume.h"
0010 #include "VecGeom/volumes/UnplacedVolume.h"
0011 #include "VecGeom/volumes/kernel/BoxImplementation.h"
0012 #include "VecGeom/volumes/PlacedVolImplHelper.h"
0013 #include "VecGeom/volumes/UnplacedBox.h"
0014 
0015 namespace vecgeom {
0016 
0017 VECGEOM_DEVICE_FORWARD_DECLARE(class PlacedBox;);
0018 VECGEOM_DEVICE_DECLARE_CONV(class, PlacedBox);
0019 
0020 inline namespace VECGEOM_IMPL_NAMESPACE {
0021 
0022 class PlacedBox : public PlacedVolumeImplHelper<UnplacedBox, VPlacedVolume> {
0023   using Base = PlacedVolumeImplHelper<UnplacedBox, VPlacedVolume>;
0024 
0025 public:
0026 #ifndef VECCORE_CUDA
0027   // constructor inheritance;
0028   using Base::Base;
0029   PlacedBox(char const *const label, LogicalVolume const *const logicalVolume,
0030             Transformation3D const *const transformation)
0031       : Base(label, logicalVolume, transformation)
0032   {
0033   }
0034 
0035   PlacedBox(LogicalVolume const *const logicalVolume, Transformation3D const *const transformation)
0036       : PlacedBox("", logicalVolume, transformation)
0037   {
0038   }
0039 #else
0040   VECCORE_ATT_DEVICE PlacedBox(LogicalVolume const *const logicalVolume, Transformation3D const *const transformation,
0041                                const int id, const int copy_no, const int child_id)
0042       : Base(logicalVolume, transformation, id, copy_no, child_id)
0043   {
0044   }
0045 #endif
0046   VECCORE_ATT_HOST_DEVICE
0047   virtual ~PlacedBox() {}
0048 
0049   // Accessors -- not sure we need this ever (to be deprecated)
0050   VECCORE_ATT_HOST_DEVICE
0051   VECGEOM_FORCE_INLINE
0052   Vector3D<Precision> const &dimensions() const { return GetUnplacedVolume()->dimensions(); }
0053 
0054   VECCORE_ATT_HOST_DEVICE
0055   VECGEOM_FORCE_INLINE
0056   Precision x() const { return GetUnplacedVolume()->x(); }
0057 
0058   VECCORE_ATT_HOST_DEVICE
0059   VECGEOM_FORCE_INLINE
0060   Precision y() const { return GetUnplacedVolume()->y(); }
0061 
0062   VECCORE_ATT_HOST_DEVICE
0063   VECGEOM_FORCE_INLINE
0064   Precision z() const { return GetUnplacedVolume()->z(); }
0065 
0066   VECCORE_ATT_HOST_DEVICE
0067   virtual void PrintType() const override;
0068   virtual void PrintType(std::ostream &os) const override;
0069 
0070 // Comparison specific
0071 #ifndef VECCORE_CUDA
0072   virtual VPlacedVolume const *ConvertToUnspecialized() const override;
0073 #ifdef VECGEOM_ROOT
0074   virtual TGeoShape const *ConvertToRoot() const override;
0075 #endif
0076 #ifdef VECGEOM_GEANT4
0077   virtual G4VSolid const *ConvertToGeant4() const override;
0078 #endif
0079 #endif // VECCORE_CUDA
0080 };
0081 
0082 } // namespace VECGEOM_IMPL_NAMESPACE
0083 } // namespace vecgeom
0084 
0085 #endif