Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:13:58

0001 #pragma once
0002 
0003 #include "VecGeom/base/Global.h"
0004 #include "VecGeom/base/Vector3D.h"
0005 #include "VecGeom/navigation/NavStateFwd.h"
0006 
0007 namespace vecgeom {
0008 inline namespace VECGEOM_IMPL_NAMESPACE {
0009 
0010 class LogicalVolume;
0011 class VPlacedVolume;
0012 // class NavigationState;
0013 
0014 //! Pure virtual base class for LevelLocators
0015 
0016 //! Pure abstract base class for LevelLocators
0017 //! which are classes providing functions
0018 //! to locate a track in a logical volume; Via the virtual
0019 //! interface it is possible to write custom locators which are specialized for
0020 //! a given logical volume and its content
0021 class VLevelLocator {
0022 
0023 public:
0024   /**
0025    * Function which takes a logical volume and a local point in the reference frame of the logical volume
0026    * and which determines in which daughter (or the logical volume itself) the given point is located
0027    *
0028    *
0029    * @param  lvol is a logical volume
0030    * @param  localpoint is a point in the coordinate frame of the logical volume and should be contained within it
0031    * @param  daughterpvol is the placed volume in which the localpoint is contained (result of the computation)
0032    * @param  daughterlocalpoint is the local point in the next pvol (result of the computation)
0033    * @return true if point is in a daughter; false otherwise
0034    */
0035   VECCORE_ATT_HOST_DEVICE
0036   virtual bool LevelLocate(LogicalVolume const * /*lvol*/, Vector3D<Precision> const & /*localpoint*/,
0037                            VPlacedVolume const *& /*pvol*/, Vector3D<Precision> & /*daughterlocalpoint*/) const = 0;
0038 
0039   /**
0040    * Function which takes a logical volume and a local point in the reference frame of the logical volume
0041    * and which determines in which daughter (or the logical volume itself) the given point is located
0042    *
0043    *
0044    * @param  lvol is a logical volume
0045    * @param  localpoint is a point in the coordinate frame of the logical volume and should be contained within it
0046    * @param  outstate is a navigationstate which gets modified to point to the correct volume within this level (result
0047    * of the computation)
0048    * @param  daughterlocalpoint is the local point in the next pvol (result of the computation)
0049    * @return true if point is in a daughter; false otherwise
0050    */
0051   VECCORE_ATT_HOST_DEVICE
0052   virtual bool LevelLocate(LogicalVolume const * /*lvol*/, Vector3D<Precision> const & /*localpoint*/,
0053                            NavigationState & /*outstate*/, Vector3D<Precision> & /*daughterlocalpoint*/) const = 0;
0054 
0055   /**
0056    * Function which takes a logical volume and a local point in the reference frame of the logical volume
0057    * and which determines in which daughter ( or the logical volume ) itself the given point is located
0058    *
0059    *
0060    * @param  lvol is a logical volume
0061    * @param  pvol a physical volume to be excluded
0062    * @param  localpoint is a point in the coordinate frame of the logical volume and should be contained within it
0063    * @param  daughterpvol is the placed volume in which the localpoint is contained (result of the computation)
0064    * @param  daughterlocalpoint is the local point in the next pvol (result of the computation)
0065    * @return true of point is in a daughter; false otherwise
0066    */
0067   VECCORE_ATT_HOST_DEVICE
0068   virtual bool LevelLocateExclVol(LogicalVolume const * /*lvol*/, VPlacedVolume const * /*pvol excl*/,
0069                                   Vector3D<Precision> const & /*localpoint*/, VPlacedVolume const *& /*pvol*/,
0070                                   Vector3D<Precision> & /*daughterlocalpoint*/) const = 0;
0071 
0072   /**
0073    * Function which takes a logical volume and a ray (local point + local direction) in the reference frame of the
0074    * logical volume and which determines in which daughter ( or the logical volume ) itself the given point is located.
0075    * This version resembles the logic done in Geant4.
0076    *
0077    * @param  lvol is a logical volume
0078    * @param  pvol a physical volume to be excluded
0079    * @param  localpoint is a point in the coordinate frame of the logical volume and should be contained within it
0080    * @param  localdir is a direction in the coordinate frame of the logical volume
0081    * @param  daughterpvol is the placed volume in which the localpoint is contained (result of the computation)
0082    * @param  daughterlocalpoint is the local point in the next pvol (result of the computation)
0083    * @return true if point is in a daughter; false otherwise
0084    */
0085   VECCORE_ATT_HOST_DEVICE
0086   virtual bool LevelLocateExclVol(LogicalVolume const * /*lvol*/, VPlacedVolume const * /*pvol excl*/,
0087                                   Vector3D<Precision> const & /*localpoint*/, Vector3D<Precision> const & /*localdir*/,
0088                                   VPlacedVolume const *& /*pvol*/,
0089                                   Vector3D<Precision> & /*daughterlocalpoint*/) const = 0;
0090 
0091   virtual std::string GetName() const = 0;
0092 
0093   virtual ~VLevelLocator() {}
0094 
0095 }; // end class declaration
0096 } // namespace VECGEOM_IMPL_NAMESPACE
0097 } // namespace vecgeom