Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*
0002  * @file   volumes/PlacedTrapezoid.h
0003  * @author Guilherme Lima (lima 'at' fnal 'dot' gov)
0004  *
0005  * 2014-05-01 - Created, based on the Parallelepiped draft
0006  * 2016-07-25 G.Lima     - Migrated to new helpers + VecCore
0007  */
0008 
0009 #ifndef VECGEOM_VOLUMES_PLACEDTRAPEZOID_H_
0010 #define VECGEOM_VOLUMES_PLACEDTRAPEZOID_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/TrapezoidImplementation.h"
0016 #include "VecGeom/volumes/PlacedVolImplHelper.h"
0017 #include "VecGeom/volumes/UnplacedTrapezoid.h"
0018 
0019 namespace vecgeom {
0020 
0021 VECGEOM_DEVICE_FORWARD_DECLARE(class TGeoTrap;);
0022 VECGEOM_DEVICE_FORWARD_DECLARE(class PlacedTrapezoid;);
0023 VECGEOM_DEVICE_DECLARE_CONV(class, PlacedTrapezoid);
0024 
0025 inline namespace VECGEOM_IMPL_NAMESPACE {
0026 
0027 class PlacedTrapezoid : public PlacedVolumeImplHelper<UnplacedTrapezoid, VPlacedVolume> {
0028 
0029   using Base = PlacedVolumeImplHelper<UnplacedTrapezoid, VPlacedVolume>;
0030 
0031 public:
0032 #ifndef VECCORE_CUDA
0033   // constructor inheritance;
0034   using Base::Base;
0035 
0036   PlacedTrapezoid(char const *const label, LogicalVolume const *const logicalVolume,
0037                   Transformation3D const *const transformation)
0038       : Base(label, logicalVolume, transformation)
0039   {
0040   }
0041 
0042   PlacedTrapezoid(LogicalVolume const *const logicalVolume, Transformation3D const *const transformation)
0043       : PlacedTrapezoid("", logicalVolume, transformation)
0044   {
0045   }
0046 
0047 #else
0048   VECCORE_ATT_DEVICE PlacedTrapezoid(LogicalVolume const *const logicalVolume,
0049                                      Transformation3D const *const transformation, const int id, const int copy_no,
0050                                      const int child_id)
0051       : Base(logicalVolume, transformation, id, copy_no, child_id)
0052   {
0053   }
0054 #endif
0055 
0056   VECCORE_ATT_HOST_DEVICE
0057   virtual ~PlacedTrapezoid() {}
0058 
0059   VECCORE_ATT_HOST_DEVICE
0060   virtual void PrintType() const override;
0061   virtual void PrintType(std::ostream &os) const override;
0062 
0063 // Comparison specific
0064 #ifndef VECCORE_CUDA
0065   virtual VPlacedVolume const *ConvertToUnspecialized() const override;
0066 
0067 #ifdef VECGEOM_ROOT
0068   virtual TGeoShape const *ConvertToRoot() const override { return GetUnplacedVolume()->ConvertToRoot(GetName()); }
0069 #endif
0070 #ifdef VECGEOM_GEANT4
0071   virtual G4VSolid const *ConvertToGeant4() const override { return GetUnplacedVolume()->ConvertToGeant4(GetName()); }
0072 #endif
0073 
0074 #endif // VECCORE_CUDA
0075 };
0076 
0077 } // namespace VECGEOM_IMPL_NAMESPACE
0078 } // namespace vecgeom
0079 
0080 #endif