Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-03-13 09:29:26

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 placed Orb volume
0006 /// \file volumes/PlacedOrb.h
0007 /// \author Raman Sehgal
0008 
0009 /// 2015: initial version (Raman Sehgal)
0010 /// 2016: cleanup; move to PlacedVolImplHelper (Raman Sehgal)
0011 
0012 #ifndef VECGEOM_VOLUMES_PLACEDORB_H_
0013 #define VECGEOM_VOLUMES_PLACEDORB_H_
0014 
0015 #include "VecGeom/base/Global.h"
0016 
0017 #include "VecGeom/volumes/PlacedVolume.h"
0018 #include "VecGeom/volumes/UnplacedVolume.h"
0019 #include "VecGeom/volumes/kernel/OrbImplementation.h"
0020 #include "VecGeom/volumes/PlacedVolImplHelper.h"
0021 #include "VecGeom/volumes/UnplacedOrb.h"
0022 
0023 namespace vecgeom {
0024 
0025 VECGEOM_DEVICE_FORWARD_DECLARE(class PlacedOrb;);
0026 VECGEOM_DEVICE_DECLARE_CONV(class, PlacedOrb);
0027 
0028 inline namespace VECGEOM_IMPL_NAMESPACE {
0029 
0030 class PlacedOrb : public PlacedVolumeImplHelper<UnplacedOrb, VPlacedVolume> {
0031   using Base = PlacedVolumeImplHelper<UnplacedOrb, VPlacedVolume>;
0032 
0033 public:
0034 #ifndef VECCORE_CUDA
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   using Base::Base;
0040   PlacedOrb(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   PlacedOrb(LogicalVolume const *const logicalVolume, Transformation3D const *const transformation)
0050       : PlacedOrb("", logicalVolume, transformation)
0051   {
0052   }
0053 #else
0054   /// CUDA version of constructor
0055   VECCORE_ATT_DEVICE PlacedOrb(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 
0062   /// Destructor
0063   VECCORE_ATT_HOST_DEVICE
0064   virtual ~PlacedOrb() {}
0065 
0066   /// Getter for Radius
0067   VECCORE_ATT_HOST_DEVICE
0068   VECGEOM_FORCE_INLINE
0069   Precision GetRadius() const { return GetUnplacedVolume()->GetRadius(); }
0070 
0071   /// Setter for Radius
0072   VECCORE_ATT_HOST_DEVICE
0073   void SetRadius(Precision arg) { const_cast<UnplacedOrb *>(GetUnplacedVolume())->SetRadius(arg); }
0074 
0075   VECCORE_ATT_HOST_DEVICE
0076   virtual void PrintType() const override;
0077   virtual void PrintType(std::ostream &os) const override;
0078 
0079 // Comparison specific
0080 #ifndef VECCORE_CUDA
0081   virtual VPlacedVolume const *ConvertToUnspecialized() const override;
0082 #ifdef VECGEOM_ROOT
0083   virtual TGeoShape const *ConvertToRoot() const override { return GetUnplacedVolume()->ConvertToRoot(GetName()); }
0084 #endif
0085 #ifdef VECGEOM_GEANT4
0086   virtual G4VSolid const *ConvertToGeant4() const override { return GetUnplacedVolume()->ConvertToGeant4(GetName()); }
0087 #endif
0088 #endif // VECCORE_CUDA
0089 };
0090 
0091 } // namespace VECGEOM_IMPL_NAMESPACE
0092 } // namespace vecgeom
0093 
0094 #endif