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

#include <Point.h>

Collaboration diagram for ForwardTracker::Point:

Public Member Functions

 Point ()
 Point (double, double, double)
double x () const
double y () const
double z () const
double perp2 () const
double mag2 () const
double mag () const
TransversePoint transverse () const
Pointoperator*= (double scalar)
Pointoperator+= (const Point &p)
Pointoperator-= (const Point &p)
Pointoperator+= (const TransversePoint &p)
Pointoperator-= (const TransversePoint &p)
double operator[] (unsigned int i) const
double & operator[] (unsigned int i)
void rotat (double angle, bool bendplane)
std::string str () const

Private Member Functions

void checkIndex (unsigned int i) const

Private Attributes

double m_x
double m_y
double m_z

Detailed Description

Definition at line 15 of file ForwardTracker/ForwardTracker/Point.h.

Constructor & Destructor Documentation

◆ Point() [1/2]

◆ Point() [2/2]

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

Member Function Documentation

◆ checkIndex()

void ForwardTracker::Point::checkIndex ( unsigned int i) const
inlineprivate

Definition at line 45 of file ForwardTracker/ForwardTracker/Point.h.

45{ if (i>2) throw std::range_error("Index of Point is out of range"); }

◆ mag()

double ForwardTracker::Point::mag ( ) const
inline

Definition at line 27 of file ForwardTracker/ForwardTracker/Point.h.

27{ return std::sqrt(mag2()); }

◆ mag2()

double ForwardTracker::Point::mag2 ( ) const
inline

Definition at line 26 of file ForwardTracker/ForwardTracker/Point.h.

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

◆ operator*=()

Point & ForwardTracker::Point::operator*= ( double scalar)
inline

Definition at line 30 of file ForwardTracker/ForwardTracker/Point.h.

30{ m_x *= scalar; m_y *= scalar; m_z *= scalar; return *this; }

◆ operator+=() [1/2]

Point & ForwardTracker::Point::operator+= ( const Point & p)
inline

Definition at line 31 of file ForwardTracker/ForwardTracker/Point.h.

31{ m_x += p.x(); m_y += p.y(); m_z += p.z(); return *this; }

◆ operator+=() [2/2]

Point & ForwardTracker::Point::operator+= ( const TransversePoint & p)
inline

Definition at line 33 of file ForwardTracker/ForwardTracker/Point.h.

33{ m_x += p.x(); m_y += p.y(); return *this; }

◆ operator-=() [1/2]

Point & ForwardTracker::Point::operator-= ( const Point & p)
inline

Definition at line 32 of file ForwardTracker/ForwardTracker/Point.h.

32{ m_x -= p.x(); m_y -= p.y(); m_z -= p.z(); return *this; }

◆ operator-=() [2/2]

Point & ForwardTracker::Point::operator-= ( const TransversePoint & p)
inline

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

34{ m_x -= p.x(); m_y -= p.y(); return *this; }

◆ operator[]() [1/2]

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

Definition at line 37 of file ForwardTracker/ForwardTracker/Point.h.

37{ checkIndex(i); if (i == 0) return m_x; if (i == 1) return m_y; return m_z; }

◆ operator[]() [2/2]

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

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

36{ checkIndex(i); if (i == 0) return m_x; if (i == 1) return m_y; return m_z; }

◆ perp2()

double ForwardTracker::Point::perp2 ( ) const
inline

Definition at line 25 of file ForwardTracker/ForwardTracker/Point.h.

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

◆ rotat()

void ForwardTracker::Point::rotat ( double angle,
bool bendplane )

Definition at line 12 of file ForwardTracker/src/Point.cxx.

12 {
13
14 double ds = (*this)[bendplane];
15 double dz = (*this)[2];
16
17 (*this)[bendplane] = cos(angle)*ds - sin(angle)*dz;
18 (*this)[2] = sin(angle)*ds + cos(angle)*dz;
19 }
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)

◆ str()

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

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

21 {
22
23 std::ostringstream ost;
24
25 ost << std::fixed
26 << std::setprecision(9) << "("
27 << std::setw(12) << m_x << ", "
28 << std::setw(12) << m_y << ", "
29 << std::setw(14) << m_z << ")";
30
31 return ost.str();
32 }

◆ transverse()

TransversePoint ForwardTracker::Point::transverse ( ) const
inline

Definition at line 28 of file ForwardTracker/ForwardTracker/Point.h.

28{ return TransversePoint(m_x, m_y); }

◆ x()

double ForwardTracker::Point::x ( ) const
inline

Definition at line 22 of file ForwardTracker/ForwardTracker/Point.h.

22{ return m_x; }

◆ y()

double ForwardTracker::Point::y ( ) const
inline

Definition at line 23 of file ForwardTracker/ForwardTracker/Point.h.

23{ return m_y; }

◆ z()

double ForwardTracker::Point::z ( ) const
inline

Definition at line 24 of file ForwardTracker/ForwardTracker/Point.h.

24{ return m_z; }

Member Data Documentation

◆ m_x

double ForwardTracker::Point::m_x
private

Definition at line 47 of file ForwardTracker/ForwardTracker/Point.h.

◆ m_y

double ForwardTracker::Point::m_y
private

Definition at line 48 of file ForwardTracker/ForwardTracker/Point.h.

◆ m_z

double ForwardTracker::Point::m_z
private

Definition at line 49 of file ForwardTracker/ForwardTracker/Point.h.


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