BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TPoint2D Class Reference

A class to represent a point in 2D. More...

#include <TPoint2D.h>

Public Member Functions

 TPoint2D ()
 Constructors.
 TPoint2D (double, double)
 TPoint2D (const HepPoint3D &)
 TPoint2D (const HepVector3D &)
virtual ~TPoint2D ()
 Destructor.
double x (void) const
double y (void) const
double mag (void) const
double mag2 (void) const
double phi (void) const
double x (double)
double y (double)
double dot (const TPoint2D &) const
double cross (const TPoint2D &) const
TPoint2D unit (void) const
TPoint2D operator+ (const TPoint2D &) const
TPoint2D operator- (const TPoint2D &) const
TPoint2D operator- () const
bool operator== (const TPoint2D &) const
 TPoint2D ()
 Constructors.
 TPoint2D (double, double)
 TPoint2D (const HepPoint3D &)
 TPoint2D (const HepVector3D &)
virtual ~TPoint2D ()
 Destructor.
double x (void) const
double y (void) const
double mag (void) const
double mag2 (void) const
double phi (void) const
double x (double)
double y (double)
double dot (const TPoint2D &) const
double cross (const TPoint2D &) const
TPoint2D unit (void) const
TPoint2D operator+ (const TPoint2D &) const
TPoint2D operator- (const TPoint2D &) const
TPoint2D operator- () const
bool operator== (const TPoint2D &) const
 TPoint2D ()
 Constructors.
 TPoint2D (double, double)
 TPoint2D (const HepPoint3D &)
 TPoint2D (const HepVector3D &)
virtual ~TPoint2D ()
 Destructor.
double x (void) const
double y (void) const
double mag (void) const
double mag2 (void) const
double phi (void) const
double x (double)
double y (double)
double dot (const TPoint2D &) const
double cross (const TPoint2D &) const
TPoint2D unit (void) const
TPoint2D operator+ (const TPoint2D &) const
TPoint2D operator- (const TPoint2D &) const
TPoint2D operator- () const
bool operator== (const TPoint2D &) const

Detailed Description

A class to represent a point in 2D.

Definition at line 37 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

Constructor & Destructor Documentation

◆ TPoint2D() [1/12]

TPoint2D::TPoint2D ( )

Constructors.

Definition at line 19 of file TPoint2D.cxx.

19 {
20 _p[0] = 0.;
21 _p[1] = 0.;
22}

Referenced by cross(), dot(), operator+(), operator-(), operator-(), operator==(), and unit().

◆ TPoint2D() [2/12]

TPoint2D::TPoint2D ( double x,
double y )

Definition at line 24 of file TPoint2D.cxx.

24 {
25 _p[0] = x;
26 _p[1] = y;
27}

◆ TPoint2D() [3/12]

TPoint2D::TPoint2D ( const HepPoint3D & a)

Definition at line 29 of file TPoint2D.cxx.

29 {
30 _p[0] = a.x();
31 _p[1] = a.y();
32}

◆ TPoint2D() [4/12]

TPoint2D::TPoint2D ( const HepVector3D & a)

Definition at line 34 of file TPoint2D.cxx.

34 {
35 _p[0] = a.x();
36 _p[1] = a.y();
37}

◆ ~TPoint2D() [1/3]

TPoint2D::~TPoint2D ( )
virtual

Destructor.

Definition at line 39 of file TPoint2D.cxx.

39{}

◆ TPoint2D() [5/12]

TPoint2D::TPoint2D ( )

Constructors.

◆ TPoint2D() [6/12]

TPoint2D::TPoint2D ( double ,
double  )

◆ TPoint2D() [7/12]

TPoint2D::TPoint2D ( const HepPoint3D & )

◆ TPoint2D() [8/12]

TPoint2D::TPoint2D ( const HepVector3D & )

◆ ~TPoint2D() [2/3]

virtual TPoint2D::~TPoint2D ( )
virtual

Destructor.

◆ TPoint2D() [9/12]

TPoint2D::TPoint2D ( )

Constructors.

◆ TPoint2D() [10/12]

TPoint2D::TPoint2D ( double ,
double  )

◆ TPoint2D() [11/12]

TPoint2D::TPoint2D ( const HepPoint3D & )

◆ TPoint2D() [12/12]

TPoint2D::TPoint2D ( const HepVector3D & )

◆ ~TPoint2D() [3/3]

virtual TPoint2D::~TPoint2D ( )
virtual

Destructor.

Member Function Documentation

◆ cross() [1/3]

double TPoint2D::cross ( const TPoint2D & a) const
inline

Definition at line 108 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

108 {
109 return _p[0] * a.y() - a.x() * _p[1];
110}

Referenced by TTrackManager::salvageAssociateHits().

◆ cross() [2/3]

double TPoint2D::cross ( const TPoint2D & ) const

◆ cross() [3/3]

double TPoint2D::cross ( const TPoint2D & ) const

◆ dot() [1/3]

double TPoint2D::dot ( const TPoint2D & a) const
inline

