ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TrkDriftCircleMath::LocVec2D Class Reference

Implementation of 2 dimensional vector class. More...

#include <LocVec2D.h>

Collaboration diagram for TrkDriftCircleMath::LocVec2D:

Public Member Functions

 LocVec2D (double x, double y)
 Constructor parsing the coordinates. More...
 
 LocVec2D (const LocVec2D &)=default
 Default copy & move constructors. More...
 
 LocVec2D (LocVec2D &&)=default
 
 LocVec2D ()=default
 
 ~LocVec2D ()=default
 
double x () const
 Returns the x coordinate of the vector. More...
 
double y () const
 Returns the y coordinate of the vector. More...
 
void set (const LocVec2D &vec)
 Setter function using another vector. More...
 
void set (double x, double y)
 Set x & y simultaenously. More...
 
void setX (double x)
 Set only x. More...
 
void setY (double y)
 Set only y. More...
 
LocVec2D operator+ (const LocVec2D &lv) const
 Plus and minus operators. More...
 
LocVec2D operator- (const LocVec2D &lv) const
 
LocVec2Doperator= (const LocVec2D &)=default
 Default assignment operators (Equivalent to the setter x) More...
 
LocVec2Doperator= (LocVec2D &&)=default
 
LocVec2Doperator+= (const LocVec2D &lv)
 Incrementation operator. More...
 
LocVec2Doperator-= (const LocVec2D &lv)
 
double operator* (const LocVec2D &lv) const
 
LocVec2D operator* (double v) const
 
LocVec2Doperator*= (double v)
 
LocVec2Doperator/= (double v)
 
double cross (const LocVec2D &lv) const
 
double mag () const
 

Private Attributes

double m_x {0}
 
double m_y {0}
 

Detailed Description

Implementation of 2 dimensional vector class.

Definition at line 16 of file LocVec2D.h.

Constructor & Destructor Documentation

◆ LocVec2D() [1/4]

TrkDriftCircleMath::LocVec2D::LocVec2D ( double  x,
double  y 
)
inline

Constructor parsing the coordinates.

Definition at line 19 of file LocVec2D.h.

19 : m_x{x}, m_y{y} {}

◆ LocVec2D() [2/4]

TrkDriftCircleMath::LocVec2D::LocVec2D ( const LocVec2D )
default

Default copy & move constructors.

◆ LocVec2D() [3/4]

TrkDriftCircleMath::LocVec2D::LocVec2D ( LocVec2D &&  )
default

◆ LocVec2D() [4/4]

TrkDriftCircleMath::LocVec2D::LocVec2D ( )
default

◆ ~LocVec2D()

TrkDriftCircleMath::LocVec2D::~LocVec2D ( )
default

Member Function Documentation

◆ cross()

double TrkDriftCircleMath::LocVec2D::cross ( const LocVec2D lv) const
inline

Definition at line 87 of file LocVec2D.h.

87 { return y() * lv.x() - x() * lv.y(); }

◆ mag()

double TrkDriftCircleMath::LocVec2D::mag ( ) const
inline

Definition at line 89 of file LocVec2D.h.

89 { return std::hypot(m_x, m_y); }

◆ operator*() [1/2]

double TrkDriftCircleMath::LocVec2D::operator* ( const LocVec2D lv) const
inline

Definition at line 68 of file LocVec2D.h.

68 { return x() * lv.x() + y() * lv.y(); }

◆ operator*() [2/2]

LocVec2D TrkDriftCircleMath::LocVec2D::operator* ( double  v) const
inline

Definition at line 70 of file LocVec2D.h.

70  {
71  LocVec2D n(*this);
72  return n *= v;
73  }

◆ operator*=()

LocVec2D& TrkDriftCircleMath::LocVec2D::operator*= ( double  v)
inline

Definition at line 75 of file LocVec2D.h.

75  {
76  m_x *= v;
77  m_y *= v;
78  return *this;
79  }

◆ operator+()

LocVec2D TrkDriftCircleMath::LocVec2D::operator+ ( const LocVec2D lv) const
inline

