Back to home page

EIC code displayed by LXR

 
 

    


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

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 /// This file contains the declaration of the PlacedParaboloid class
0006 /// @file volumes/PlacedParaboloid.h
0007 /// @author Marilena Bandieramonte
0008 
0009 #ifndef VECGEOM_VOLUMES_PLACEDPARABOLOID_H_
0010 #define VECGEOM_VOLUMES_PLACEDPARABOLOID_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/ParaboloidImplementation.h"
0017 #include "VecGeom/volumes/PlacedVolImplHelper.h"
0018 #include "VecGeom/volumes/UnplacedParaboloid.h"
0019 
0020 namespace vecgeom {
0021 
0022 VECGEOM_DEVICE_FORWARD_DECLARE(class PlacedParaboloid;);
0023 VECGEOM_DEVICE_DECLARE_CONV(class, PlacedParaboloid);
0024 
0025 inline namespace VECGEOM_IMPL_NAMESPACE {
0026 
0027 /// Class for the positioned paraboloid volume
0028 class PlacedParaboloid : public PlacedVolumeImplHelper<UnplacedParaboloid, VPlacedVolume> {
0029   using Base = PlacedVolumeImplHelper<UnplacedParaboloid, 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   PlacedParaboloid(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   PlacedParaboloid(LogicalVolume const *const logicalVolume, Transformation3D const *const transformation)
0050       : PlacedParaboloid("", logicalVolume, transformation)
0051   {
0052   }
0053 #else
0054   /// CUDA version of constructor
0055   VECCORE_ATT_DEVICE PlacedParaboloid(LogicalVolume const *const logicalVolume,
0056                                       Transformation3D const *const transformation, const int id, const int copy_no,
0057                                       const int child_id)
0058       : Base(logicalVolume, transformation, id, copy_no, child_id)
0059   {
0060   }
0061 #endif
0062   /// Destructor
0063   VECCORE_ATT_HOST_DEVICE
0064   virtual ~PlacedParaboloid() {}
0065 
0066   /// Getter for the raduis of the circle at z = -dz
0067   VECCORE_ATT_HOST_DEVICE
0068   VECGEOM_FORCE_INLINE
0069   Precision GetRlo() const { return GetUnplacedVolume()->GetRlo(); }
0070 
0071   /// Getter for the raduis of the circle at z = +dz
0072   VECCORE_ATT_HOST_DEVICE
0073   VECGEOM_FORCE_INLINE
0074   Precision GetRhi() const { return GetUnplacedVolume()->GetRhi(); }
0075 
0076   /// Getter for the half size in z
0077   VECCORE_ATT_HOST_DEVICE
0078   VECGEOM_FORCE_INLINE
0079   Precision GetDz() const { return GetUnplacedVolume()->GetDz(); }
0080 
0081   /// Sets the raduis of the circle at z = -dz
0082   VECCORE_ATT_HOST_DEVICE
0083   void SetRlo(Precision arg) { const_cast<UnplacedParaboloid *>(GetUnplacedVolume())->SetRlo(arg); }
0084 
0085   /// Sets the raduis of the circle at z = +dz
0086   VECCORE_ATT_HOST_DEVICE
0087   void SetRhi(Precision arg) { const_cast<UnplacedParaboloid *>(GetUnplacedVolume())->SetRhi(arg); }
0088 
0089   /// Sets the half size in z
0090   VECCORE_ATT_HOST_DEVICE
0091   void SetDz(Precision arg) { const_cast<UnplacedParaboloid *>(GetUnplacedVolume())->SetDz(arg); }
0092 
0093   VECCORE_ATT_HOST_DEVICE
0094   virtual void PrintType() const override;
0095   virtual void PrintType(std::ostream &os) const override;
0096 
0097 // Comparison specific
0098 #ifndef VECCORE_CUDA
0099   virtual VPlacedVolume const *ConvertToUnspecialized() const override;
0100 #ifdef VECGEOM_ROOT
0101   virtual TGeoShape const *ConvertToRoot() const override;
0102 #endif
0103 #ifdef VECGEOM_GEANT4
0104   virtual G4VSolid const *ConvertToGeant4() const override;
0105 #endif
0106 #endif // VECCORE_CUDA
0107 };
0108 
0109 } // namespace VECGEOM_IMPL_NAMESPACE
0110 } // namespace vecgeom
0111 
0112 #endif