Belle II Software development
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/trackingUtilities/geometry/Vector2D.h>
9
10#include <sstream>
11#include <ostream>
12
13using namespace Belle2;
14using namespace TrackingUtilities;
15
16Vector2D::Vector2D(const ROOT::Math::XYVector& xyVector)
17 : m_x(xyVector.X()), m_y(xyVector.Y())
18{
19}
20
21Vector2D& Vector2D::operator=(const ROOT::Math::XYVector& xyVector)
22{
23 m_x = xyVector.X();
24 m_y = xyVector.Y();
25 return *this;
26}
27
28Vector2D::operator const ROOT::Math::XYVector() const
29{
30 return ROOT::Math::XYVector(x(), y());
31}
32
33std::ostream& TrackingUtilities::operator<<(std::ostream& output, const Vector2D& vector2D)
34{
35 output << "Vector2D(" << vector2D.x() << "," << vector2D.y() << ")";
36 return output;
37}
38
39std::string Vector2D::__str__() const
40{
41 std::stringstream sstream;
42 sstream << *this;
43 return sstream.str();
44}
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
Definition Vector2D.h:36
std::string __str__() const
Output operator for python.
Definition Vector2D.cc:39
double m_x
Memory for the first coordinate.
Definition Vector2D.h:705
Vector2D()
Default constructor for ROOT compatibility.
Definition Vector2D.h:40
double x() const
Getter for the x coordinate.
Definition Vector2D.h:626
double y() const
Getter for the y coordinate.
Definition Vector2D.h:641
double m_y
Memory for the second coordinate.
Definition Vector2D.h:708
Vector2D & operator=(const ROOT::Math::XYVector &xyVector)
Assignment translating from a ROOT::Math::XYVector instance.
Definition Vector2D.cc:21
double X() const
Getter for the x coordinate.
Definition Vector2D.h:631
double Y() const
Getter for the y coordinate.
Definition Vector2D.h:646
Abstract base class for different kinds of events.