CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PhiInterval Class Reference

#include <PhiInterval.h>

Public Member Functions

template<typename T >
bool inside (Basic3DVector< T > const &v) const
 
bool inside (float ix, float iy) const
 
 PhiInterval (float phi1, float phi2)
 
 PhiInterval (float ix, float iy, float dphi)
 

Private Attributes

float dcos
 
float x
 
float y
 

Detailed Description

Definition at line 6 of file PhiInterval.h.

Constructor & Destructor Documentation

PhiInterval::PhiInterval ( float  phi1,
float  phi2 
)
inline

Definition at line 8 of file PhiInterval.h.

References alignmentValidation::c1, constexpr, funct::cos(), dcos, M_PI, phi, proxim(), funct::sin(), x, and y.

8  {
9  phi2 = proxim(phi2,phi1);
10  constexpr float c1 = 2.*M_PI;
11  if (phi2<phi1) phi2+=c1;
12  auto dphi = 0.5f*(phi2-phi1);
13  auto phi = phi1+dphi;
14  x = std::cos(phi);
15  y = std::sin(phi);
16  dcos = std::cos(dphi);
17  }
float dcos
Definition: PhiInterval.h:37
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
#define constexpr
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define M_PI
T proxim(T b, T a)
Definition: normalizedPhi.h:14
PhiInterval::PhiInterval ( float  ix,
float  iy,
float  dphi 
)
inline

Definition at line 19 of file PhiInterval.h.

References funct::cos(), dcos, mathSSE::sqrt(), x, and y.

19  {
20  auto norm = 1.f/std::sqrt(ix*ix+iy*iy);
21  x = ix*norm;
22  y = iy*norm;
23  dcos = std::cos(dphi);
24  }
float dcos
Definition: PhiInterval.h:37
T sqrt(T t)
Definition: SSEVec.h:18
Cos< T >::type cos(const T &t)
Definition: Cos.h:22

Member Function Documentation

template<typename T >
bool PhiInterval::inside ( Basic3DVector< T > const &  v) const
inline

Definition at line 27 of file PhiInterval.h.

References Basic3DVector< T >::x(), and Basic3DVector< T >::y().

27  {
28  return inside(v.x(),v.y());
29  }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
bool inside(Basic3DVector< T > const &v) const
Definition: PhiInterval.h:27
bool PhiInterval::inside ( float  ix,
float  iy 
) const
inline

Definition at line 31 of file PhiInterval.h.

References dcos, mathSSE::sqrt(), x, and y.

31  {
32  return ix*x+iy*y > dcos*std::sqrt(ix*ix+iy*iy);
33  }
float dcos
Definition: PhiInterval.h:37
T sqrt(T t)
Definition: SSEVec.h:18

Member Data Documentation

float PhiInterval::dcos
private

Definition at line 37 of file PhiInterval.h.

Referenced by inside(), and PhiInterval().

float PhiInterval::x
private
float PhiInterval::y
private