Definition at line 104 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

104 {
105 return _p[0] * a.x() + _p[1] * a.y();
106}

◆ dot() [2/3]

double TPoint2D::dot ( const TPoint2D & ) const

◆ dot() [3/3]

double TPoint2D::dot ( const TPoint2D & ) const

◆ mag() [1/3]

double TPoint2D::mag ( void ) const
inline

Definition at line 93 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

93{ return sqrt( _p[0] * _p[0] + _p[1] * _p[1] ); }

◆ mag() [2/3]

double TPoint2D::mag ( void ) const

◆ mag() [3/3]

double TPoint2D::mag ( void ) const

◆ mag2() [1/3]

double TPoint2D::mag2 ( void ) const
inline

Definition at line 95 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

95{ return _p[0] * _p[0] + _p[1] * _p[1]; }

◆ mag2() [2/3]

double TPoint2D::mag2 ( void ) const

◆ mag2() [3/3]

double TPoint2D::mag2 ( void ) const

◆ operator+() [1/3]

TPoint2D TPoint2D::operator+ ( const TPoint2D & a) const
inline

Definition at line 112 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

112 {
113 return TPoint2D( _p[0] + a.x(), _p[1] + a.y() );
114}
TPoint2D()
Constructors.
Definition TPoint2D.cxx:19

◆ operator+() [2/3]

TPoint2D TPoint2D::operator+ ( const TPoint2D & ) const

◆ operator+() [3/3]

TPoint2D TPoint2D::operator+ ( const TPoint2D & ) const

◆ operator-() [1/6]

TPoint2D TPoint2D::operator- ( ) const
inline

Definition at line 120 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

120{ return TPoint2D( -_p[0], -_p[1] ); }

◆ operator-() [2/6]

TPoint2D TPoint2D::operator- ( ) const

◆ operator-() [3/6]

TPoint2D TPoint2D::operator- ( ) const

◆ operator-() [4/6]

TPoint2D TPoint2D::operator- ( const TPoint2D & a) const
inline

Definition at line 116 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

116 {
117 return TPoint2D( _p[0] - a.x(), _p[1] - a.y() );
118}

◆ operator-() [5/6]

TPoint2D TPoint2D::operator- ( const TPoint2D & ) const

◆ operator-() [6/6]

TPoint2D TPoint2D::operator- ( const TPoint2D & ) const

◆ operator==() [1/3]

bool TPoint2D::operator== ( const TPoint2D & a) const
inline

Definition at line 122 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

122 {
123 if ( a.x() == _p[0] && a.y() == _p[1] ) return true;
124 return false;
125}

◆ operator==() [2/3]

bool TPoint2D::operator== ( const TPoint2D & ) const

◆ operator==() [3/3]

bool TPoint2D::operator== ( const TPoint2D & ) const

◆ phi() [1/3]

double TPoint2D::phi ( void ) const
inline

Definition at line 97 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

97 {
98 if ( _p[0] == 0.0 && _p[1] == 0.0 ) return 0.;
99 double a = atan2( _p[1], _p[0] );
100 if ( a > 0 ) return a;
101 return a + 2. * M_PI;
102}
#define M_PI
Definition TConstant.h:4

◆ phi() [2/3]

double TPoint2D::phi ( void ) const

◆ phi() [3/3]

double TPoint2D::phi ( void ) const

◆ unit() [1/3]

TPoint2D TPoint2D::unit ( void ) const
inline

Definition at line 127 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

127 {
128 double sum2 = _p[0] * _p[0] + _p[1] * _p[1];
129 if ( sum2 == 0. ) return TPoint2D( 0., 0. );
130 double sum = sqrt( sum2 );
131 return TPoint2D( _p[0] / sum, _p[1] / sum );
132}

◆ unit() [2/3]

TPoint2D TPoint2D::unit ( void ) const

◆ unit() [3/3]

TPoint2D TPoint2D::unit ( void ) const

◆ x() [1/6]

double TPoint2D::x ( double a)
inline

Definition at line 89 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

89{ return _p[0] = a; }

◆ x() [2/6]

double TPoint2D::x ( double )

◆ x() [3/6]

double TPoint2D::x ( double )

◆ x() [4/6]

double TPoint2D::x ( void ) const
inline

◆ x() [5/6]

double TPoint2D::x ( void ) const

◆ x() [6/6]

double TPoint2D::x ( void ) const

◆ y() [1/6]

double TPoint2D::y ( double a)
inline

Definition at line 91 of file InstallArea/x86_64-el9-gcc13-dbg/include/TrkReco/TPoint2D.h.

91{ return _p[1] = a; }

◆ y() [2/6]

double TPoint2D::y ( double )

◆ y() [3/6]

double TPoint2D::y ( double )

◆ y() [4/6]

double TPoint2D::y ( void ) const
inline

◆ y() [5/6]

double TPoint2D::y ( void ) const

◆ y() [6/6]

double TPoint2D::y ( void ) const

The documentation for this class was generated from the following files: