CMS 3D CMS Logo

OptimalHelixPlaneCrossing.h
Go to the documentation of this file.
1 #ifndef OptimalHelixPlaneCrossing_H
2 #define OptimalHelixPlaneCrossing_H
3 
4 
8 
9 #include<memory>
10 
11 
13 public:
15 
16 
17  template<typename ... Args>
18  OptimalHelixPlaneCrossing(Plane const & plane, Args&&... args) {
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,
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  }
40 
41 
43 
44  Base & operator*() { return *get(); }
45  Base const & operator*() const { return *get();}
46 
47 
48 
49  private:
50 
51 
52  Base * get() { return (Base*)&mem;}
53  Base const * get() const { return (Base const *)&mem;}
54 
58 
59 };
60 
61 
62 
63 #endif
type
Definition: HCALResponse.h:21
GlobalVector normalVector() const
Definition: Plane.h:41
T y() const
Definition: PV3DBase.h:63
typename std::aligned_storage< sizeof(Tmp), alignof(Tmp)>::type aligned_union_t
Definition: Plane.h:17
#define constexpr
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
OptimalHelixPlaneCrossing(Plane const &plane, Args &&...args)
HelixBarrelPlaneCrossingByCircle a
T x() const
Definition: PV3DBase.h:62