ATLAS Offline Software
Loading...
Searching...
No Matches
FPTracker::Point Class Reference

#include <Point.h>

Collaboration diagram for FPTracker::Point:

Public Member Functions

 Point ()
 Point (double, double, double)
Pointoperator+= (const Point &rhs)
Pointoperator-= (const Point &rhs)
Pointoperator+= (const TransversePoint &rhs)
Pointoperator-= (const TransversePoint &rhs)
double operator[] (unsigned int) const
double & operator[] (unsigned int)
Pointoperator*= (double)
TransversePoint transverse () const
double perp2 () const
std::string str () const
double x () const
double y () const
double z () const
double mag2 () const
double mag () const

Private Attributes

double m_x
double m_y
double m_z

Detailed Description

Definition at line 14 of file FPTracker/FPTracker/Point.h.

Constructor & Destructor Documentation

◆ Point() [1/2]

FPTracker::Point::Point ( )

◆ Point() [2/2]

FPTracker::Point::Point ( double x,
double y,
double z )

Member Function Documentation

◆ mag()

double FPTracker::Point::mag ( ) const

Definition at line 34 of file FPTracker/src/Point.cxx.

34 {
35 return std::sqrt(mag2());
36 }

◆ mag2()

double FPTracker::Point::mag2 ( ) const

Definition at line 32 of file FPTracker/src/Point.cxx.

32{return m_x*m_x+m_y*m_y+m_z*m_z;}

◆ operator*=()

Point & FPTracker::Point::operator*= ( double scalar)

Definition at line 25 of file FPTracker/src/Point.cxx.

25 {
26 m_x *= scalar;
27 m_y *= scalar;
28 m_z *= scalar;
29 return *this;
30 }

◆ operator+=() [1/2]

Point & FPTracker::Point::operator+= ( const Point & rhs)

Definition at line 66 of file FPTracker/src/Point.cxx.

66 {
67 m_x += rhs.m_x;
68 m_y += rhs.m_y;
69 m_z += rhs.m_z;
70 return *this;
71 }

◆ operator+=() [2/2]

Point & FPTracker::Point::operator+= ( const TransversePoint & rhs)

Definition at line 80 of file FPTracker/src/Point.cxx.

80 {
81 m_x += rhs.x();
82 m_y += rhs.y();
83 return *this;
84 }

◆ operator-=() [1/2]

Point & FPTracker::Point::operator-= ( const Point & rhs)

Definition at line 73 of file FPTracker/src/Point.cxx.

73 {
74 m_x -= rhs.m_x;
75 m_y -= rhs.m_y;
76 m_z -= rhs.m_z;
77 return *this;
78 }

◆ operator-=() [2/2]

Point & FPTracker::Point::operator-= ( const TransversePoint & rhs)

Definition at line 86 of file FPTracker/src/Point.cxx.

86 {
87 m_x -= rhs.x();
88 m_y -= rhs.y();
89 return *this;
90 }

◆ operator[]() [1/2]

double & FPTracker::Point::operator[] ( unsigned int i)

Definition at line 52 of file FPTracker/src/Point.cxx.

52 {
53
54 if ( i>2 )
55 {
56 std::ostringstream ost;
57 ost<<"TranversePoint index out of range: "<<i<<'\n';
58 throw std::range_error(ost.str());
59 }
60
61 if(i == 0){return m_x;}
62 if(i == 1){return m_y;}
63 return m_z;
64 }

◆ operator[]() [2/2]

double FPTracker::Point::operator[] ( unsigned int i) const

Definition at line 38 of file FPTracker/src/Point.cxx.

38 {
39
40 if ( i>2 )
41 {
42 std::ostringstream ost;
43 ost<<"TranversePoint index out of range: "<<i<<'\n';
44 throw std::range_error(ost.str());
45 }
46
47 if(i == 0){return m_x;}
48 if(i == 1){return m_y;}
49 return m_z;
50 }

◆ perp2()

double FPTracker::Point::perp2 ( ) const

Definition at line 21 of file FPTracker/src/Point.cxx.

21{return m_x*m_x+m_y*m_y;}

◆ str()

std::string FPTracker::Point::str ( ) const

Definition at line 92 of file FPTracker/src/Point.cxx.

92 {
93 std::ostringstream ost;
94 ost<<std::setprecision(3)<<std::scientific<<"x\t"<<m_x<<" y\t"<<m_y<<" z\t"<<m_z;
95 return ost.str();
96 }

◆ transverse()

TransversePoint FPTracker::Point::transverse ( ) const

Definition at line 23 of file FPTracker/src/Point.cxx.

23{return TransversePoint(m_x, m_y);}

◆ x()

double FPTracker::Point::x ( ) const

Definition at line 17 of file FPTracker/src/Point.cxx.

17{return m_x;}

◆ y()

double FPTracker::Point::y ( ) const

Definition at line 18 of file FPTracker/src/Point.cxx.

18{return m_y;}

◆ z()

double FPTracker::Point::z ( ) const

Definition at line 19 of file FPTracker/src/Point.cxx.

19{return m_z;}

Member Data Documentation

◆ m_x

double FPTracker::Point::m_x
private

Definition at line 34 of file FPTracker/FPTracker/Point.h.

◆ m_y

double FPTracker::Point::m_y
private

Definition at line 35 of file FPTracker/FPTracker/Point.h.

◆ m_z

double FPTracker::Point::m_z
private

Definition at line 36 of file FPTracker/FPTracker/Point.h.


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