Belle II Software prerelease-11-00-00a
Vector2D.h
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#pragma once
9
10#include <tracking/trackingUtilities/numerics/Quadratic.h>
11
12#include <tracking/trackingUtilities/numerics/EForwardBackward.h>
13#include <tracking/trackingUtilities/numerics/ERightLeft.h>
14#include <tracking/trackingUtilities/numerics/ERotation.h>
15#include <tracking/trackingUtilities/numerics/ESign.h>
16
17#include <framework/geometry/VectorUtil.h>
18
19#include <Math/Vector2D.h>
20
21#include <utility>
22#include <string>
23#include <iosfwd>
24#include <cmath>
25
26namespace Belle2 {
31 namespace TrackingUtilities {
36 class Vector2D {
37
38 public:
40 Vector2D() = default;
41
42 // /// Constructor translating from a ROOT::Math::XYVector instance
43 // TODO / FIXME:
44 // had to comment this explicit constructor because of compilation issues that I did not
45 // fully understand nor really wanted to investigate and solve - just using the non-explicit
46 // version solved all the issues, but for the future I think it would be better to solve this
47 // issue and use the explicit constructor
48 // explicit Vector2D(const ROOT::Math::XYVector& xyVector)
50 Vector2D(const ROOT::Math::XYVector& xyVector);
51
53 Vector2D(const double x, const double y)
54 : m_x(x)
55 , m_y(y)
56 {
57 }
58
60 Vector2D& operator=(const ROOT::Math::XYVector& xyVector);
61
63 operator const ROOT::Math::XYVector() const;
64
71 Vector2D(const Vector2D& coordinateVec, const double parallelCoor, const double orthoCoor)
72 : m_x(coordinateVec.x() * parallelCoor - coordinateVec.y() * orthoCoor)
73 , m_y(coordinateVec.y() * parallelCoor + coordinateVec.x() * orthoCoor)
74 {
75 }
76
78 static Vector2D Phi(const double phi)
79 {
80 return std::isnan(phi) ? Vector2D(0.0, 0.0) : Vector2D(cos(phi), sin(phi));
81 }
82
85
89 static Vector2D
90 compose(const Vector2D& coordinateVec, const double parallelCoor, const double orthoCoor)
91 {
92 return Vector2D(coordinateVec, parallelCoor, orthoCoor);
93 }
94
96
100 static Vector2D average(const Vector2D& one, const Vector2D& two)
101 {
102 if (one.hasNAN()) {
103 return two;
104 } else if (two.hasNAN()) {
105 return one;
106 } else {
107 return Vector2D((one.x() + two.x()) / 2.0, (one.y() + two.y()) / 2.0);
108 }
109 }
110
112
117 static Vector2D average(const Vector2D& one, const Vector2D& two, const Vector2D& three)
118 {
119
120 if (one.hasNAN()) {
121 return average(two, three);
122 } else if (two.hasNAN()) {
123 return average(one, three);
124 } else if (three.hasNAN()) {
125 return average(one, two);
126 } else {
127 return Vector2D((one.x() + two.x() + three.x()) / 3.0,
128 (one.y() + two.y() + three.y()) / 3.0);
129 }
130 }
131
133 bool operator==(const Vector2D& rhs) const
134 {
135 return x() == rhs.x() and y() == rhs.y();
136 }
137
139
145 bool operator<(const Vector2D& rhs) const
146 {
147 return normSquared() < rhs.normSquared() or
148 (normSquared() == rhs.normSquared() and (phi() < rhs.phi()));
149 }
150
152
154 {
155 return Vector2D(0.0, 0.0);
156 }
157
159 bool isNull() const
160 {
161 return x() == 0.0 and y() == 0.0;
162 }
163
165 bool hasNAN() const
166 {
167 return std::isnan(x()) or std::isnan(y());
168 }
169
171 std::string __str__() const;
172
174 double dot(const Vector2D& rhs) const
175 {
176 return x() * rhs.x() + y() * rhs.y();
177 }
178
179 double Dot(const Vector2D& rhs) const
180 {
181 return dot(rhs);
182 }
183
185 double cross(const Vector2D& rhs) const
186 {
187 return x() * rhs.y() - y() * rhs.x();
188 }
189
191 double normSquared() const
192 {
193 return x() * x() + y() * y();
194 }
195
196 double Mag2() const
197 {
198 return normSquared();
199 }
200
202 double norm() const
203 {
204 return hypot2(x(), y());
205 }
206
214 double cosWith(const Vector2D& rhs) const
215 {
216 return dot(rhs) / (norm() * rhs.norm());
217 }
218
219 double sinWith(const Vector2D& rhs) const
220 {
221 return cross(rhs) / (norm() * rhs.norm());
222 }
223
224 double angleWith(const Vector2D& rhs) const
225 {
226 return atan2(cross(rhs), dot(rhs));
227 }
228
229
231 double distance(const Vector2D& rhs = Vector2D(0.0, 0.0)) const
232 {
233 double deltaX = x() - rhs.x();
234 double deltaY = y() - rhs.y();
235 return hypot2(deltaX, deltaY);
236 }
237
239 Vector2D& scale(const double factor)
240 {
241 m_x *= factor;
242 m_y *= factor;
243 return *this;
244 }
245
246 Vector2D& operator*=(const double factor)
247 {
248 return scale(factor);
249 }
250
252 Vector2D scaled(const double factor) const
253 {
254 return Vector2D(x() * factor, y() * factor);
255 }
256
258 friend Vector2D operator*(const Vector2D& vec2D, const double factor)
259 {
260 return vec2D.scaled(factor);
261 }
262
264 Vector2D& divide(const double denominator)
265 {
266 m_x /= denominator;
267 m_y /= denominator;
268 return *this;
269 }
270
272 Vector2D& operator/=(const double denominator)
273 {
274 return divide(denominator);
275 }
276
278 Vector2D divided(const double denominator) const
279 {
280 return Vector2D(x() / denominator, y() / denominator);
281 }
282
283 Vector2D operator/(const double denominator) const
284 {
285 return divided(denominator);
286 }
287
289 Vector2D& add(const Vector2D& rhs)
290 {
291 m_x += rhs.x();
292 m_y += rhs.y();
293 return *this;
294 }
295
298 {
299 return add(rhs);
300 }
301
304 {
305 m_x -= rhs.x();
306 m_y -= rhs.y();
307 return *this;
308 }
309
311 {
312 return subtract(rhs);
313 }
314
317 {
318 return Vector2D(-y(), x());
319 }
320
322 Vector2D orthogonal(const ERotation ccwInfo) const
323 {
324 return isValid(ccwInfo) ? Vector2D(-static_cast<double>(ccwInfo) * y(), static_cast<double>(ccwInfo) * x()) : Vector2D();
325 }
326
328
330 double normalize()
331 {
332 double originalLength = norm();
333 if (originalLength != 0.0) divide(originalLength);
334 return originalLength;
335 }
336
338
340 double normalizeTo(const double toLength)
341 {
342 double originalLength = norm();
343 if (originalLength != 0.0) scale(toLength / originalLength);
344 return originalLength;
345 }
346
349 {
350 return isNull() ? Vector2D(0.0, 0.0) : divided(norm());
351 }
352
355 {
356 scale(-1.0);
357 return *this;
358 }
359
362 {
363 return scaled(-1.0);
364 }
365
367 {
368 return reversed();
369 }
370
373 {
374 m_x = -x();
375 }
376
379 {
380 m_y = -y();
381 }
382
386 {
387 return Vector2D(-x(), y());
388 }
389
393 {
394 return Vector2D(x(), -y());
395 }
396
398 Vector2D flippedOver(const Vector2D& reflectionLine) const
399 {
400 return *this - orthogonalVector(reflectionLine) * 2;
401 }
402
404 Vector2D flippedAlong(const Vector2D& flippingDirection) const
405 {
406 return *this - Belle2::VectorUtil::parallelVector(*this, flippingDirection) * 2;
407 }
408
410
413 {
415 }
416
418
421 {
422 return divided(normSquared());
423 }
424
426 Vector2D operator+(const Vector2D& rhs) const
427 {
428 return Vector2D(x() + rhs.x(), y() + rhs.y());
429 }
430
432 Vector2D operator-(const Vector2D& rhs) const
433 {
434 return Vector2D(x() - rhs.x(), y() - rhs.y());
435 }
436
438 Vector2D operator-(const ROOT::Math::XYVector& rhs) const
439 {
440 return Vector2D(x() - rhs.X(), y() - rhs.Y());
441 }
442
444 double parallelComp(const Vector2D& relativTo) const
445 {
446 return relativTo.dot(*this) / relativTo.norm();
447 }
448
450
452 double unnormalizedParallelComp(const Vector2D& relativTo) const
453 {
454 return relativTo.dot(*this);
455 }
456
458
459 double orthogonalComp(const Vector2D& relativTo) const
460 {
461 return relativTo.cross(*this) / relativTo.norm();
462 }
463
465 Vector2D orthogonalVector(const Vector2D& relativTo) const
466 {
467 return relativTo.scaled(relativTo.cross(*this) / relativTo.normSquared()).orthogonal();
468 }
469
471
473 double unnormalizedOrthogonalComp(const Vector2D& relativTo) const
474 {
475 return relativTo.cross(*this);
476 }
477
480 ERightLeft isRightOrLeftOf(const Vector2D& rhs) const
481 {
482 return static_cast<ERightLeft>(-sign(unnormalizedOrthogonalComp(rhs)));
483 }
484
486 bool isLeftOf(const Vector2D& rhs) const
487 {
488 return isRightOrLeftOf(rhs) == ERightLeft::c_Left;
489 }
490
492 bool isRightOf(const Vector2D& rhs) const
493 {
494 return isRightOrLeftOf(rhs) == ERightLeft::c_Right;
495 }
496
499 ERotation isCCWOrCWOf(const Vector2D& rhs) const
500 {
501 return static_cast<ERotation>(sign(unnormalizedOrthogonalComp(rhs)));
502 }
503
506 bool isCCWOf(const Vector2D& rhs) const
507 {
508 return isCCWOrCWOf(rhs) == ERotation::c_CounterClockwise;
509 }
510
513 bool isCWOf(const Vector2D& rhs) const
514 {
515 return isCCWOrCWOf(rhs) == ERotation::c_Clockwise;
516 }
517
520 EForwardBackward isForwardOrBackwardOf(const Vector2D& rhs) const
521 {
522 return static_cast<EForwardBackward>(sign(unnormalizedParallelComp(rhs)));
523 }
524
527 bool isForwardOf(const Vector2D& rhs) const
528 {
529 return isForwardOrBackwardOf(rhs) == EForwardBackward::c_Forward;
530 }
531
534 bool isBackwardOf(const Vector2D& rhs) const
535 {
536 return isForwardOrBackwardOf(rhs) == EForwardBackward::c_Backward;
537 }
538
539 private:
541 static bool sameSign(float n1, float n2, float n3)
542 {
543 return ((n1 > 0 and n2 > 0 and n3 > 0) or (n1 < 0 and n2 < 0 and n3 < 0));
544 }
545
546 public:
552 bool isBetween(const Vector2D& lower, const Vector2D& upper) const
553 {
554 // Set up a linear (nonorthogonal) transformation that maps
555 // lower -> (1, 0)
556 // upper -> (0, 1)
557 // Check whether this transformation is orientation conserving
558 // If yes this vector must lie in the first quadrant to be between lower and upper
559 // If no it must lie in some other quadrant.
560 double det = lower.cross(upper);
561 if (det == 0) {
562 // lower and upper are coaligned
563 return isRightOf(lower) and isLeftOf(upper);
564 } else {
565 bool flipsOrientation = det < 0;
566
567 double transformedX = cross(upper);
568 double transformedY = -cross(lower);
569 bool inFirstQuadrant = sameSign(det, transformedX, transformedY);
570 if (flipsOrientation) {
571 inFirstQuadrant = not inFirstQuadrant;
572 }
573 return inFirstQuadrant;
574 }
575 }
576
579 {
580 std::swap(m_x, m_y);
581 }
582
584 double cylindricalR() const
585 {
586 return hypot2(x(), y());
587 }
588
590 void setCylindricalR(const double cylindricalR)
591 {
593 }
594
596 double phi() const
597 {
598 return isNull() ? NAN : atan2(y(), x());
599 }
600
602 void passiveMoveBy(const Vector2D& by)
603 {
604 subtract(by);
605 }
606
609 {
610 return *this - by;
611 }
612
616 Vector2D passiveRotatedBy(const Vector2D& phiVec) const
617 {
619 }
620
622 double x() const
623 {
624 return m_x;
625 }
626
627 double X() const
628 {
629 return m_x;
630 }
631
632 void setX(const double x)
633 {
634 m_x = x;
635 }
636
637 double y() const
638 {
639 return m_y;
640 }
641
642 double Y() const
643 {
644 return m_y;
645 }
646
647 void setY(const double y)
648 {
649 m_y = y;
650 }
651
653 void setXY(const double x, const double y)
654 {
655 setX(x);
656 setY(y);
657 }
658
659 void setXY(const Vector2D& xy)
660 {
661 m_x = xy.x();
662 m_y = xy.y();
663 }
664
666 double first() const
667 {
668 return m_x;
669 }
670
671 void setFirst(const double first)
672 {
673 m_x = first;
674 }
675
676 double second() const
677 {
678 return m_y;
679 }
680
681 void setSecond(const double second)
682 {
683 m_y = second;
684 }
685
687 void set(const double first, const double second)
688 {
689 setX(first);
690 setY(second);
691 }
692
693 void set(const Vector2D& both)
694 {
695 m_x = both.x();
696 m_y = both.y();
697 }
698
699 private:
701 double m_x = 0.0;
702
704 double m_y = 0.0;
705 };
706
708 template<class Vector>
709 Vector2D operator- (const Vector& a, const Vector2D& b)
710 {
711 return Vector2D(a.X() - b.X(), a.Y() - b.Y());
712 }
713
715 std::ostream& operator<<(std::ostream& output, const Vector2D& vector2D);
716 }
718}
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
Definition Vector2D.h:36
void setSecond(const double second)
Setter for the second coordinate.
Definition Vector2D.h:681
double normalize()
Normalizes the vector to unit length.
Definition Vector2D.h:330
void swapCoordinates()
Swaps the coordinates in place.
Definition Vector2D.h:578
Vector2D & divide(const double denominator)
Divides all coordinates by a common denominator in place.
Definition Vector2D.h:264
double parallelComp(const Vector2D &relativTo) const
Calculates the component parallel to the given vector.
Definition Vector2D.h:444
void flipSecond()
Flips the first coordinate inplace (no difference between active and passive)
Definition Vector2D.h:378
Vector2D operator-(const ROOT::Math::XYVector &rhs) const
Returns a new vector as differenc of this and rhs.
Definition Vector2D.h:438
Vector2D(const Vector2D &coordinateVec, const double parallelCoor, const double orthoCoor)
Constructs a vector from a unit coordinate system vector and the coordinates in that system.
Definition Vector2D.h:71
std::string __str__() const
Output operator for python.
Definition Vector2D.cc:39
Vector2D & operator-=(const Vector2D &rhs)
Same as subtract()
Definition Vector2D.h:310
Vector2D flippedSecond() const
Makes a copy of the vector with the second coordinate flipped (no difference between active and passi...
Definition Vector2D.h:392
double normalizeTo(const double toLength)
Normalizes the vector to the given length.
Definition Vector2D.h:340
Vector2D(const double x, const double y)
Constructor from two coordinates.
Definition Vector2D.h:53
Vector2D & scale(const double factor)
Scales the vector in place by the given factor.
Definition Vector2D.h:239
static Vector2D compose(const Vector2D &coordinateVec, const double parallelCoor, const double orthoCoor)
Constructs a vector from a unit coordinate system vector and the coordinates in that system.
Definition Vector2D.h:90
Vector2D operator-(const Vector2D &rhs) const
Returns a new vector as differenc of this and rhs.
Definition Vector2D.h:432
double dot(const Vector2D &rhs) const
Calculates the two dimensional dot product.
Definition Vector2D.h:174
static Vector2D average(const Vector2D &one, const Vector2D &two)
Constructs the average of two vectors.
Definition Vector2D.h:100
Vector2D reversed() const
Returns a vector pointing in the opposite direction.
Definition Vector2D.h:361
void setXY(const double x, const double y)
Setter for both coordinate.
Definition Vector2D.h:653
static bool sameSign(float n1, float n2, float n3)
Check if three values have the same sign.
Definition Vector2D.h:541
Vector2D & add(const Vector2D &rhs)
Adds a vector to this in place.
Definition Vector2D.h:289
Vector2D scaled(const double factor) const
Returns a scaled copy of the vector.
Definition Vector2D.h:252
void set(const double first, const double second)
Setter for both coordinate.
Definition Vector2D.h:687
double distance(const Vector2D &rhs=Vector2D(0.0, 0.0)) const
Calculates the distance of this point to the rhs.
Definition Vector2D.h:231
double cylindricalR() const
Gives the cylindrical radius of the vector. Same as norm()
Definition Vector2D.h:584
double unnormalizedParallelComp(const Vector2D &relativTo) const
Same as parallelComp() but assumes the given vector to be of unit length.
Definition Vector2D.h:452
double cosWith(const Vector2D &rhs) const
Definition Vector2D.h:214
void flipFirst()
Flips the first coordinate inplace (no difference between active and passive)
Definition Vector2D.h:372
void passiveMoveBy(const Vector2D &by)
Passivelly moves the vector inplace by the given vector.
Definition Vector2D.h:602
Vector2D orthogonalVector(const Vector2D &relativTo) const
Calculates the part of this vector that is parallel to the given vector.
Definition Vector2D.h:465
Vector2D operator-() const
Same as reversed()
Definition Vector2D.h:366
EForwardBackward isForwardOrBackwardOf(const Vector2D &rhs) const
Indicates if the given vector is more coaligned or reverse if you looked in the direction of this vec...
Definition Vector2D.h:520
ERotation isCCWOrCWOf(const Vector2D &rhs) const
Indicates if the given vector is more counterclockwise or more clockwise if you looked in the directi...
Definition Vector2D.h:499
void set(const Vector2D &both)
Setter for both coordinate by an other vector.
Definition Vector2D.h:693
Vector2D flippedFirst() const
Makes a copy of the vector with the first coordinate flipped (no difference between active and passiv...
Definition Vector2D.h:385
friend Vector2D operator*(const Vector2D &vec2D, const double factor)
Same as scaled()
Definition Vector2D.h:258
Vector2D operator+(const Vector2D &rhs) const
Returns a new vector as sum of this and rhs.
Definition Vector2D.h:426
double cross(const Vector2D &rhs) const
Calculated the two dimensional cross product.
Definition Vector2D.h:185
Vector2D & operator*=(const double factor)
Same as scale()
Definition Vector2D.h:246
Vector2D & reverse()
Reverses the direction of the vector in place.
Definition Vector2D.h:354
double m_x
Memory for the first coordinate.
Definition Vector2D.h:701
Vector2D orthogonal(const ERotation ccwInfo) const
Orthogonal vector to the direction given by the counterclockwise info.
Definition Vector2D.h:322
double Dot(const Vector2D &rhs) const
Calculates the two dimensional dot product.
Definition Vector2D.h:179
ERightLeft isRightOrLeftOf(const Vector2D &rhs) const
Indicates if the given vector is more left or more right if you looked in the direction of this vecto...
Definition Vector2D.h:480
Vector2D operator/(const double denominator) const
Same as divided()
Definition Vector2D.h:283
double x() const
Getter for the x coordinate.
Definition Vector2D.h:622
double sinWith(const Vector2D &rhs) const
Sine of the angle between this and rhs.
Definition Vector2D.h:219
Vector2D & subtract(const Vector2D &rhs)
Subtracts a vector from this in place.
Definition Vector2D.h:303
Vector2D conformalTransformed() const
Returns a copy of the vector transformed in conformal space.
Definition Vector2D.h:420
Vector2D & operator/=(const double denominator)
Same as divide()
Definition Vector2D.h:272
bool isRightOf(const Vector2D &rhs) const
Indicates if the given vector is more right if you looked in the direction of this vector.
Definition Vector2D.h:492
void conformalTransform()
Transforms the vector to conformal space inplace.
Definition Vector2D.h:412
bool isCCWOf(const Vector2D &rhs) const
Indicates if the given vector is more counterclockwise if you looked in the direction of this vector.
Definition Vector2D.h:506
double orthogonalComp(const Vector2D &relativTo) const
Calculates the component orthogonal to the given vector.
Definition Vector2D.h:459
void setCylindricalR(const double cylindricalR)
Set the cylindrical radius while keeping the azimuth angle phi the same.
Definition Vector2D.h:590
Vector2D & operator+=(const Vector2D &rhs)
Same as add()
Definition Vector2D.h:297
Vector2D()=default
Default constructor for ROOT compatibility.
static Vector2D average(const Vector2D &one, const Vector2D &two, const Vector2D &three)
Constructs the average of three vectors.
Definition Vector2D.h:117
bool isBetween(const Vector2D &lower, const Vector2D &upper) const
Checks if this vector is between two other vectors Between means here that when rotating the lower ve...
Definition Vector2D.h:552
double phi() const
Gives the azimuth angle being the angle to the x axes ( range -M_PI to M_PI )
Definition Vector2D.h:596
bool operator==(const Vector2D &rhs) const
Equality comparison with both coordinates.
Definition Vector2D.h:133
static Vector2D getLowest()
Getter for the lowest possible vector.
Definition Vector2D.h:153
double second() const
Getter for the second coordinate.
Definition Vector2D.h:676
double Mag2() const
Alias for normSquared.
Definition Vector2D.h:196
void setXY(const Vector2D &xy)
Setter for both coordinate by an other vector.
Definition Vector2D.h:659
double normSquared() const
Calculates .
Definition Vector2D.h:191
bool isNull() const
Checks if the vector is the null vector.
Definition Vector2D.h:159
Vector2D orthogonal() const
Orthogonal vector to the counterclockwise direction.
Definition Vector2D.h:316
bool hasNAN() const
Checks if one of the coordinates is NAN.
Definition Vector2D.h:165
Vector2D divided(const double denominator) const
Returns a copy where all coordinates got divided by a common denominator.
Definition Vector2D.h:278
void setY(const double y)
Setter for the y coordinate.
Definition Vector2D.h:647
double y() const
Getter for the y coordinate.
Definition Vector2D.h:637
double first() const
Getter for the first coordinate.
Definition Vector2D.h:666
Vector2D flippedOver(const Vector2D &reflectionLine) const
Reflects this vector over line designated by the given vector.
Definition Vector2D.h:398
Vector2D flippedAlong(const Vector2D &flippingDirection) const
Reflects this vector along line designated by the given vector.
Definition Vector2D.h:404
Vector2D unit() const
Returns a unit vector colaligned with this.
Definition Vector2D.h:348
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
Definition Vector2D.h:224
double norm() const
Calculates the length of the vector.
Definition Vector2D.h:202
Vector2D passiveRotatedBy(const Vector2D &phiVec) const
Returns a transformed vector version rotated by the given vector.
Definition Vector2D.h:616
double m_y
Memory for the second coordinate.
Definition Vector2D.h:704
Vector2D & operator=(const ROOT::Math::XYVector &xyVector)
Assignment translating from a ROOT::Math::XYVector instance.
Definition Vector2D.cc:21
bool isLeftOf(const Vector2D &rhs) const
Indicates if the given vector is more left if you looked in the direction of this vector.
Definition Vector2D.h:486
void setFirst(const double first)
Setter for the first coordinate.
Definition Vector2D.h:671
bool isForwardOf(const Vector2D &rhs) const
Indicates if the given vector is more coaligned if you looked in the direction of this vector.
Definition Vector2D.h:527
void setX(const double x)
Setter for the x coordinate.
Definition Vector2D.h:632
double X() const
Getter for the x coordinate.
Definition Vector2D.h:627
bool isCWOf(const Vector2D &rhs) const
Indicates if the given vector is more clockwise if you looked in the direction of this vector.
Definition Vector2D.h:513
bool isBackwardOf(const Vector2D &rhs) const
Indicates if the given vector is more Reverse if you looked in the direction of this vector.
Definition Vector2D.h:534
double unnormalizedOrthogonalComp(const Vector2D &relativTo) const
Same as orthogonalComp() but assumes the given vector to be of unit length.
Definition Vector2D.h:473
bool operator<(const Vector2D &rhs) const
Total ordering based on cylindrical radius first and azimuth angle second.
Definition Vector2D.h:145
static Vector2D Phi(const double phi)
Constructs a unit vector with azimuth angle equal to phi.
Definition Vector2D.h:78
Vector2D passiveMovedBy(const Vector2D &by) const
Returns a transformed vector passivelly moved by the given vector.
Definition Vector2D.h:608
double Y() const
Getter for the y coordinate.
Definition Vector2D.h:642
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Abstract base class for different kinds of events.