Belle II Software  release-05-02-19
Vector3D.h
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 #pragma once
11 
12 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
13 #include <tracking/trackFindingCDC/numerics/Quadratic.h>
14 
15 #include <framework/geometry/B2Vector3.h>
16 
17 #include <string>
18 #include <iosfwd>
19 #include <cmath>
20 
21 class TVector3;
22 
23 namespace Belle2 {
28  namespace TrackFindingCDC {
29 
31 
34  class Vector3D {
35 
36  public:
39  : m_xy(0.0, 0.0)
40  , m_z(0.0)
41  {
42  }
43 
45  explicit Vector3D(const TVector3& tVector3);
46 
48  explicit Vector3D(const B2Vector3D& b2Vector3);
49 
51  Vector3D(double x, double y, double z)
52  : m_xy(x, y)
53  , m_z(z)
54  {
55  }
56 
58  explicit Vector3D(const Vector2D& xy)
59  : m_xy(xy)
60  , m_z(0.0)
61  {
62  }
63 
65  Vector3D(const Vector2D& xy, double z)
66  : m_xy(xy)
67  , m_z(z)
68  {
69  }
70 
72  Vector3D& operator=(const TVector3& tVector3);
73 
75  Vector3D& operator=(const B2Vector3D& b2Vector3);
76 
78 
82  static Vector3D average(const Vector3D& one, const Vector3D& two)
83  {
84  if (one.hasNAN()) {
85  return two;
86  } else if (two.hasNAN()) {
87  return one;
88  } else {
89  return Vector3D((one.x() + two.x()) / 2.0,
90  (one.y() + two.y()) / 2.0,
91  (one.z() + two.z()) / 2.0);
92  }
93  }
94 
96 
101  static Vector3D average(const Vector3D& one, const Vector3D& two, const Vector3D& three)
102  {
103 
104  if (one.hasNAN()) {
105  return average(two, three);
106  } else if (two.hasNAN()) {
107  return average(one, three);
108  } else if (three.hasNAN()) {
109  return average(one, two);
110  } else {
111  return Vector3D((one.x() + two.x() + three.x()) / 3.0,
112  (one.y() + two.y() + three.y()) / 3.0,
113  (one.z() + two.z() + three.z()) / 3.0);
114  }
115  }
116 
118  operator const TVector3() const;
119 
121  operator const B2Vector3D() const;
122 
124  bool operator==(const Vector3D& rhs) const
125  {
126  return x() == rhs.x() and y() == rhs.y() and z() == rhs.z();
127  }
128 
131 
137  bool operator<(const Vector3D& rhs) const
138  {
139  return norm() < rhs.norm() or (norm() == rhs.norm() and
140  (z() < rhs.z() or (z() == rhs.z() and (phi() < rhs.phi()))));
141  }
142 
144 
146  {
147  return Vector3D(0.0, 0.0, 0.0);
148  }
149 
151  bool isNull() const
152  {
153  return x() == 0.0 and y() == 0.0 and z() == 0.0;
154  }
155 
157  bool hasNAN() const
158  {
159  return std::isnan(x()) or std::isnan(y()) or std::isnan(z());
160  }
161 
163  std::string __str__() const;
164 
166  double dot(const Vector3D& rhs) const
167  {
168  return x() * rhs.x() + y() * rhs.y() + z() * rhs.z();
169  }
170 
172  double dotXY(const Vector3D& rhs) const
173  {
174  return x() * rhs.x() + y() * rhs.y();
175  }
176 
178  Vector3D cross(const Vector3D& rhs) const
179  {
180  return Vector3D(y() * rhs.z() - z() * rhs.y(),
181  z() * rhs.x() - x() * rhs.z(),
182  x() * rhs.y() - y() * rhs.x());
183  }
184 
186  double crossXY(const Vector3D& rhs) const
187  {
188  return xy().cross(rhs.xy());
189  }
190 
192  double crossXY(const Vector2D& rhs) const
193  {
194  return xy().cross(rhs);
195  }
196 
198  double normSquared() const
199  {
200  return x() * x() + y() * y() + z() * z();
201  }
202 
204  double norm() const
205  {
206  return hypot3(x(), y(), z());
207  }
208 
215  double cosWith(const Vector3D& rhs) const
218  {
219  return dot(rhs) / (norm() * rhs.norm());
220  }
221 
223  double sinWith(const Vector3D& rhs) const
224  {
225  return cross(rhs).norm() / (norm() * rhs.norm());
226  }
227 
229  double angleWith(const Vector3D& rhs) const
230  {
231  return atan2(sinWith(rhs), cosWith(rhs));
232  }
234 
236  double distance(const Vector3D& rhs = Vector3D(0.0, 0.0, 0.0)) const
237  {
238  double deltaX = x() - rhs.x();
239  double deltaY = y() - rhs.y();
240  double deltaZ = z() - rhs.z();
241  return hypot3(deltaX, deltaY, deltaZ);
242  }
243 
245  Vector3D& scale(const double factor)
246  {
247  m_xy.scale(factor);
248  m_z *= factor;
249  return *this;
250  }
251 
253  Vector3D& operator*=(const double factor)
254  {
255  return scale(factor);
256  }
257 
259  Vector3D scaled(const double factor) const
260  {
261  return Vector3D(xy().scaled(factor), z() * factor);
262  }
263 
265  Vector3D operator*(const double factor) const
266  {
267  return scaled(factor);
268  }
269 
271  Vector3D& divide(const double denominator)
272  {
273  m_xy.divide(denominator);
274  m_z /= denominator;
275  return *this;
276  }
277 
279  Vector3D& operator/=(const double denominator)
280  {
281  return divide(denominator);
282  }
283 
285  Vector3D divided(const double denominator) const
286  {
287  return Vector3D(xy().divided(denominator), z() / denominator);
288  }
289 
291  Vector3D operator/(const double denominator) const
292  {
293  return divided(denominator);
294  }
295 
297  Vector3D& add(const Vector3D& rhs)
298  {
299  m_xy.add(rhs.xy());
300  m_z += rhs.z();
301  return *this;
302  }
303 
305  Vector3D& add(const Vector2D& rhs)
306  {
307  m_xy.add(rhs);
308  return *this;
309  }
310 
313  {
314  return add(rhs);
315  }
316 
319  {
320  return add(rhs);
321  }
322 
325  {
326  m_xy.subtract(rhs.xy());
327  m_z -= rhs.z();
328  return *this;
329  }
330 
333  {
334  m_xy.subtract(rhs);
335  return *this;
336  }
337 
340  {
341  return subtract(rhs);
342  }
343 
346  {
347  return subtract(rhs);
348  }
349 
351  Vector3D unit() const
352  {
353  return isNull() ? Vector3D(0.0, 0.0, 0.0) : divided(norm());
354  }
355 
357 
359  double normalize()
360  {
361  double result = norm();
362  if (result != 0.0) divide(result);
363  return result;
364  }
365 
367 
369  double normalizeTo(const double toLength)
370  {
371  double result = norm();
372  if (result != 0.0) scale(toLength / result);
373  return result;
374  }
375 
378  {
379  scale(-1.0);
380  return *this;
381  }
382 
385  {
386  return scaled(-1.0);
387  }
388 
391  {
392  return reversed();
393  }
394 
396  Vector3D operator+(const Vector3D& rhs) const
397  {
398  return Vector3D(xy() + rhs.xy(), z() + rhs.z());
399  }
400 
402  Vector3D operator-(const Vector3D& rhs) const
403  {
404  return Vector3D(xy() - rhs.xy(), z() - rhs.z());
405  }
406 
408  double parallelComp(const Vector3D& relativTo) const
409  {
410  return relativTo.dot(*this) / relativTo.norm();
411  }
412 
414  Vector3D parallelVector(const Vector3D& relativTo) const
415  {
416  return relativTo.scaled(relativTo.dot(*this) / relativTo.normSquared());
417  }
418 
420 
422  double unnormalizedParallelComp(const Vector3D& relativTo) const
423  {
424  return relativTo.dot(*this);
425  }
426 
428 
432  double orthogonalComp(const Vector3D& relativTo) const
433  {
434  return relativTo.cross(*this).norm() / relativTo.norm();
435  }
436 
438  Vector3D orthogonalVector(const Vector3D& relativTo) const
439  {
440  return *this - parallelVector(relativTo);
441  }
442 
444 
446  double unnormalizedOrthogonalComp(const Vector3D& relativTo) const
447  {
448  return relativTo.cross(*this).norm();
449  }
450 
452  void passiveMoveBy(const Vector3D& by)
453  {
454  subtract(by);
455  }
456 
459  {
460  return *this - by;
461  }
462 
464  double x() const
465  {
466  return m_xy.x();
467  }
468 
470  void setX(const double x)
471  {
472  m_xy.setX(x);
473  }
474 
476  double y() const
477  {
478  return m_xy.y();
479  }
480 
482  void setY(const double y)
483  {
484  m_xy.setY(y);
485  }
486 
488  double z() const
489  {
490  return m_z;
491  }
492 
494  void setZ(const double z)
495  {
496  m_z = z;
497  }
498 
500  const Vector2D& xy() const
501  {
502  return m_xy;
503  }
504 
506  void setXY(const Vector2D& xy)
507  {
508  m_xy = xy;
509  }
510 
512  void set(const double first, const double second, const double third)
513  {
514  setX(first);
515  setY(second);
516  setZ(third);
517  }
518 
520  double cylindricalRSquared() const
521  {
522  return xy().normSquared();
523  }
524 
526  double cylindricalR() const
527  {
528  return xy().norm();
529  }
530 
532  double phi() const
533  {
534  return xy().phi();
535  }
536 
538  double theta() const
539  {
540  return atan2(cylindricalR(), z());
541  }
542 
544  double lambda() const
545  {
546  return atan2(z(), cylindricalR());
547  }
548 
550  double cotTheta() const
551  {
552  return z() / cylindricalR();
553  }
554 
556  double tanLambda() const
557  {
558  return z() / cylindricalR();
559  }
560 
561  private:
564 
566  double m_z;
567  };
568 
570  std::ostream& operator<<(std::ostream& output, const Vector3D& vector3D);
571  }
573 }
Belle2::TrackFindingCDC::Vector3D::hasNAN
bool hasNAN() const
Checks if one of the coordinates is NAN.
Definition: Vector3D.h:157
Belle2::TrackFindingCDC::Vector3D::parallelVector
Vector3D parallelVector(const Vector3D &relativTo) const
Calculates the part of this vector that is parallel to the given vector.
Definition: Vector3D.h:414
Belle2::TrackFindingCDC::Vector3D::angleWith
double angleWith(const Vector3D &rhs) const
The angle between this and rhs.
Definition: Vector3D.h:229
Belle2::TrackFindingCDC::Vector3D::Vector3D
Vector3D()
Default constructor for ROOT compatibility.
Definition: Vector3D.h:38
Belle2::TrackFindingCDC::Vector3D::Vector3D
Vector3D(double x, double y, double z)
Constructor from three coordinates.
Definition: Vector3D.h:51
Belle2::TrackFindingCDC::Vector3D::operator/=
Vector3D & operator/=(const double denominator)
Same as divide()
Definition: Vector3D.h:279
Belle2::TrackFindingCDC::Vector3D::cosWith
double cosWith(const Vector3D &rhs) const
Definition: Vector3D.h:217
Belle2::TrackFindingCDC::Vector3D::orthogonalComp
double orthogonalComp(const Vector3D &relativTo) const
Calculates the component orthogonal to the given vector.
Definition: Vector3D.h:432
Belle2::TrackFindingCDC::Vector3D::getLowest
static Vector3D getLowest()
Getter for the lowest possible vector.
Definition: Vector3D.h:145
Belle2::operator<<
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Definition: IntervalOfValidity.cc:196
Belle2::TrackFindingCDC::Vector3D::average
static Vector3D average(const Vector3D &one, const Vector3D &two, const Vector3D &three)
Constructs the average of three vectors.
Definition: Vector3D.h:101
Belle2::TrackFindingCDC::Vector2D::setY
void setY(const double y)
Setter for the y coordinate.
Definition: Vector2D.h:624
Belle2::TrackFindingCDC::Vector2D
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:37
Belle2::TrackFindingCDC::Vector3D::operator-=
Vector3D & operator-=(const Vector3D &rhs)
Same as subtract()
Definition: Vector3D.h:339
Belle2::TrackFindingCDC::Vector3D::operator=
Vector3D & operator=(const TVector3 &tVector3)
Assignment translating from a TVector3 instance.
Definition: Vector3D.cc:34
Belle2::TrackFindingCDC::Vector2D::normSquared
double normSquared() const
Calculates .
Definition: Vector2D.h:183
Belle2::TrackFindingCDC::Vector3D::unnormalizedOrthogonalComp
double unnormalizedOrthogonalComp(const Vector3D &relativTo) const
Same as orthogonalComp() but assumes the given vector to be of unit length.
Definition: Vector3D.h:446
Belle2::TrackFindingCDC::Vector2D::y
double y() const
Getter for the y coordinate.
Definition: Vector2D.h:619
Belle2::TrackFindingCDC::Vector3D::cotTheta
double cotTheta() const
Getter for the cotangent of the polar angle.
Definition: Vector3D.h:550
Belle2::TrackFindingCDC::Vector3D::m_z
double m_z
Memory for the third coordinate.
Definition: Vector3D.h:566
Belle2::TrackFindingCDC::Vector3D::x
double x() const
Getter for the x coordinate.
Definition: Vector3D.h:464
Belle2::TrackFindingCDC::Vector3D::setX
void setX(const double x)
Setter for the x coordinate.
Definition: Vector3D.h:470
Belle2::TrackFindingCDC::Vector3D::scaled
Vector3D scaled(const double factor) const
Returns a scaled copy of the vector.
Definition: Vector3D.h:259
Belle2::TrackFindingCDC::Vector3D::operator*=
Vector3D & operator*=(const double factor)
Same as scale()
Definition: Vector3D.h:253
Belle2::TrackFindingCDC::Vector2D::add
Vector2D & add(const Vector2D &rhs)
Adds a vector to this in place.
Definition: Vector2D.h:276
Belle2::TrackFindingCDC::Vector2D::phi
double phi() const
Gives the azimuth angle being the angle to the x axes ( range -M_PI to M_PI )
Definition: Vector2D.h:583
Belle2::TrackFindingCDC::Vector3D::dotXY
double dotXY(const Vector3D &rhs) const
Calculates the two dimensional dot product in xy projection.
Definition: Vector3D.h:172
Belle2::TrackFindingCDC::Vector3D::cylindricalRSquared
double cylindricalRSquared() const
Getter for the squared cylindrical radius ( xy projected squared norm )
Definition: Vector3D.h:520
Belle2::TrackFindingCDC::Vector3D::setXY
void setXY(const Vector2D &xy)
Setter for the xy projected vector.
Definition: Vector3D.h:506
Belle2::TrackFindingCDC::Vector3D::subtract
Vector3D & subtract(const Vector3D &rhs)
Subtracts a vector to this in place.
Definition: Vector3D.h:324
Belle2::TrackFindingCDC::Vector3D::norm
double norm() const
Calculates the length of the vector.
Definition: Vector3D.h:204
Belle2::TrackFindingCDC::Vector3D::cross
Vector3D cross(const Vector3D &rhs) const
Calculated the three dimensional cross product.
Definition: Vector3D.h:178
Belle2::TrackFindingCDC::Vector2D::cross
double cross(const Vector2D &rhs) const
Calculated the two dimensional cross product.
Definition: Vector2D.h:177
Belle2::B2Vector3< double >
Belle2::TrackFindingCDC::Vector3D::crossXY
double crossXY(const Vector2D &rhs) const
Calculates the two dimensional cross product in xy projection.
Definition: Vector3D.h:192
Belle2::TrackFindingCDC::Vector3D::orthogonalVector
Vector3D orthogonalVector(const Vector3D &relativTo) const
Calculates the part of this vector that is parallel to the given vector.
Definition: Vector3D.h:438
Belle2::TrackFindingCDC::Vector3D::unit
Vector3D unit() const
Returns a unit vector colaligned with this.
Definition: Vector3D.h:351
Belle2::TrackFindingCDC::Vector3D::setY
void setY(const double y)
Setter for the y coordinate.
Definition: Vector3D.h:482
Belle2::TrackFindingCDC::Vector3D::Vector3D
Vector3D(const Vector2D &xy, double z)
Constructor augmeting a Vector2D to a Vector3D setting z explicitly.
Definition: Vector3D.h:65
Belle2::TrackFindingCDC::Vector3D::operator+=
Vector3D & operator+=(const Vector3D &rhs)
Same as add()
Definition: Vector3D.h:312
Belle2::TrackFindingCDC::Vector3D::subtract
Vector3D & subtract(const Vector2D &rhs)
Subtracts a two dimensional vector from this in place taking z of the given vector as zero.
Definition: Vector3D.h:332
Belle2::TrackFindingCDC::Vector3D::passiveMoveBy
void passiveMoveBy(const Vector3D &by)
Passivelly moves the vector inplace by the given vector.
Definition: Vector3D.h:452
Belle2::TrackFindingCDC::Vector3D::operator-
Vector3D operator-() const
Same as reversed()
Definition: Vector3D.h:390
Belle2::TrackFindingCDC::Vector3D::average
static Vector3D average(const Vector3D &one, const Vector3D &two)
Constructs the average of two vectors.
Definition: Vector3D.h:82
Belle2::TrackFindingCDC::Vector3D::normSquared
double normSquared() const
Calculates the squared length of the vector.
Definition: Vector3D.h:198
Belle2::B2Vector3D
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition: B2Vector3.h:507
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::Vector3D::operator/
Vector3D operator/(const double denominator) const
Same as divided()
Definition: Vector3D.h:291
Belle2::TrackFindingCDC::Vector3D::theta
double theta() const
Getter for the polar angle.
Definition: Vector3D.h:538
Belle2::TrackFindingCDC::Vector3D::normalize
double normalize()
Normalizes the vector to unit length.
Definition: Vector3D.h:359
Belle2::TrackFindingCDC::Vector3D
A three dimensional vector.
Definition: Vector3D.h:34
Belle2::TrackFindingCDC::Vector3D::distance
double distance(const Vector3D &rhs=Vector3D(0.0, 0.0, 0.0)) const
Calculates the distance of this point to the rhs.
Definition: Vector3D.h:236
Belle2::TrackFindingCDC::Vector3D::isNull
bool isNull() const
Checks if the vector is the null vector.
Definition: Vector3D.h:151
Belle2::TrackFindingCDC::Vector3D::add
Vector3D & add(const Vector2D &rhs)
Adds a two dimensional vector to this in place taking z of the given vector as zero.
Definition: Vector3D.h:305
Belle2::TrackFindingCDC::Vector3D::operator+=
Vector3D & operator+=(const Vector2D &rhs)
Same as add()
Definition: Vector3D.h:318
Belle2::TrackFindingCDC::Vector3D::y
double y() const
Getter for the y coordinate.
Definition: Vector3D.h:476
Belle2::TrackFindingCDC::Vector3D::m_xy
Vector2D m_xy
Memory for the first and second coordinate available as a vector.
Definition: Vector3D.h:563
Belle2::TrackFindingCDC::Vector3D::tanLambda
double tanLambda() const
Getter for the tangent of lambda equivalent to cotTheta()
Definition: Vector3D.h:556
Belle2::TrackFindingCDC::Vector3D::dot
double dot(const Vector3D &rhs) const
Calculates the three dimensional dot product.
Definition: Vector3D.h:166
Belle2::TrackFindingCDC::Vector3D::normalizeTo
double normalizeTo(const double toLength)
Normalizes the vector to the given length.
Definition: Vector3D.h:369
Belle2::TrackFindingCDC::Vector3D::operator<
bool operator<(const Vector3D &rhs) const
Total ordering based on cylindrical radius first the z component second and azimuth angle third.
Definition: Vector3D.h:137
Belle2::TrackFindingCDC::Vector3D::operator+
Vector3D operator+(const Vector3D &rhs) const
Returns a new vector as sum of this and rhs.
Definition: Vector3D.h:396
Belle2::TrackFindingCDC::Vector3D::reverse
Vector3D & reverse()
Reverses the direction of the vector in place.
Definition: Vector3D.h:377
Belle2::TrackFindingCDC::Vector3D::add
Vector3D & add(const Vector3D &rhs)
Adds a vector to this in place.
Definition: Vector3D.h:297
Belle2::TrackFindingCDC::Vector3D::xy
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
Definition: Vector3D.h:500
Belle2::TrackFindingCDC::Vector3D::operator*
Vector3D operator*(const double factor) const
Same as scaled()
Definition: Vector3D.h:265
Belle2::TrackFindingCDC::Vector2D::x
double x() const
Getter for the x coordinate.
Definition: Vector2D.h:609
Belle2::TrackFindingCDC::Vector3D::__str__
std::string __str__() const
Output operator for python.
Definition: Vector3D.cc:65
Belle2::TrackFindingCDC::Vector2D::norm
double norm() const
Calculates the length of the vector.
Definition: Vector2D.h:189
Belle2::TrackFindingCDC::Vector3D::scale
Vector3D & scale(const double factor)
Scales the vector in place by the given factor.
Definition: Vector3D.h:245
Belle2::TrackFindingCDC::Vector3D::divide
Vector3D & divide(const double denominator)
Divides all coordinates by a common denominator in place.
Definition: Vector3D.h:271
Belle2::TrackFindingCDC::Vector3D::setZ
void setZ(const double z)
Setter for the z coordinate.
Definition: Vector3D.h:494
Belle2::TrackFindingCDC::Vector3D::operator-
Vector3D operator-(const Vector3D &rhs) const
Returns a new vector as differenc of this and rhs.
Definition: Vector3D.h:402
Belle2::TrackFindingCDC::Vector3D::z
double z() const
Getter for the z coordinate.
Definition: Vector3D.h:488
Belle2::TrackFindingCDC::Vector3D::set
void set(const double first, const double second, const double third)
Setter for all three coordinates.
Definition: Vector3D.h:512
Belle2::TrackFindingCDC::Vector2D::setX
void setX(const double x)
Setter for the x coordinate.
Definition: Vector2D.h:614
Belle2::TrackFindingCDC::Vector3D::operator==
bool operator==(const Vector3D &rhs) const
Equality comparison with all three coordinates.
Definition: Vector3D.h:124
Belle2::TrackFindingCDC::Vector3D::parallelComp
double parallelComp(const Vector3D &relativTo) const
Calculates the component parallel to the given vector.
Definition: Vector3D.h:408
Belle2::TrackFindingCDC::Vector2D::subtract
Vector2D & subtract(const Vector2D &rhs)
Subtracts a vector from this in place.
Definition: Vector2D.h:290
Belle2::TrackFindingCDC::Vector3D::lambda
double lambda() const
Getter for lambda.
Definition: Vector3D.h:544
Belle2::TrackFindingCDC::Vector3D::passiveMovedBy
Vector3D passiveMovedBy(const Vector3D &by)
Passivelly moves the vector inplace by the given vector.
Definition: Vector3D.h:458
Belle2::TrackFindingCDC::Vector3D::reversed
Vector3D reversed() const
Returns a vector pointing in the opposite direction.
Definition: Vector3D.h:384
Belle2::TrackFindingCDC::Vector3D::unnormalizedParallelComp
double unnormalizedParallelComp(const Vector3D &relativTo) const
Same as parallelComp() but assumes the given vector to be of unit length.
Definition: Vector3D.h:422
Belle2::TrackFindingCDC::Vector2D::divide
Vector2D & divide(const double denominator)
Divides all coordinates by a common denominator in place.
Definition: Vector2D.h:251
Belle2::TrackFindingCDC::Vector3D::sinWith
double sinWith(const Vector3D &rhs) const
Sine of the angle between this and rhs.
Definition: Vector3D.h:223
Belle2::TrackFindingCDC::Vector3D::cylindricalR
double cylindricalR() const
Getter for the cylindrical radius ( xy projected norm )
Definition: Vector3D.h:526
Belle2::TrackFindingCDC::Vector3D::Vector3D
Vector3D(const Vector2D &xy)
Constructor augmeting a Vector2D to a Vector3D setting z to zero.
Definition: Vector3D.h:58
Belle2::TrackFindingCDC::Vector3D::crossXY
double crossXY(const Vector3D &rhs) const
Calculates the two dimensional cross product in xy projection.
Definition: Vector3D.h:186
Belle2::TrackFindingCDC::Vector3D::operator-=
Vector3D & operator-=(const Vector2D &rhs)
Same as subtract()
Definition: Vector3D.h:345
Belle2::TrackFindingCDC::Vector3D::divided
Vector3D divided(const double denominator) const
Returns a copy where all coordinates got divided by a common denominator.
Definition: Vector3D.h:285
Belle2::TrackFindingCDC::Vector3D::phi
double phi() const
Getter for the azimuth angle.
Definition: Vector3D.h:532
Belle2::TrackFindingCDC::Vector2D::scale
Vector2D & scale(const double factor)
Scales the vector in place by the given factor.
Definition: Vector2D.h:226