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

#include <TransversePoint.h>

Collaboration diagram for FPTracker::TransversePoint:

Public Member Functions

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

Private Attributes

double m_x
double m_y

Detailed Description

Definition at line 12 of file FPTracker/FPTracker/TransversePoint.h.

Constructor & Destructor Documentation

◆ TransversePoint() [1/2]

FPTracker::TransversePoint::TransversePoint ( )

◆ TransversePoint() [2/2]

FPTracker::TransversePoint::TransversePoint ( double x,
double y )

Member Function Documentation

◆ mag()

double FPTracker::TransversePoint::mag ( ) const

Definition at line 27 of file FPTracker/src/TransversePoint.cxx.

28 {
29 return std::sqrt(mag2());
30 }

◆ mag2()

double FPTracker::TransversePoint::mag2 ( ) const

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

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

◆ operator*=()

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

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

19 {
20 m_x *= scalar;
21 m_y *= scalar;
22 return *this;
23 }

◆ operator+=()

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

Definition at line 56 of file FPTracker/src/TransversePoint.cxx.

56 {
57 m_x += rhs.m_x;
58 m_y += rhs.m_y;
59 return *this;
60 }

◆ operator-=()

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

Definition at line 61 of file FPTracker/src/TransversePoint.cxx.

61 {
62 m_x -= rhs.m_x;
63 m_y -= rhs.m_y;
64 return *this;
65 }

◆ operator[]() [1/2]

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

Definition at line 44 of file FPTracker/src/TransversePoint.cxx.

44 {
45 if ( i>1)
46 {
47 std::ostringstream ost;
48 ost<<"TranversePoint index out of range: "<<i<<'\n';
49 throw std::range_error(ost.str());
50 }
51
52 if(i == 0){return m_x;}
53 return m_y;
54 }

◆ operator[]() [2/2]

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

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

33 {
34 if (i>1)
35 {
36 std::ostringstream ost;
37 ost<<"TranversePoint index out of range: "<<i<<'\n';
38 throw std::range_error(ost.str());
39 }
40 if(i == 0){return m_x;}
41 return m_y;
42 }

◆ str()

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

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

66 {
67 std::ostringstream ost;
68 ost<<std::setprecision(3)<<std::scientific<<"x\t"<<m_x<<" y\t"<<m_y;
69 return ost.str();
70 }

◆ x()

double FPTracker::TransversePoint::x ( ) const

Definition at line 16 of file FPTracker/src/TransversePoint.cxx.

16{return m_x;}

◆ y()

double FPTracker::TransversePoint::y ( ) const

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

17{return m_y;}

Member Data Documentation

◆ m_x

double FPTracker::TransversePoint::m_x
private

Definition at line 27 of file FPTracker/FPTracker/TransversePoint.h.

◆ m_y

double FPTracker::TransversePoint::m_y
private

Definition at line 28 of file FPTracker/FPTracker/TransversePoint.h.


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