Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /**
0002  * @file specialized_transformation3d.h
0003  * @author Johannes de Fine Licht (johannes.definelicht@cern.ch)
0004  */
0005 
0006 #ifndef VECGEOM_BASE_SPECIALIZEDTRANSFORMATION3D_H_
0007 #define VECGEOM_BASE_SPECIALIZEDTRANSFORMATION3D_H_
0008 
0009 #include "VecGeom/base/Transformation3D.h"
0010 
0011 namespace vecgeom {
0012 inline namespace VECGEOM_IMPL_NAMESPACE {
0013 
0014 /**
0015  * @brief Specializes on the necessary translation on rotation, eliminating
0016  *        unecessary computations.
0017  */
0018 template <TranslationCode trans_code, RotationCode rot_code>
0019 class SpecializedTransformation3D : public Transformation3D {
0020 
0021 public:
0022   virtual int MemorySize() const { return sizeof(*this); }
0023 
0024   /**
0025    * \sa Transformation3D::Transform(Vector3D<InputType> const &,
0026    *                                 Vector3D<InputType> *const)
0027    */
0028   template <typename InputType>
0029   VECGEOM_FORCE_INLINE
0030   VECCORE_ATT_HOST_DEVICE
0031   void Transform(Vector3D<InputType> const &master, Vector3D<InputType> *const local) const
0032   {
0033     this->Transform<trans_code, rot_code, InputType>(master, local);
0034   }
0035 
0036   /**
0037    * \sa Transformation3D::Transform(Vector3D<InputType> const &)
0038    */
0039   template <TranslationCode, RotationCode code, typename InputType>
0040   VECGEOM_FORCE_INLINE
0041   VECCORE_ATT_HOST_DEVICE
0042   Vector3D<InputType> Transform(Vector3D<InputType> const &master) const
0043   {
0044     return this->Transform<trans_code, rot_code, InputType>(master);
0045   }
0046 
0047   /**
0048    * \sa Transformation3D::TransformDirection(Vector3D<InputType> const &,
0049    *                                             Vector3D<InputType> *const)
0050    */
0051   template <RotationCode code, typename InputType>
0052   VECGEOM_FORCE_INLINE
0053   VECCORE_ATT_HOST_DEVICE
0054   void TransformDirection(Vector3D<InputType> const &master, Vector3D<InputType> *const local) const
0055   {
0056     this->TransformDirection<code, InputType>(master, local);
0057   }
0058 
0059   /**
0060    * \sa Transformation3D::TransformDirection(Vector3D<InputType> const &)
0061    */
0062   template <RotationCode code, typename InputType>
0063   VECGEOM_FORCE_INLINE
0064   VECCORE_ATT_HOST_DEVICE
0065   Vector3D<InputType> TransformDirection(Vector3D<InputType> const &master) const
0066   {
0067     return this->TransformDirection<code, InputType>(master);
0068   }
0069 };
0070 }
0071 } // End global namespace
0072 
0073 #endif // VECGEOM_BASE_SPECIALIZEDTRANSFORMATION3D_H_