CGEM BOSS 6.6.5.f
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
 

Detailed Description

A class to represent a point in 2D.

Definition at line 37 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

Constructor & Destructor Documentation

◆ TPoint2D() [1/8]

TPoint2D::TPoint2D ( )

Constructors.

Definition at line 19 of file TPoint2D.cxx.

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

Referenced by operator+(), operator-(), and unit().

◆ TPoint2D() [2/8]

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/8]

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/8]

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/2]

TPoint2D::~TPoint2D ( )
virtual

Destructor.

Definition at line 39 of file TPoint2D.cxx.

39 {
40}

◆ TPoint2D() [5/8]

TPoint2D::TPoint2D ( )

Constructors.

◆ TPoint2D() [6/8]

TPoint2D::TPoint2D ( double  ,
double   
)

◆ TPoint2D() [7/8]

TPoint2D::TPoint2D ( const HepPoint3D )

◆ TPoint2D() [8/8]

TPoint2D::TPoint2D ( const HepVector3D )

◆ ~TPoint2D() [2/2]

virtual TPoint2D::~TPoint2D ( )
virtual

Destructor.

Member Function Documentation

◆ cross() [1/2]

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

Definition at line 139 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

139 {
140 return _p[0] * a.y() - a.x() * _p[1];
141}

Referenced by TTrackManager::salvageAssociateHits().

◆ cross() [2/2]

double TPoint2D::cross ( const TPoint2D ) const

◆ dot() [1/2]

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

Definition at line 133 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

133 {
134 return _p[0] * a.x() + _p[1] * a.y();
135}

Referenced by TTrack::stereoHitForCurl(), and TTrack::szPosition().

◆ dot() [2/2]

double TPoint2D::dot ( const TPoint2D ) const

◆ mag() [1/2]

double TPoint2D::mag ( void  ) const
inline

Definition at line 112 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

112 {
113 return sqrt(_p[0] * _p[0] + _p[1] * _p[1]);
114}

Referenced by TTrack::stereoHitForCurl(), and TTrack::szPosition().

◆ mag() [2/2]

double TPoint2D::mag ( void  ) const

◆ mag2() [1/2]

double TPoint2D::mag2 ( void  ) const
inline

Definition at line 118 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

118 {
119 return _p[0] * _p[0] + _p[1] * _p[1];
120}

◆ mag2() [2/2]

double TPoint2D::mag2 ( void  ) const

◆ operator+() [1/2]

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

Definition at line 145 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

145 {
146 return TPoint2D(_p[0] + a.x(), _p[1] + a.y());
147}
TPoint2D()
Constructors.
Definition: TPoint2D.cxx:19

◆ operator+() [2/2]

TPoint2D TPoint2D::operator+ ( const TPoint2D ) const

◆ operator-() [1/4]

TPoint2D TPoint2D::operator- ( ) const
inline

Definition at line 157 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

157 {
158 return TPoint2D(- _p[0], - _p[1]);
159}

◆ operator-() [2/4]

TPoint2D TPoint2D::operator- ( ) const

◆ operator-() [3/4]

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

Definition at line 151 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

151 {
152 return TPoint2D(_p[0] - a.x(), _p[1] - a.y());
153}

◆ operator-() [4/4]

TPoint2D TPoint2D::operator- ( const TPoint2D ) const

◆ operator==() [1/2]

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

Definition at line 163 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

163 {
164 if (a.x() == _p[0] && a.y() == _p[1]) return true;
165 return false;
166}

◆ operator==() [2/2]

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

◆ phi() [1/2]

double TPoint2D::phi ( void  ) const
inline

Definition at line 124 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

124 {
125 if (_p[0] == 0.0 && _p[1] == 0.0) return 0.;
126 double a = atan2(_p[1], _p[0]);
127 if (a > 0) return a;
128 return a + 2. * M_PI;
129}
#define M_PI
Definition: TConstant.h:4

◆ phi() [2/2]

double TPoint2D::phi ( void  ) const

◆ unit() [1/2]

TPoint2D TPoint2D::unit ( void  ) const
inline

Definition at line 170 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

170 {
171 double sum2 = _p[0] * _p[0] + _p[1] * _p[1];
172 if (sum2 == 0.) return TPoint2D(0., 0.);
173 double sum = sqrt(sum2);
174 return TPoint2D(_p[0] / sum, _p[1] / sum);
175}

◆ unit() [2/2]

TPoint2D TPoint2D::unit ( void  ) const

◆ x() [1/4]

double TPoint2D::x ( double  a)
inline

Definition at line 100 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

100 {
101 return _p[0] = a;
102}

◆ x() [2/4]

double TPoint2D::x ( double  )

◆ x() [3/4]

double TPoint2D::x ( void  ) const
inline

◆ x() [4/4]

double TPoint2D::x ( void  ) const

◆ y() [1/4]

double TPoint2D::y ( double  a)
inline

Definition at line 106 of file InstallArea/include/TrkReco/TrkReco/TPoint2D.h.

106 {
107 return _p[1] = a;
108}

◆ y() [2/4]

double TPoint2D::y ( double  )

◆ y() [3/4]

double TPoint2D::y ( void  ) const
inline

◆ y() [4/4]

double TPoint2D::y ( void  ) const

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