ATLAS Offline Software
ForwardTracker/src/TransversePoint.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <iomanip>
8 #include <sstream>
9 
10 namespace ForwardTracker {
11 
12  TransversePoint::TransversePoint(): m_x(0), m_y(0) {}
13  TransversePoint::TransversePoint(double x, double y): m_x(x), m_y(y) {}
14 
15  std::string TransversePoint::str() const {
16 
17  std::ostringstream ost;
18 
19  ost << std::fixed
20  << std::setprecision(9) << "("
21  << std::setw(12) << m_x << ", "
22  << std::setw(12) << m_y << ")";
23 
24  return ost.str();
25  }
26 
27  TransversePoint operator*(double scalar, const TransversePoint& p) { TransversePoint point(p); return point *= scalar; }
28  TransversePoint operator+(const TransversePoint& lhs, const TransversePoint& rhs) { TransversePoint point(lhs); return point += rhs; }
29  TransversePoint operator-(const TransversePoint& lhs, const TransversePoint& rhs) { TransversePoint point(lhs); return point -= rhs; }
30 
31  std::ostream& operator<<(std::ostream& os, const TransversePoint& p) { os << p.str(); return os; }
32 }
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::TransversePoint::m_x
double m_x
Definition: ForwardTracker/ForwardTracker/TransversePoint.h:38
x
#define x
ForwardTracker::operator<<
std::ostream & operator<<(std::ostream &, const Beamline &)
Definition: ForwardTracker/src/Beamline.cxx:105
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TransversePoint.h
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::TransversePoint::str
std::string str() const
Definition: ForwardTracker/src/TransversePoint.cxx:15
ForwardTracker::operator+
Point operator+(const Point &lhs, const Point &rhs)
Definition: ForwardTracker/src/Point.cxx:35
ForwardTracker::TransversePoint::m_y
double m_y
Definition: ForwardTracker/ForwardTracker/TransversePoint.h:39
ForwardTracker::TransversePoint::TransversePoint
TransversePoint()
Definition: ForwardTracker/src/TransversePoint.cxx:12
ForwardTracker
Definition: ForwardTracker/ForwardTracker/Beamline.h:12