Plus and minus operators.

Definition at line 47 of file LocVec2D.h.

47 { return LocVec2D(x() + lv.x(), y() + lv.y()); }

◆ operator+=()

LocVec2D& TrkDriftCircleMath::LocVec2D::operator+= ( const LocVec2D lv)
inline

Incrementation operator.

Definition at line 56 of file LocVec2D.h.

56  {
57  m_x += lv.x();
58  m_y += lv.y();
59  return *this;
60  }

◆ operator-()

LocVec2D TrkDriftCircleMath::LocVec2D::operator- ( const LocVec2D lv) const
inline

Definition at line 49 of file LocVec2D.h.

49 { return LocVec2D(x() - lv.x(), y() - lv.y()); }

◆ operator-=()

LocVec2D& TrkDriftCircleMath::LocVec2D::operator-= ( const LocVec2D lv)
inline

Definition at line 62 of file LocVec2D.h.

62  {
63  m_x -= lv.x();
64  m_y -= lv.y();
65  return *this;
66  }

◆ operator/=()

LocVec2D& TrkDriftCircleMath::LocVec2D::operator/= ( double  v)
inline

Definition at line 81 of file LocVec2D.h.

81  {
82  m_x /= v;
83  m_y /= v;
84  return *this;
85  }

◆ operator=() [1/2]

LocVec2D& TrkDriftCircleMath::LocVec2D::operator= ( const LocVec2D )
default

Default assignment operators (Equivalent to the setter x)

◆ operator=() [2/2]

LocVec2D& TrkDriftCircleMath::LocVec2D::operator= ( LocVec2D &&  )
default

◆ set() [1/2]

void TrkDriftCircleMath::LocVec2D::set ( const LocVec2D vec)
inline

Setter function using another vector.

Definition at line 32 of file LocVec2D.h.

32  {
33  m_x = vec.x();
34  m_y = vec.y();
35  }

◆ set() [2/2]

void TrkDriftCircleMath::LocVec2D::set ( double  x,
double  y 
)
inline

Set x & y simultaenously.

Definition at line 37 of file LocVec2D.h.

37  {
38  m_x = x;
39  m_y = y;
40  }

◆ setX()

void TrkDriftCircleMath::LocVec2D::setX ( double  x)
inline

Set only x.

Definition at line 42 of file LocVec2D.h.

42 { m_x = x; }

◆ setY()

void TrkDriftCircleMath::LocVec2D::setY ( double  y)
inline

Set only y.

Definition at line 44 of file LocVec2D.h.

44 { m_y = y; }

◆ x()

double TrkDriftCircleMath::LocVec2D::x ( ) const
inline

Returns the x coordinate of the vector.

Definition at line 27 of file LocVec2D.h.

27 { return m_x; }

◆ y()

double TrkDriftCircleMath::LocVec2D::y ( ) const
inline

Returns the y coordinate of the vector.

Definition at line 29 of file LocVec2D.h.

29 { return m_y; }

Member Data Documentation

◆ m_x

double TrkDriftCircleMath::LocVec2D::m_x {0}
private

Definition at line 92 of file LocVec2D.h.

◆ m_y

double TrkDriftCircleMath::LocVec2D::m_y {0}
private

Definition at line 93 of file LocVec2D.h.


The documentation for this class was generated from the following file:
TrkDriftCircleMath::LocVec2D::x
double x() const
Returns the x coordinate of the vector.
Definition: LocVec2D.h:27
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
beamspotman.n
n
Definition: beamspotman.py:731
TrkDriftCircleMath::LocVec2D::y
double y() const
Returns the y coordinate of the vector.
Definition: LocVec2D.h:29
TrkDriftCircleMath::LocVec2D::m_y
double m_y
Definition: LocVec2D.h:93
TrkDriftCircleMath::LocVec2D::m_x
double m_x
Definition: LocVec2D.h:92
TrkDriftCircleMath::LocVec2D::LocVec2D
LocVec2D()=default
python.PyAthena.v
v
Definition: PyAthena.py:154