CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
OptimalHelixPlaneCrossing Class Reference

#include <OptimalHelixPlaneCrossing.h>

Classes

union  Tmp
 

Public Types

using Base = HelixPlaneCrossing
 

Public Member Functions

Baseoperator* ()
 
Base const & operator* () const
 
template<typename... Args>
 OptimalHelixPlaneCrossing (Plane const &plane, Args &&...args)
 
 ~OptimalHelixPlaneCrossing ()
 

Private Types

using aligned_union_t = typename std::aligned_storage< sizeof(Tmp), alignof(Tmp)>::type
 

Private Member Functions

Baseget ()
 
Base const * get () const
 

Private Attributes

aligned_union_t mem
 

Detailed Description

Definition at line 10 of file OptimalHelixPlaneCrossing.h.

Member Typedef Documentation

◆ aligned_union_t

using OptimalHelixPlaneCrossing::aligned_union_t = typename std::aligned_storage<sizeof(Tmp), alignof(Tmp)>::type
private

Definition at line 48 of file OptimalHelixPlaneCrossing.h.

◆ Base

Definition at line 12 of file OptimalHelixPlaneCrossing.h.

Constructor & Destructor Documentation

◆ OptimalHelixPlaneCrossing()

template<typename... Args>
OptimalHelixPlaneCrossing::OptimalHelixPlaneCrossing ( Plane const &  plane,
Args &&...  args 
)
inline

Definition at line 15 of file OptimalHelixPlaneCrossing.h.

References funct::abs(), writedatasetfile::args, ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), Plane::normalVector(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

15  {
16  GlobalVector u = plane.normalVector();
17  constexpr float small = 1.e-6; // for orientation of planes
18 
19  if (std::abs(u.z()) < small) {
20  // barrel plane:
21  // instantiate HelixBarrelPlaneCrossing,
22  new (get()) HelixBarrelPlaneCrossingByCircle(args...);
23  } else if ((std::abs(u.x()) < small) && (std::abs(u.y()) < small)) {
24  // forward plane:
25  // instantiate HelixForwardPlaneCrossing
26  new (get()) HelixForwardPlaneCrossing(args...);
27  } else {
28  // arbitrary plane:
29  // instantiate HelixArbitraryPlaneCrossing
30  new (get()) HelixArbitraryPlaneCrossing(args...);
31  }
32  }
T z() const
Definition: PV3DBase.h:61
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ ~OptimalHelixPlaneCrossing()

OptimalHelixPlaneCrossing::~OptimalHelixPlaneCrossing ( )
inline

Definition at line 34 of file OptimalHelixPlaneCrossing.h.

34 { get()->~Base(); }

Member Function Documentation

◆ get() [1/2]

Base* OptimalHelixPlaneCrossing::get ( )
inlineprivate

◆ get() [2/2]

Base const* OptimalHelixPlaneCrossing::get ( ) const
inlineprivate

◆ operator*() [1/2]

Base& OptimalHelixPlaneCrossing::operator* ( void  )
inline

Definition at line 36 of file OptimalHelixPlaneCrossing.h.

36 { return *get(); }

◆ operator*() [2/2]

Base const& OptimalHelixPlaneCrossing::operator* ( void  ) const
inline

Definition at line 37 of file OptimalHelixPlaneCrossing.h.

37 { return *get(); }

Member Data Documentation

◆ mem

aligned_union_t OptimalHelixPlaneCrossing::mem
private

Definition at line 49 of file OptimalHelixPlaneCrossing.h.

Referenced by get().