Belle II Software  release-05-01-25
Vector2D.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
11 
12 #include <TVector2.h>
13 
14 #include <sstream>
15 #include <ostream>
16 
17 using namespace Belle2;
18 using namespace TrackFindingCDC;
19 
20 Vector2D::Vector2D(const TVector2& tVector2)
21  : m_x(tVector2.X())
22  , m_y(tVector2.Y())
23 {
24 }
25 
26 Vector2D& Vector2D::operator=(const TVector2& tVector2)
27 {
28  setX(tVector2.X());
29  setY(tVector2.Y());
30  return *this;
31 }
32 
33 Vector2D::operator const TVector2()
34 {
35  return TVector2(x(), y());
36 }
37 
38 std::ostream& TrackFindingCDC::operator<<(std::ostream& output, const Vector2D& vector2D)
39 {
40  output << "Vector2D(" << vector2D.x() << "," << vector2D.y() << ")";
41  return output;
42 }
43 
44 std::string Vector2D::__str__() const
45 {
46  std::stringstream sstream;
47  sstream << *this;
48  return sstream.str();
49 }
Belle2::operator<<
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Definition: IntervalOfValidity.cc:196
Belle2::TrackFindingCDC::Vector2D::setY
void setY(const double y)
Setter for the y coordinate.
Definition: Vector2D.h:624
Belle2::TrackFindingCDC::Vector2D::operator=
Vector2D & operator=(const TVector2 &tvector)
Assignment translating from a TVector2 instance.
Definition: Vector2D.cc:26
Belle2::TrackFindingCDC::Vector2D
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:37
Belle2::TrackFindingCDC::Vector2D::y
double y() const
Getter for the y coordinate.
Definition: Vector2D.h:619
Belle2::TrackFindingCDC::Vector2D::__str__
std::string __str__() const
Output operator for python.
Definition: Vector2D.cc:44
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::Vector2D::x
double x() const
Getter for the x coordinate.
Definition: Vector2D.h:609
Belle2::TrackFindingCDC::Vector2D::setX
void setX(const double x)
Setter for the x coordinate.
Definition: Vector2D.h:614
Belle2::TrackFindingCDC::Vector2D::Vector2D
Vector2D()
Default constructor for ROOT compatibility.
Definition: Vector2D.h:41