ATLAS Offline Software
Loading...
Searching...
No Matches
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
10namespace ForwardTracker {
11
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}
Point operator*(double scalar, const Point &p)
std::ostream & operator<<(std::ostream &, const Beamline &)
Point operator+(const Point &lhs, const Point &rhs)
Point operator-(const Point &lhs, const Point &rhs)