CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 12 of file OptimalHelixPlaneCrossing.h.

Member Typedef Documentation

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

Definition at line 56 of file OptimalHelixPlaneCrossing.h.

Definition at line 14 of file OptimalHelixPlaneCrossing.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file OptimalHelixPlaneCrossing.h.

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

18  {
19 
20  GlobalVector u = plane.normalVector();
21  constexpr float small = 1.e-6; // for orientation of planes
22 
23 
24  if (std::abs(u.z()) < small) {
25  // barrel plane:
26  // instantiate HelixBarrelPlaneCrossing,
27  new(get()) HelixBarrelPlaneCrossingByCircle(args...);
28  }
29  else if ( (std::abs(u.x()) < small) & (std::abs(u.y()) < small) ) {
30  // forward plane:
31  // instantiate HelixForwardPlaneCrossing
32  new(get()) HelixForwardPlaneCrossing(args...);
33  } else {
34  // arbitrary plane:
35  // instantiate HelixArbitraryPlaneCrossing
36  new(get()) HelixArbitraryPlaneCrossing(args...);
37  }
38 
39  }
T y() const
Definition: PV3DBase.h:63
#define constexpr
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T x() const
Definition: PV3DBase.h:62
OptimalHelixPlaneCrossing::~OptimalHelixPlaneCrossing ( )
inline

Definition at line 42 of file OptimalHelixPlaneCrossing.h.

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

Member Function Documentation

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

Definition at line 44 of file OptimalHelixPlaneCrossing.h.

44 { return *get(); }
Base const& OptimalHelixPlaneCrossing::operator* ( void  ) const
inline

Definition at line 45 of file OptimalHelixPlaneCrossing.h.

45 { return *get();}

Member Data Documentation

aligned_union_t OptimalHelixPlaneCrossing::mem
private

Definition at line 57 of file OptimalHelixPlaneCrossing.h.

Referenced by get().