1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
|
/// \file PlacedSphere.h
/// \author Raman Sehgal (raman.sehgal@cern.ch)
#ifndef VECGEOM_VOLUMES_PLACEDSPHERE_H_
#define VECGEOM_VOLUMES_PLACEDSPHERE_H_
#include "VecGeom/base/Global.h"
#ifndef VECCORE_CUDA
#include "VecGeom/base/RNG.h"
#include <cmath>
#endif
#include "VecGeom/volumes/PlacedVolume.h"
#include "VecGeom/volumes/UnplacedVolume.h"
#include "VecGeom/volumes/kernel/SphereImplementation.h"
#include "VecGeom/volumes/PlacedVolImplHelper.h"
#include "VecGeom/volumes/UnplacedSphere.h"
namespace vecgeom {
VECGEOM_DEVICE_FORWARD_DECLARE(class PlacedSphere;);
VECGEOM_DEVICE_DECLARE_CONV(class, PlacedSphere);
inline namespace VECGEOM_IMPL_NAMESPACE {
class PlacedSphere : public PlacedVolumeImplHelper<UnplacedSphere, VPlacedVolume> {
using Base = PlacedVolumeImplHelper<UnplacedSphere, VPlacedVolume>;
public:
using Base::Base;
#ifndef VECCORE_CUDA
PlacedSphere(char const *const label, LogicalVolume const *const logical_volume,
Transformation3D const *const transformation)
: Base(label, logical_volume, transformation)
{
}
PlacedSphere(LogicalVolume const *const logical_volume, Transformation3D const *const transformation)
: PlacedSphere("", logical_volume, transformation)
{
}
#else
VECCORE_ATT_DEVICE PlacedSphere(LogicalVolume const *const logical_volume,
Transformation3D const *const transformation, const int id, const int copy_no,
const int child_id)
: Base(logical_volume, transformation, id, copy_no, child_id)
{
}
#endif
VECCORE_ATT_HOST_DEVICE
virtual ~PlacedSphere() {}
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
UnplacedSphere const *GetUnplacedVolume() const
{
return static_cast<UnplacedSphere const *>(GetLogicalVolume()->GetUnplacedVolume());
}
VECCORE_ATT_HOST_DEVICE
virtual void PrintType() const override;
virtual void PrintType(std::ostream &s) const override;
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
evolution::Wedge const &GetWedge() const { return GetUnplacedVolume()->GetWedge(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
ThetaCone const &GetThetaCone() const { return GetUnplacedVolume()->GetThetaCone(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetInsideRadius() const { return GetUnplacedVolume()->GetInsideRadius(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetInnerRadius() const { return GetUnplacedVolume()->GetInnerRadius(); }
void SetInnerRadius(Precision arg) { const_cast<UnplacedSphere *>(GetUnplacedVolume())->SetInnerRadius(arg); }
void SetOuterRadius(Precision arg) { const_cast<UnplacedSphere *>(GetUnplacedVolume())->SetOuterRadius(arg); }
void SetStartPhiAngle(Precision arg, bool compute = true)
{
const_cast<UnplacedSphere *>(GetUnplacedVolume())->SetStartPhiAngle(arg, compute);
}
void SetDeltaPhiAngle(Precision arg) { const_cast<UnplacedSphere *>(GetUnplacedVolume())->SetDeltaPhiAngle(arg); }
void SetStartThetaAngle(Precision arg) { const_cast<UnplacedSphere *>(GetUnplacedVolume())->SetStartThetaAngle(arg); }
void SetDeltaThetaAngle(Precision arg) { const_cast<UnplacedSphere *>(GetUnplacedVolume())->SetDeltaThetaAngle(arg); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetOuterRadius() const { return GetUnplacedVolume()->GetOuterRadius(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetStartPhiAngle() const { return GetUnplacedVolume()->GetStartPhiAngle(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetDeltaPhiAngle() const { return GetUnplacedVolume()->GetDeltaPhiAngle(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetStartThetaAngle() const { return GetUnplacedVolume()->GetStartThetaAngle(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetDeltaThetaAngle() const { return GetUnplacedVolume()->GetDeltaThetaAngle(); }
// Functions to get Tolerance
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetFRminTolerance() const { return GetUnplacedVolume()->GetFRminTolerance(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetMKTolerance() const { return GetUnplacedVolume()->GetMKTolerance(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetAngTolerance() const { return GetUnplacedVolume()->GetAngTolerance(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
bool IsFullSphere() const { return GetUnplacedVolume()->IsFullSphere(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
bool IsFullPhiSphere() const { return GetUnplacedVolume()->IsFullPhiSphere(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
bool IsFullThetaSphere() const { return GetUnplacedVolume()->IsFullThetaSphere(); }
// Function to return all Trignometric values
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetHDPhi() const { return GetUnplacedVolume()->GetHDPhi(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetCPhi() const { return GetUnplacedVolume()->GetCPhi(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetEPhi() const { return GetUnplacedVolume()->GetEPhi(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetSinCPhi() const { return GetUnplacedVolume()->GetSinCPhi(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetCosCPhi() const { return GetUnplacedVolume()->GetCosCPhi(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetSinSPhi() const { return GetUnplacedVolume()->GetSinSPhi(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetCosSPhi() const { return GetUnplacedVolume()->GetCosSPhi(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetSinEPhi() const { return GetUnplacedVolume()->GetSinEPhi(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetCosEPhi() const { return GetUnplacedVolume()->GetCosEPhi(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetETheta() const { return GetUnplacedVolume()->GetETheta(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetSinSTheta() const { return GetUnplacedVolume()->GetSinSTheta(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetCosSTheta() const { return GetUnplacedVolume()->GetCosSTheta(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetSinETheta() const { return GetUnplacedVolume()->GetSinETheta(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetCosETheta() const { return GetUnplacedVolume()->GetCosETheta(); }
//****************************************************************
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetTanSTheta() const { return GetUnplacedVolume()->GetTanSTheta(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetTanETheta() const { return GetUnplacedVolume()->GetTanETheta(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetFabsTanSTheta() const { return GetUnplacedVolume()->GetFabsTanSTheta(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetFabsTanETheta() const { return GetUnplacedVolume()->GetFabsTanETheta(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetTanSTheta2() const { return GetUnplacedVolume()->GetTanSTheta2(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetTanETheta2() const { return GetUnplacedVolume()->GetTanETheta2(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetCosHDPhiOT() const { return GetUnplacedVolume()->GetCosHDPhiOT(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetCosHDPhiIT() const { return GetUnplacedVolume()->GetCosHDPhiIT(); }
//****************************************************************
// Old access functions
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetRmin() const { return GetUnplacedVolume()->GetRmin(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetRmax() const { return GetUnplacedVolume()->GetRmax(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetSPhi() const { return GetUnplacedVolume()->GetSPhi(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetDPhi() const { return GetUnplacedVolume()->GetDPhi(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetSTheta() const { return GetUnplacedVolume()->GetSTheta(); }
VECCORE_ATT_HOST_DEVICE
VECGEOM_FORCE_INLINE
Precision GetDTheta() const { return GetUnplacedVolume()->GetDTheta(); }
#ifndef VECCORE_CUDA
virtual VPlacedVolume const *ConvertToUnspecialized() const override;
#ifdef VECGEOM_ROOT
virtual TGeoShape const *ConvertToRoot() const override { return GetUnplacedVolume()->ConvertToRoot(GetName()); }
#endif
#ifdef VECGEOM_GEANT4
virtual G4VSolid const *ConvertToGeant4() const override { return GetUnplacedVolume()->ConvertToGeant4(GetName()); }
#endif
#endif // VECCORE_CUDA
};
} // namespace VECGEOM_IMPL_NAMESPACE
} // namespace vecgeom
#endif // VECGEOM_VOLUMES_PLACEDSPHERE_H_
|