Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef VECGEOM_VOLUMES_PLACEDIMPLAS_H_
0002 #define VECGEOM_VOLUMES_PLACEDIMPLAS_H_
0003 
0004 #include "VecGeom/base/Global.h"
0005 #include "VecGeom/volumes/PlacedVolume.h"
0006 #include "VecGeom/volumes/UnplacedVolume.h"
0007 #include "VecGeom/volumes/PlacedVolImplHelper.h"
0008 
0009 namespace vecgeom {
0010 
0011 inline namespace VECGEOM_IMPL_NAMESPACE {
0012 
0013 // the placed analog of UnplacedImplAs
0014 template <typename Unplaced>
0015 class PlacedImplAs : public PlacedVolumeImplHelper<Unplaced, VPlacedVolume> {
0016   using Base = PlacedVolumeImplHelper<Unplaced, VPlacedVolume>;
0017 
0018 public:
0019 #ifndef VECCORE_CUDA
0020   // constructor inheritance;
0021   using Base::Base;
0022   PlacedImplAs(char const *const label, LogicalVolume const *const logicalVolume,
0023                Transformation3D const *const transformation)
0024       : Base(label, logicalVolume, transformation)
0025   {
0026   }
0027 
0028   PlacedImplAs(LogicalVolume const *const logicalVolume, Transformation3D const *const transformation)
0029       : PlacedImplAs("", logicalVolume, transformation)
0030   {
0031   }
0032 #else
0033   VECCORE_ATT_DEVICE PlacedImplAs(LogicalVolume const *const logicalVolume,
0034                                   Transformation3D const *const transformation, const int id)
0035       : Base(logicalVolume, transformation, id)
0036   {
0037   }
0038 #endif
0039   VECCORE_ATT_HOST_DEVICE
0040   virtual ~PlacedImplAs() {}
0041 
0042   VECCORE_ATT_HOST_DEVICE
0043   virtual void PrintType() const override{};
0044   virtual void PrintType(std::ostream &os) const override{};
0045 
0046 // Comparison specific
0047 #ifndef VECCORE_CUDA
0048   virtual VPlacedVolume const *ConvertToUnspecialized() const override
0049   {
0050     // at this moment it is hard to reason about unspecializing
0051     // so just refusing and returning itself
0052     return this;
0053   }
0054 #ifdef VECGEOM_ROOT
0055   virtual TGeoShape const *ConvertToRoot() const override
0056   {
0057     return this->GetUnplacedVolume()->ConvertToRoot(this->GetName());
0058   }
0059 #endif
0060 #ifdef VECGEOM_GEANT4
0061   virtual G4VSolid const *ConvertToGeant4() const override
0062   {
0063     return this->GetUnplacedVolume()->ConvertToGeant4(this->GetName());
0064   }
0065 #endif
0066 #endif // VECCORE_CUDA
0067 };
0068 
0069 } // namespace VECGEOM_IMPL_NAMESPACE
0070 } // namespace vecgeom
0071 
0072 #endif