Belle II Software  release-08-01-10
Vector2D.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
9 
10 #include <TVector2.h>
11 
12 #include <sstream>
13 #include <ostream>
14 
15 using namespace Belle2;
16 using namespace TrackFindingCDC;
17 
18 Vector2D::Vector2D(const TVector2& tVector2)
19  : m_x(tVector2.X())
20  , m_y(tVector2.Y())
21 {
22 }
23 
24 Vector2D& Vector2D::operator=(const TVector2& tVector2)
25 {
26  setX(tVector2.X());
27  setY(tVector2.Y());
28  return *this;
29 }
30 
31 Vector2D::operator const TVector2()
32 {
33  return TVector2(x(), y());
34 }
35 
36 std::ostream& TrackFindingCDC::operator<<(std::ostream& output, const Vector2D& vector2D)
37 {
38  output << "Vector2D(" << vector2D.x() << "," << vector2D.y() << ")";
39  return output;
40 }
41 
42 std::string Vector2D::__str__() const
43 {
44  std::stringstream sstream;
45  sstream << *this;
46  return sstream.str();
47 }
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:35
std::string __str__() const
Output operator for python.
Definition: Vector2D.cc:42
Vector2D()
Default constructor for ROOT compatibility.
Definition: Vector2D.h:39
double x() const
Getter for the x coordinate.
Definition: Vector2D.h:607
Vector2D & operator=(const TVector2 &tvector)
Assignment translating from a TVector2 instance.
Definition: Vector2D.cc:24
void setY(const double y)
Setter for the y coordinate.
Definition: Vector2D.h:622
double y() const
Getter for the y coordinate.
Definition: Vector2D.h:617
void setX(const double x)
Setter for the x coordinate.
Definition: Vector2D.h:612
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Abstract base class for different kinds of events.