Belle II Software development
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:
41 : m_x(0.0)
42 , m_y(0.0)
43 {
44 }
45
46 // /// Constructor translating from a ROOT::Math::XYVector instance
47 // TODO / FIXME:
48 // had to comment this explicit constructor because of compilation issues that I did not
49 // fully understand nor really wanted to investigate and solve - just using the non-explicit
50 // version solved all the issues, but for the future I think it would be better to solve this
51 // issue and use the explicit constructor
52 // explicit Vector2D(const ROOT::Math::XYVector& xyVector)
54 Vector2D(const ROOT::Math::XYVector& xyVector);
55
57 Vector2D(const double x, const double y)
58 : m_x(x)
59 , m_y(y)
60 {
61 }
62
64 Vector2D& operator=(const ROOT::Math::XYVector& xyVector);
65
67 operator const ROOT::Math::XYVector() const;
68
75 Vector2D(const Vector2D& coordinateVec, const double parallelCoor, const double orthoCoor)
76 : m_x(coordinateVec.x() * parallelCoor - coordinateVec.y() * orthoCoor)
77 , m_y(coordinateVec.y() * parallelCoor + coordinateVec.x() * orthoCoor)
78 {
79 }
80
82 static Vector2D Phi(const double phi)
83 {
84 return std::isnan(phi) ? Vector2D(0.0, 0.0) : Vector2D(cos(phi), sin(phi));
85 }
86
89
93 static Vector2D
94 compose(const Vector2D& coordinateVec, const double parallelCoor, const double orthoCoor)
95 {
96 return Vector2D(coordinateVec, parallelCoor, orthoCoor);
97 }
98
100
104 static Vector2D average(const Vector2D& one, const Vector2D& two)
105 {
106 if (one.hasNAN()) {
107 return two;
108 } else if (two.hasNAN()) {
109 return one;
110 } else {
111 return Vector2D((one.x() + two.x()) / 2.0, (one.y() + two.y()) / 2.0);
112 }
113 }
114
116
121 static Vector2D average(const Vector2D& one, const Vector2D& two, const Vector2D& three)
122 {
123
124 if (one.hasNAN()) {
125 return average(two, three);
126 } else if (two.hasNAN()) {
127 return average(one, three);
128 } else if (three.hasNAN()) {
129 return average(one, two);
130 } else {
131 return Vector2D((one.x() + two.x() + three.x()) / 3.0,
132 (one.y() + two.y() + three.y()) / 3.0);
133 }
134 }
135
137 bool operator==(const Vector2D& rhs) const
138 {
139 return x() == rhs.x() and y() == rhs.y();
140 }
141
143
149 bool operator<(const Vector2D& rhs) const
150 {
151 return normSquared() < rhs.normSquared() or
152 (normSquared() == rhs.normSquared() and (phi() < rhs.phi()));
153 }
154
156
158 {
159 return Vector2D(0.0, 0.0);
160 }
161
163 bool isNull() const
164 {
165 return x() == 0.0 and y() == 0.0;
166 }
167
169 bool hasNAN() const
170 {
171 return std::isnan(x()) or std::isnan(y());
172 }
173
175 std::string __str__() const;
176
178 double dot(const Vector2D& rhs) const
179 {
180 return x() * rhs.x() + y() * rhs.y();
181 }
182
183 double Dot(const Vector2D& rhs) const
184 {
185 return dot(rhs);
186 }
187
189 double cross(const Vector2D& rhs) const
190 {
191 return x() * rhs.y() - y() * rhs.x();
192 }
193
195 double normSquared() const
196 {
197 return x() * x() + y() * y();
198 }
199
200 double Mag2() const
201 {
202 return normSquared();
203 }
204
206 double norm() const
207 {
208 return hypot2(x(), y());
209 }
210
218 double cosWith(const Vector2D& rhs) const
219 {
220 return dot(rhs) / (norm() * rhs.norm());
221 }
222
223 double sinWith(const Vector2D& rhs) const
224 {
225 return cross(rhs) / (norm() * rhs.norm());
226 }
227
228 double angleWith(const Vector2D& rhs) const
229 {
230 return atan2(cross(rhs), dot(rhs));
231 }
232
233
235 double distance(const Vector2D& rhs = Vector2D(0.0, 0.0)) const
236 {
237 double deltaX = x() - rhs.x();
238 double deltaY = y() - rhs.y();
239 return hypot2(deltaX, deltaY);
240 }
241
243 Vector2D& scale(const double factor)
244 {
245 m_x *= factor;
246 m_y *= factor;
247 return *this;
248 }
249
250 Vector2D& operator*=(const double factor)
251 {
252 return scale(factor);
253 }
254
256 Vector2D scaled(const double factor) const
257 {
258 return Vector2D(x() * factor, y() * factor);
259 }
260
262 friend Vector2D operator*(const Vector2D& vec2D, const double factor)
263 {
264 return vec2D.scaled(factor);
265 }
266
268 Vector2D& divide(const double denominator)
269 {
270 m_x /= denominator;
271 m_y /= denominator;
272 return *this;
273 }
274
276 Vector2D& operator/=(const double denominator)
277 {
278 return divide(denominator);
279 }
280
282 Vector2D divided(const double denominator) const
283 {
284 return Vector2D(x() / denominator, y() / denominator);
285 }
286
287 Vector2D operator/(const double denominator) const
288 {
289 return divided(denominator);
290 }
291
293 Vector2D& add(const Vector2D& rhs)
294 {
295 m_x += rhs.x();
296 m_y += rhs.y();
297 return *this;
298 }
299
302 {
303 return add(rhs);
304 }
305
308 {
309 m_x -= rhs.x();
310 m_y -= rhs.y();
311 return *this;
312 }
313
315 {
316 return subtract(rhs);
317 }
318
321 {
322 return Vector2D(-y(), x());
323 }
324
326 Vector2D orthogonal(const ERotation ccwInfo) const
327 {
328 return isValid(ccwInfo) ? Vector2D(-static_cast<double>(ccwInfo) * y(), static_cast<double>(ccwInfo) * x()) : Vector2D();
329 }
330
332
334 double normalize()
335 {
336 double originalLength = norm();
337 if (originalLength != 0.0) divide(originalLength);
338 return originalLength;
339 }
340
342
344 double normalizeTo(const double toLength)
345 {
346 double originalLength = norm();
347 if (originalLength != 0.0) scale(toLength / originalLength);
348 return originalLength;
349 }
350
353 {
354 return isNull() ? Vector2D(0.0, 0.0) : divided(norm());
355 }
356
359 {
360 scale(-1.0);
361 return *this;
362 }
363
366 {
367 return scaled(-1.0);
368 }
369
371 {
372 return reversed();
373 }
374
377 {
378 m_x = -x();
379 }
380
383 {
384 m_y = -y();
385 }
386
390 {
391 return Vector2D(-x(), y());
392 }
393
397 {
398 return Vector2D(x(), -y());
399 }
400
402 Vector2D flippedOver(const Vector2D& reflectionLine) const
403 {
404 return *this - orthogonalVector(reflectionLine) * 2;
405 }
406
408 Vector2D flippedAlong(const Vector2D& flippingDirection) const
409 {
410 return *this - Belle2::VectorUtil::parallelVector(*this, flippingDirection) * 2;
411 }
412
414
417 {
419 }
420
422
425 {
426 return divided(normSquared());
427 }
428
430 Vector2D operator+(const Vector2D& rhs) const
431 {
432 return Vector2D(x() + rhs.x(), y() + rhs.y());
433 }
434
436 Vector2D operator-(const Vector2D& rhs) const
437 {
438 return Vector2D(x() - rhs.x(), y() - rhs.y());
439 }
440
442 Vector2D operator-(const ROOT::Math::XYVector& rhs) const
443 {
444 return Vector2D(x() - rhs.X(), y() - rhs.Y());
445 }
446
448 double parallelComp(const Vector2D& relativTo) const
449 {
450 return relativTo.dot(*this) / relativTo.norm();
451 }
452
454
456 double unnormalizedParallelComp(const Vector2D& relativTo) const
457 {
458 return relativTo.dot(*this);
459 }
460
462
463 double orthogonalComp(const Vector2D& relativTo) const
464 {
465 return relativTo.cross(*this) / relativTo.norm();
466 }
467
469 Vector2D orthogonalVector(const Vector2D& relativTo) const
470 {
471 return relativTo.scaled(relativTo.cross(*this) / relativTo.normSquared()).orthogonal();
472 }
473
475
477 double unnormalizedOrthogonalComp(const Vector2D& relativTo) const
478 {
479 return relativTo.cross(*this);
480 }
481
484 ERightLeft isRightOrLeftOf(const Vector2D& rhs) const
485 {
486 return static_cast<ERightLeft>(-sign(unnormalizedOrthogonalComp(rhs)));
487 }
488
490 bool isLeftOf(const Vector2D& rhs) const
491 {
492 return isRightOrLeftOf(rhs) == ERightLeft::c_Left;
493 }
494
496 bool isRightOf(const Vector2D& rhs) const
497 {
498 return isRightOrLeftOf(rhs) == ERightLeft::c_Right;
499 }
500
503 ERotation isCCWOrCWOf(const Vector2D& rhs) const
504 {
505 return static_cast<ERotation>(sign(unnormalizedOrthogonalComp(rhs)));
506 }
507
510 bool isCCWOf(const Vector2D& rhs) const
511 {
512 return isCCWOrCWOf(rhs) == ERotation::c_CounterClockwise;
513 }
514
517 bool isCWOf(const Vector2D& rhs) const
518 {
519 return isCCWOrCWOf(rhs) == ERotation::c_Clockwise;
520 }
521
524 EForwardBackward isForwardOrBackwardOf(const Vector2D& rhs) const
525 {
526 return static_cast<EForwardBackward>(sign(unnormalizedParallelComp(rhs)));
527 }
528
531 bool isForwardOf(const Vector2D& rhs) const
532 {
533 return isForwardOrBackwardOf(rhs) == EForwardBackward::c_Forward;
534 }
535
538 bool isBackwardOf(const Vector2D& rhs) const
539 {
540 return isForwardOrBackwardOf(rhs) == EForwardBackward::c_Backward;
541 }
542
543 private:
545 static bool sameSign(float n1, float n2, float n3)
546 {
547 return ((n1 > 0 and n2 > 0 and n3 > 0) or (n1 < 0 and n2 < 0 and n3 < 0));
548 }
549
550 public:
556 bool isBetween(const Vector2D& lower, const Vector2D& upper) const
557 {
558 // Set up a linear (nonorthogonal) transformation that maps
559 // lower -> (1, 0)
560 // upper -> (0, 1)
561 // Check whether this transformation is orientation conserving
562 // If yes this vector must lie in the first quadrant to be between lower and upper
563 // If no it must lie in some other quadrant.
564 double det = lower.cross(upper);
565 if (det == 0) {
566 // lower and upper are coaligned
567 return isRightOf(lower) and isLeftOf(upper);
568 } else {
569 bool flipsOrientation = det < 0;
570
571 double transformedX = cross(upper);
572 double transformedY = -cross(lower);
573 bool inFirstQuadrant = sameSign(det, transformedX, transformedY);
574 if (flipsOrientation) {
575 inFirstQuadrant = not inFirstQuadrant;
576 }
577 return inFirstQuadrant;
578 }
579 }
580
583 {
584 std::swap(m_x, m_y);
585 }
586
588 double cylindricalR() const
589 {
590 return hypot2(x(), y());
591 }
592
594 void setCylindricalR(const double cylindricalR)
595 {
597 }
598
600 double phi() const
601 {
602 return isNull() ? NAN : atan2(y(), x());
603 }
604
606 void passiveMoveBy(const Vector2D& by)
607 {
608 subtract(by);
609 }
610
613 {
614 return *this - by;
615 }
616
620 Vector2D passiveRotatedBy(const Vector2D& phiVec) const
621 {
623 }
624
626 double x() const
627 {
628 return m_x;
629 }
630
631 double X() const
632 {
633 return m_x;
634 }
635
636 void setX(const double x)
637 {
638 m_x = x;
639 }
640
641 double y() const
642 {
643 return m_y;
644 }
645
646 double Y() const
647 {
648 return m_y;
649 }
650
651 void setY(const double y)
652 {
653 m_y = y;
654 }
655
657 void setXY(const double x, const double y)
658 {
659 setX(x);
660 setY(y);
661 }
662
663 void setXY(const Vector2D& xy)
664 {
665 m_x = xy.x();
666 m_y = xy.y();
667 }
668
670 double first() const
671 {
672 return m_x;
673 }
674
675 void setFirst(const double first)
676 {
677 m_x = first;
678 }
679
680 double second() const
681 {
682 return m_y;
683 }
684
685 void setSecond(const double second)
686 {
687 m_y = second;
688 }
689
691 void set(const double first, const double second)
692 {
693 setX(first);
694 setY(second);
695 }
696
697 void set(const Vector2D& both)
698 {
699 m_x = both.x();
700 m_y = both.y();
701 }
702
703 private:
705 double m_x;
706
708 double m_y;
709 };
710
712 template<class Vector>
713 Vector2D operator- (const Vector& a, const Vector2D& b)
714 {
715 return Vector2D(a.X() - b.X(), a.Y() - b.Y());
716 }
717
719 std::ostream& operator<<(std::ostream& output, const Vector2D& vector2D);
720 }
722}
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:685
double normalize()
Normalizes the vector to unit length.
Definition Vector2D.h:334
void swapCoordinates()
Swaps the coordinates in place.
Definition Vector2D.h:582
Vector2D & divide(const double denominator)
Divides all coordinates by a common denominator in place.
Definition Vector2D.h:268
double parallelComp(const Vector2D &relativTo) const
Calculates the component parallel to the given vector.
Definition Vector2D.h:448
void flipSecond()
Flips the first coordinate inplace (no difference between active and passive)
Definition Vector2D.h:382
Vector2D operator-(const ROOT::Math::XYVector &rhs) const
Returns a new vector as differenc of this and rhs.
Definition Vector2D.h:442
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:75
std::string __str__() const
Output operator for python.
Definition Vector2D.cc:39
Vector2D & operator-=(const Vector2D &rhs)
Same as subtract()
Definition Vector2D.h:314
Vector2D flippedSecond() const
Makes a copy of the vector with the second coordinate flipped (no difference between active and passi...
Definition Vector2D.h:396
double normalizeTo(const double toLength)
Normalizes the vector to the given length.
Definition Vector2D.h:344
Vector2D(const double x, const double y)
Constructor from two coordinates.
Definition Vector2D.h:57
Vector2D & scale(const double factor)
Scales the vector in place by the given factor.
Definition Vector2D.h:243
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:94
Vector2D operator-(const Vector2D &rhs) const
Returns a new vector as differenc of this and rhs.
Definition Vector2D.h:436
double dot(const Vector2D &rhs) const
Calculates the two dimensional dot product.
Definition Vector2D.h:178
static Vector2D average(const Vector2D &one, const Vector2D &two)
Constructs the average of two vectors.
Definition Vector2D.h:104
Vector2D reversed() const
Returns a vector pointing in the opposite direction.
Definition Vector2D.h:365
void setXY(const double x, const double y)
Setter for both coordinate.
Definition Vector2D.h:657
static bool sameSign(float n1, float n2, float n3)
Check if three values have the same sign.
Definition Vector2D.h:545
Vector2D & add(const Vector2D &rhs)
Adds a vector to this in place.
Definition Vector2D.h:293
Vector2D scaled(const double factor) const
Returns a scaled copy of the vector.
Definition Vector2D.h:256
void set(const double first, const double second)
Setter for both coordinate.
Definition Vector2D.h:691
double distance(const Vector2D &rhs=Vector2D(0.0, 0.0)) const
Calculates the distance of this point to the rhs.
Definition Vector2D.h:235
double cylindricalR() const
Gives the cylindrical radius of the vector. Same as norm()
Definition Vector2D.h:588
double unnormalizedParallelComp(const Vector2D &relativTo) const
Same as parallelComp() but assumes the given vector to be of unit length.
Definition Vector2D.h:456
double cosWith(const Vector2D &rhs) const
Definition Vector2D.h:218
void flipFirst()
Flips the first coordinate inplace (no difference between active and passive)
Definition Vector2D.h:376
void passiveMoveBy(const Vector2D &by)
Passivelly moves the vector inplace by the given vector.
Definition Vector2D.h:606
Vector2D orthogonalVector(const Vector2D &relativTo) const
Calculates the part of this vector that is parallel to the given vector.
Definition Vector2D.h:469
Vector2D operator-() const
Same as reversed()
Definition Vector2D.h:370
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:524
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:503
void set(const Vector2D &both)
Setter for both coordinate by an other vector.
Definition Vector2D.h:697
Vector2D flippedFirst() const
Makes a copy of the vector with the first coordinate flipped (no difference between active and passiv...
Definition Vector2D.h:389
friend Vector2D operator*(const Vector2D &vec2D, const double factor)
Same as scaled()
Definition Vector2D.h:262
Vector2D operator+(const Vector2D &rhs) const
Returns a new vector as sum of this and rhs.
Definition Vector2D.h:430
double cross(const Vector2D &rhs) const
Calculated the two dimensional cross product.
Definition Vector2D.h:189
Vector2D & operator*=(const double factor)
Same as scale()
Definition Vector2D.h:250
Vector2D & reverse()
Reverses the direction of the vector in place.
Definition Vector2D.h:358
double m_x
Memory for the first coordinate.
Definition Vector2D.h:705
Vector2D orthogonal(const ERotation ccwInfo) const
Orthogonal vector to the direction given by the counterclockwise info.
Definition Vector2D.h:326
Vector2D()
Default constructor for ROOT compatibility.
Definition Vector2D.h:40
double Dot(const Vector2D &rhs) const
Calculates the two dimensional dot product.
Definition Vector2D.h:183
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:484
Vector2D operator/(const double denominator) const
Same as divided()
Definition Vector2D.h:287
double x() const
Getter for the x coordinate.
Definition Vector2D.h:626
double sinWith(const Vector2D &rhs) const
Sine of the angle between this and rhs.
Definition Vector2D.h:223
Vector2D & subtract(const Vector2D &rhs)
Subtracts a vector from this in place.
Definition Vector2D.h:307
Vector2D conformalTransformed() const
Returns a copy of the vector transformed in conformal space.
Definition Vector2D.h:424
Vector2D & operator/=(const double denominator)
Same as divide()
Definition Vector2D.h:276
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:496
void conformalTransform()
Transforms the vector to conformal space inplace.
Definition Vector2D.h:416
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:510
double orthogonalComp(const Vector2D &relativTo) const
Calculates the component orthogonal to the given vector.
Definition Vector2D.h:463
void setCylindricalR(const double cylindricalR)
Set the cylindrical radius while keeping the azimuth angle phi the same.
Definition Vector2D.h:594
Vector2D & operator+=(const Vector2D &rhs)
Same as add()
Definition Vector2D.h:301
static Vector2D average(const Vector2D &one, const Vector2D &two, const Vector2D &three)
Constructs the average of three vectors.
Definition Vector2D.h:121
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:556
double phi() const
Gives the azimuth angle being the angle to the x axes ( range -M_PI to M_PI )
Definition Vector2D.h:600
bool operator==(const Vector2D &rhs) const
Equality comparison with both coordinates.
Definition Vector2D.h:137
static Vector2D getLowest()
Getter for the lowest possible vector.
Definition Vector2D.h:157
double second() const
Getter for the second coordinate.
Definition Vector2D.h:680
double Mag2() const
Alias for normSquared.
Definition Vector2D.h:200
void setXY(const Vector2D &xy)
Setter for both coordinate by an other vector.
Definition Vector2D.h:663
double normSquared() const
Calculates .
Definition Vector2D.h:195
bool isNull() const
Checks if the vector is the null vector.
Definition Vector2D.h:163
Vector2D orthogonal() const
Orthogonal vector to the counterclockwise direction.
Definition Vector2D.h:320
bool hasNAN() const
Checks if one of the coordinates is NAN.
Definition Vector2D.h:169
Vector2D divided(const double denominator) const
Returns a copy where all coordinates got divided by a common denominator.
Definition Vector2D.h:282
void setY(const double y)
Setter for the y coordinate.
Definition Vector2D.h:651
double y() const
Getter for the y coordinate.
Definition Vector2D.h:641
double first() const
Getter for the first coordinate.
Definition Vector2D.h:670
Vector2D flippedOver(const Vector2D &reflectionLine) const
Reflects this vector over line designated by the given vector.
Definition Vector2D.h:402
Vector2D flippedAlong(const Vector2D &flippingDirection) const
Reflects this vector along line designated by the given vector.
Definition Vector2D.h:408
Vector2D unit() const
Returns a unit vector colaligned with this.
Definition Vector2D.h:352
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
Definition Vector2D.h:228
double norm() const
Calculates the length of the vector.
Definition Vector2D.h:206
Vector2D passiveRotatedBy(const Vector2D &phiVec) const
Returns a transformed vector version rotated by the given vector.
Definition Vector2D.h:620
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
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:490
void setFirst(const double first)
Setter for the first coordinate.
Definition Vector2D.h:675
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:531
void setX(const double x)
Setter for the x coordinate.
Definition Vector2D.h:636
double X() const
Getter for the x coordinate.
Definition Vector2D.h:631
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:517
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:538
double unnormalizedOrthogonalComp(const Vector2D &relativTo) const
Same as orthogonalComp() but assumes the given vector to be of unit length.
Definition Vector2D.h:477
bool operator<(const Vector2D &rhs) const
Total ordering based on cylindrical radius first and azimuth angle second.
Definition Vector2D.h:149
static Vector2D Phi(const double phi)
Constructs a unit vector with azimuth angle equal to phi.
Definition Vector2D.h:82
Vector2D passiveMovedBy(const Vector2D &by) const
Returns a transformed vector passivelly moved by the given vector.
Definition Vector2D.h:612
double Y() const
Getter for the y coordinate.
Definition Vector2D.h:646
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Abstract base class for different kinds of events.