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 ix, float iy, float dphi)
 
 PhiInterval (float phi1, float phi2)
 

Private Attributes

float dcos
 
float x
 
float y
 

Detailed Description

Definition at line 6 of file PhiInterval.h.

Constructor & Destructor Documentation

◆ PhiInterval() [1/2]

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

Definition at line 8 of file PhiInterval.h.

8  {
9  phi2 = proxim(phi2, phi1);
10  constexpr float c1 = 2. * M_PI;
11  if (phi2 < phi1)
12  phi2 += c1;
13  auto dphi = 0.5f * (phi2 - phi1);
14  auto phi = phi1 + dphi;
15  x = std::cos(phi);
16  y = std::sin(phi);
17  dcos = std::cos(dphi);
18  }

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

◆ PhiInterval() [2/2]

PhiInterval::PhiInterval ( float  ix,
float  iy,
float  dphi 
)
inline

Definition at line 20 of file PhiInterval.h.

20  {
21  auto norm = 1.f / std::sqrt(ix * ix + iy * iy);
22  x = ix * norm;
23  y = iy * norm;
24  dcos = std::cos(dphi);
25  }

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

Member Function Documentation

◆ inside() [1/2]

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

Definition at line 28 of file PhiInterval.h.

28  {
29  return inside(v.x(), v.y());
30  }

References findQualityFiles::v.

◆ inside() [2/2]

bool PhiInterval::inside ( float  ix,
float  iy 
) const
inline

Definition at line 32 of file PhiInterval.h.

32 { return ix * x + iy * y > dcos * std::sqrt(ix * ix + iy * iy); }

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

Member Data Documentation

◆ dcos

float PhiInterval::dcos
private

Definition at line 36 of file PhiInterval.h.

Referenced by inside(), and PhiInterval().

◆ x

float PhiInterval::x
private

◆ y

float PhiInterval::y
private
PhiInterval::inside
bool inside(Basic3DVector< T > const &v) const
Definition: PhiInterval.h:28
proxim
constexpr T proxim(T b, T a)
Definition: normalizedPhi.h:14
findQualityFiles.v
v
Definition: findQualityFiles.py:179
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
PhiInterval::x
float x
Definition: PhiInterval.h:35
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
PhiInterval::y
float y
Definition: PhiInterval.h:35
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
DDAxes::phi
PhiInterval::dcos
float dcos
Definition: PhiInterval.h:36