Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*
0002  * TorusStruct2.h
0003  *
0004  *  Created on: 26.06.2017
0005  *      Author: Aldo Miranda-Aguilar (aldo.nicolas.miranda.aguilar@cern.ch)
0006  */
0007 
0008 #ifndef VECGEOM_VOLUMES_TORUSSTRUCT2_H_
0009 #define VECGEOM_VOLUMES_TORUSSTRUCT2_H_
0010 #include "VecGeom/base/Global.h"
0011 #include "VecGeom/volumes/Wedge_Evolution.h"
0012 #include "VecGeom/volumes/UnplacedTube.h"
0013 
0014 namespace vecgeom {
0015 
0016 inline namespace VECGEOM_IMPL_NAMESPACE {
0017 
0018 using GenericUnplacedTube = SUnplacedTube<TubeTypes::UniversalTube>;
0019 /*
0020  * A Torus struct without member functions
0021  *
0022  */
0023 template <typename T = double>
0024 struct TorusStruct2 {
0025   // tube defining parameters
0026   T fRmin;  //< inner radius
0027   T fRmax;  //< outer radius
0028   T fRtor;  //< torus radius
0029   T fSphi;  //< starting phi value (in radians)
0030   T fDphi;  //< delta phi value of tube segment (in radians)
0031   T fRmin2; //< inner radius
0032   T fRmax2; //< outer radius
0033   T fRtor2; //< torus radius
0034   evolution::Wedge fPhiWedge;
0035   GenericUnplacedTube fBoundingTube;
0036 
0037   VECCORE_ATT_HOST_DEVICE
0038   TorusStruct2(const T rmin, const T rmax, const T rtor, const T sphi, const T dphi)
0039       : fRmin(rmin), fRmax(rmax), fRtor(rtor), fSphi(sphi), fDphi(dphi), fRmin2(rmin * rmin), fRmax2(rmax * rmax),
0040         fRtor2(rtor * rtor), fPhiWedge(dphi, sphi), fBoundingTube(0, 1, 1, 0, dphi)
0041   {
0042     fBoundingTube = GenericUnplacedTube(fRtor - fRmax - kTolerance, fRtor + fRmax + kTolerance, fRmax, sphi, dphi);
0043   }
0044 
0045   VECCORE_ATT_HOST_DEVICE
0046   T rmin() const { return fRmin; }
0047 
0048   VECCORE_ATT_HOST_DEVICE
0049   T rmax() const { return fRmax; }
0050 
0051   VECCORE_ATT_HOST_DEVICE
0052   T rtor() const { return fRtor; }
0053 
0054   VECCORE_ATT_HOST_DEVICE
0055   T sphi() const { return fSphi; }
0056 
0057   VECCORE_ATT_HOST_DEVICE
0058   T dphi() const { return fDphi; }
0059 
0060   VECCORE_ATT_HOST_DEVICE
0061   T rmin2() const { return fRmin2; }
0062 
0063   VECCORE_ATT_HOST_DEVICE
0064   T rmax2() const { return fRmax2; }
0065 
0066   VECCORE_ATT_HOST_DEVICE
0067   T rtor2() const { return fRtor2; }
0068 
0069   VECCORE_ATT_HOST_DEVICE
0070   evolution::Wedge GetWedge() const { return fPhiWedge; }
0071 
0072   VECCORE_ATT_HOST_DEVICE
0073   GenericUnplacedTube const &GetBoundingTube() const { return fBoundingTube; }
0074 };
0075 } // namespace VECGEOM_IMPL_NAMESPACE
0076 } // namespace vecgeom
0077 
0078 #endif