ATLAS Offline Software
ForwardTracker/src/Point.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "ForwardTracker/Point.h"
6 
7 namespace ForwardTracker {
8 
9  Point::Point(): m_x(0), m_y(0), m_z(0) {}
10  Point::Point(double x, double y, double z): m_x(x), m_y(y), m_z(z) {}
11 
12  void Point::rotat(double angle, bool bendplane) {
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  }
20 
21  std::string Point::str() const {
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  }
33 
34  Point operator*(double scalar, const Point& p) { Point point(p); return point *= scalar; }
35  Point operator+(const Point& lhs, const Point& rhs) { Point point(lhs); return point += rhs; }
36  Point operator-(const Point& lhs, const Point& rhs) { Point point(lhs); return point -= rhs; }
37  Point operator+(const Point& lhs, const TransversePoint& rhs) { Point point(lhs); return point += rhs; }
38  Point operator-(const Point& lhs, const TransversePoint& rhs) { Point point(lhs); return point -= rhs; }
39 
40  std::ostream& operator<<(std::ostream& os, const Point& p) { os << p.str(); return os; }
41 }
checkxAOD.ds
ds
Definition: Tools/PyUtils/bin/checkxAOD.py:260
python.trigbs_prescaleL1.ost
ost
Definition: trigbs_prescaleL1.py:104
ForwardTracker::operator-
Point operator-(const Point &lhs, const Point &rhs)
Definition: ForwardTracker/src/Point.cxx:36
ForwardTracker::Point::m_x
double m_x
Definition: ForwardTracker/ForwardTracker/Point.h:47
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
x
#define x
ForwardTracker::Point
Definition: ForwardTracker/ForwardTracker/Point.h:15
ForwardTracker::operator<<
std::ostream & operator<<(std::ostream &, const Beamline &)
Definition: ForwardTracker/src/Beamline.cxx:105
ForwardTracker::Point::m_y
double m_y
Definition: ForwardTracker/ForwardTracker/Point.h:48
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ForwardTracker::Point::m_z
double m_z
Definition: ForwardTracker/ForwardTracker/Point.h:49
z
#define z
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
ForwardTracker::Point::str
std::string str() const
Definition: ForwardTracker/src/Point.cxx:21
ForwardTracker::TransversePoint
Definition: ForwardTracker/ForwardTracker/TransversePoint.h:13
ForwardTracker::operator*
Point operator*(double scalar, const Point &p)
Definition: ForwardTracker/src/Point.cxx:34
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
y
#define y
ForwardTracker::Point::rotat
void rotat(double angle, bool bendplane)
Definition: ForwardTracker/src/Point.cxx:12
ForwardTracker::operator+
Point operator+(const Point &lhs, const Point &rhs)
Definition: ForwardTracker/src/Point.cxx:35
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Point.h
ForwardTracker::Point::Point
Point()
Definition: ForwardTracker/src/Point.cxx:9
ForwardTracker
Definition: ForwardTracker/ForwardTracker/Beamline.h:12