Vector3.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include "TVector3.h"
4 #include "boca/math/Vector2.hh"
5 
6 namespace boca
7 {
8 
13 enum class Dim3
14 {
15  x,
16  y,
17  z,
18  last
19 };
20 
21 std::string Name(Dim3 dim_3);
22 
23 Dim3 Third(Dim3 dim_1, Dim3 dim_2);
24 
25 Dim3 Next(Dim3 dim);
26 
27 std::vector<Dim3> Dimensions3();
28 
29 template<class Value_>
30 class Matrix3;
31 
36 template<class Value_>
37 class Vector3 : boost::totally_ordered<Vector3<Value_>>
38  , boost::additive<Vector3<Value_>>
39 {
40 
41  template<typename Value_2_>
43 
45 
46  template<typename Value_2_, typename Value_3>
48 
49  template<typename Value_2_>
51 
52  using ValueInverse = boost::units::divide_typeof_helper<double, Value_>;
53 
54  template<typename Value_2_>
55  using OnlyIfNotOrSameQuantity = typename std::enable_if < !IsQuantity<Value_2_>::value || std::is_same<Value_, Value_2_>::value >::type;
56 
57 public:
58 
67  constexpr Vector3() :
68  trans_(),
69  z_(0)
70  {}
71 
75  constexpr Vector3(Value_ x, Value_ y, Value_ z) :
76  trans_(x, y),
77  z_(z)
78  {};
79 
83  Vector3(Value_ value, Dim3 dim_3) :
84  z_(dim_3 == Dim3::z ? value : Value_(0))
85  {
86  trans_.X() = dim_3 == Dim3::x ? value : Value_(0);
87  trans_.Y() = dim_3 == Dim3::y ? value : Value_(0);
88  }
89 
93  constexpr Vector3(Vector2<Value_> const &transversal, Value_ z) :
94  trans_(transversal),
95  z_(z)
96  {}
97 
101  template<typename Value_2_>
102  constexpr Vector3(Vector3<Value_2_> const &vector) :
103  trans_(vector.Transversal()),
104  z_(vector.Z())
105  {}
106 
110  constexpr Vector3(TVector3 const &vector) :
111  trans_(vector.XYvector()),
112  z_(vector.Z())
113  {}
115 
124  void SetUniform(Value_ value)
125  {
126  Transversal().SetUniform(value);
127  Z() = value;
128  }
129 
133  void SetMag(Value_ magnitude)
134  {
135  auto const old = Mag();
136  *this *= old == Value_(0) ? 0. : magnitude / old;
137  }
138 
142  void SetPerp(Value_ perp)
143  {
144  Transversal().SetMag(perp);
145  }
146 
150  void SetPhi(boca::Angle const &phi)
151  {
152  Transversal().SetPhi(phi);
153  }
154 
158  void SetMagThetaPhi(Value_ mag, boca::Angle const &theta, boca::Angle const &phi)
159  {
160  Transversal().SetMagPhi(mag * boost::units::sin(theta), phi);
161  Z() = mag * boost::units::cos(theta);
162  }
163 
167  void SetTheta(boca::Angle const &theta)
168  {
169  SetMagThetaPhi(Mag(), theta, Phi());
170  }
171 
175  void SetPerpThetaPhi(Value_ perp, boca::Angle const &theta, boca::Angle const &phi)
176  {
177  Transversal().SetMagPhi(perp, phi);
178  auto const tan_theta = tan(theta);
179  Z() = tan_theta == 0. ? abs(perp) / tan_theta : Value_(0);
180  }
181 
185  void SetPerpEtaPhi(Value_ const &perp, boca::Angle const &eta, boca::Angle const &phi)
186  {
187  Transversal().SetMagPhi(perp, phi);
188  Z() = abs(perp) * units::sinh(eta);
189  }
191 
200  constexpr Value_ const& X() const
201  {
202  return trans_.X();
203  }
204 
208  constexpr Value_ const& Y() const
209  {
210  return trans_.Y();
211  }
212 
216  constexpr Value_ const& Z() const
217  {
218  return z_;
219  }
220 
224  constexpr Vector2<Value_> Transversal() const
225  {
226  return trans_;
227  }
228 
232  Value_ &X()
233  {
234  return trans_.X();
235  }
236 
240  Value_ &Y()
241  {
242  return trans_.Y();
243  }
244 
248  Value_ &Z()
249  {
250  return z_;
251  }
252 
257  {
258  return trans_;
259  }
261 
270  boca::Angle Phi() const
271  {
272  return Transversal().Phi();
273  }
274 
279  {
280  auto const perp = Perp();
281  return perp == Value_(0) && Z() == Value_(0) ? 0_rad : atan2(perp, Z());
282  }
283 
287  double CosTheta() const
288  {
289  auto const mag = Mag();
290  return mag == Value_(0) ? 1 : Z() / mag;
291  }
292 
296  double SinTheta2() const
297  {
298  auto const mag2 = Mag2();
299  return mag2 == ValueSquare(0) ? 0. : static_cast<double>(Perp2() / mag2);
300  }
301 
305  double SinTheta() const
306  {
307  auto const mag = Mag();
308  return mag == Value_(0) ? 0 : Perp() / mag;
309  }
310 
314  template <typename Value_2_>
316  {
317  return Restrict(Phi() - vector.Phi());
318  }
319 
323  template <typename Value_2_>
325  {
326  return Eta() - vector.Eta();
327  }
328 
332  template <typename Value_2_>
334  {
335  return sqrt(sqr(DeltaEtaTo(vector)) + sqr(DeltaPhiTo(vector)));
336  }
337 
341  boca::Angle Angle(Vector3 const &vector) const
342  {
343  return atan2(Cross(vector), Dot(vector));
344  }
345 
351  double Tan2(Vector3 const &vector)
352  {
353  return sqr(Cross(vector)) / sqr(Dot(vector));
354  }
355 
361  {
362  auto const cos_theta = CosTheta();
363  if (sqr(cos_theta) < 1) return -0.5 * units::log((1 - cos_theta) / (1 + cos_theta));
364  if (Z() == Value_(0)) return 0_rad;
365  if (Z() > 0) return 10e10_rad;
366  else return -10e10_rad;
367  }
368 
369  boca::Angle Eta() const
370  {
371  return PseudoRapidity();
372  }
374 
376 
385  constexpr ValueSquare Mag2() const
386  {
387  return Perp2() + sqr(Z());
388  }
389 
393  constexpr Value_ Mag() const
394  {
395  return sqrt(Mag2());
396  }
397 
401  constexpr ValueSquare Perp2() const
402  {
403  return Transversal().Mag2();
404  }
405 
409  constexpr Value_ Perp() const
410  {
411  return Transversal().Mag();
412  }
413 
417  template <typename Value_2_>
418  constexpr ValueSquare Perp2(Vector3<Value_2_> const &vector) const
419  {
420  auto const other_mag2 = vector.Mag2();
421  auto this_mag_2 = Mag2();
422  if (other_mag2 > boca::ValueSquare<Value_2_>(0)) this_mag_2 -= sqr(Dot(vector)) / other_mag2;
423  if (this_mag_2 < ValueSquare(0)) this_mag_2 = ValueSquare(0);
424  return this_mag_2;
425  }
426 
430  template <typename Value_2_>
431  constexpr Value_ Perp(Vector3<Value_2_> const &vector) const
432  {
433  return sqrt(Perp2(vector));
434  }
436 
445  Vector3 &Rotate(boca::Angle const &phi, Dim3 dim_1, Dim3 dim_2)
446  {
447  if (phi == 0_rad) return *this;
448  auto const cos = boost::units::cos(phi);
449  auto const sin = boost::units::sin(phi);
450  auto const row = (*this)(dim_1);
451  (*this)(dim_1) = cos * row - sin * (*this)(dim_2);
452  (*this)(dim_2) = sin * row + cos * (*this)(dim_2);
453  return *this;
454 // Vector2<Value_>((*this)(dim_1),(*this)(dim_2)).Rotate(phi);
455  }
456 
460  Vector3 &Rotate(boca::Angle const &phi, Dim3 dim)
461  {
462  switch (dim) {
463  case Dim3::x :
464  return Rotate(phi, Dim3::y, Dim3::z);
465  case Dim3::y :
466  return Rotate(phi, Dim3::z, Dim3::x);
467  case Dim3::z :
468  return Rotate(phi, Dim3::x, Dim3::y);
469  default :
470  ;
471  }
472  }
473 
477  template<typename Value_2_>
478  auto &Rotate(boca::Angle angle, Vector3<Value_2_> const &axis);
479 
483  template<typename Value_2_>
484  auto &Transform(Matrix3<Value_2_> const &matrix);
485 
489  template<typename Value_2_>
490  constexpr void RotateUz(Vector3<Value_2_> const &vector)
491  {
492  auto const unit = vector.Unit();
493  auto const perp2 = unit.Perp();
494  if (perp2 > 0) {
495  auto const perp = sqrt(perp2);
496  auto temp = unit * (unit.Z() * X() + perp * Z());
497  temp.X() -= unit.Y() * Y();
498  temp.Y() += unit.X() * Y();
499  temp.Z() -= - X();
500  *this = temp / perp;
501  } else if (unit.Z() < 0) {
502  X() = -X(); // phi=0 teta=pi
503  Z() = -Z();
504  } else {};
505  }
506 
508 
518  {
519  auto const mag2 = Mag2();
520  return mag2 == ValueSquare(0) ? Vector3<double>() : static_cast<Vector3<double>>(*this / sqrt(mag2));
521  }
522 
527  {
528  auto const x = X() < Value_(0) ? -X() : X();
529  auto const y = Y() < Value_(0) ? -Y() : Y();
530  auto const z = Z() < Value_(0) ? -Z() : Z();
531  if (x < y) return x < z ? Vector3(Value_(0), Z(), -Y()) : Vector3(Y(), -X(), Value_(0));
532  else return y < z ? Vector3(-Z(), Value_(0), X()) : Vector3(Y(), -X(), Value_(0));
533  }
534 
539  {
540  return {Eta(), Phi()};
541  }
543 
552  template <typename Value_2_>
553  constexpr Vector3<ValueProduct<Value_2_>> Scale(Value_2_ const &scalar) const
554  {
555  return {Transversal() *scalar, Z() *scalar};
556  }
557 
561  template <typename Value_2_>
562  constexpr ValueProduct<Value_2_> Dot(Vector3<Value_2_> const &vector) const
563  {
564  return Transversal() * vector.Transversal() + Z() * vector.Z();
565  }
566 
570  template <typename Value_2_>
572  {
573  return {Y() *vector.Z() - vector.Y() *Z(), Z() *vector.X() - vector.Z() *X(), X() *vector.Y() - vector.X() *Y()};
574  }
575 
579  template <typename Value_2_, typename Value_3>
580  constexpr ValueCubed<Value_2_, Value_3> Triple(Vector3<Value_2_> const &vector_1, Vector3<Value_3> const &vector_2) const
581  {
582  return Cross(vector_1) * vector_2;
583  }
585 
594  constexpr bool operator<(Vector3 const &vector) const
595  {
596  return Mag2() < vector.Mag2();
597  }
598 
602  constexpr bool operator==(Vector3 const &vector) const
603  {
604  return vector.Transversal() == Transversal() && vector.Z() == Z();
605  }
606 
610  template <typename Value_2_, typename = OnlyIfNotOrSameQuantity<Value_2_>>
612  {
613  Transversal() += vector.Transversal();
614  Z() += vector.Z();
615  return *this;
616  }
617 
621  template <typename Value_2_, typename = OnlyIfNotOrSameQuantity<Value_2_>>
623  {
624  Transversal() -= vector.Transversal();
625  Z() -= vector.Z();
626  return *this;
627  }
628 
632  template < typename Value_2_, typename = OnlyIfNotQuantity<Value_2_> >
633  Vector3 &operator*=(Value_2_ scalar)
634  {
635  Transversal() *= scalar;
636  Z() *= scalar;
637  return *this;
638  }
639 
643  template<typename Value_2_>
644  auto &operator*=(Matrix3<Value_2_> const &matrix);
645 
649  template < typename Value_2_, typename = OnlyIfNotQuantity<Value_2_> >
650  Vector3 &operator/=(Value_2_ scalar)
651  {
652  Transversal() /= scalar;
653  Z() /= scalar;
654  return *this;
655  }
656 
660  template <typename Value_2_>
661  constexpr friend Vector3<ValueProduct<Value_2_>> operator^(Vector3 const &vector_1, Vector3<Value_2_> const &vector_2)
662  {
663  return vector_1.Cross(vector_2);
664  }
665 
669  template <typename Value_2_>
670  constexpr friend Vector3 <ValueQuotient<Value_2_>> operator/(Vector3 const &vector, Value_2_ const &scalar)
671  {
672  return vector.Scale(1. / scalar);
673  }
674 
678  constexpr Vector3 operator-() const
679  {
680  return { -Transversal(), -Z()};
681  }
682 
686  Value_ const& operator[](Dim3 dim_3) const
687  {
688  switch (dim_3) {
689  case Dim3::x : return X();
690  case Dim3::y : return Y();
691  case Dim3::z : return Z();
692  default :
693  Default("Vector3", Name(dim_3));
694  return X();
695  }
696  }
697 
701  Value_ &operator[](Dim3 dim_3)
702  {
703  return const_cast<Value_ &>(static_cast<Vector3<Value_> const &>(*this)[dim_3]);
704  }
705 
709  friend auto &operator<<(std::ostream &stream, Vector3<Value_> const &vector)
710  {
711  stream << vector.Transversal() << Stream(vector.Z());
712  return stream;
713  }
714 
716 
722  using Dimension = Dim3;
723 
728  {
729  return {this, Dim3::x};
730  }
731 
736  {
737  return {this, Dim3::last};
738  }
739 
744  {
745  return {this, Dim3::x};
746  }
747 
752  {
753  return {this, Dim3::last};
754  }
756 
757 private:
758 
759  Vector2<Value_> trans_;
760 
761  Value_ z_;
762 
763 };
764 
765 template <typename>
766 struct IsVector3 : std::false_type { };
767 
768 template <typename Value_>
769 struct IsVector3<Vector3<Value_>> : std::true_type { };
770 
771 template<typename Value_>
772 using OnlyIfNotVector3 = typename std::enable_if < !IsVector3<Value_>::value >::type;
773 
774 template<typename Value_>
775 using OnlyIfVector3 = typename std::enable_if < IsVector3<Value_>::value >::type;
776 
777 // Scalar product of 3-vectors.
778 template < class Value_, class Value_2_, typename = OnlyIfVector3<Value_>, typename = OnlyIfVector3<Value_2_> >
779 constexpr auto operator*(Value_ const &vector_1, Value_2_ const &vector_2)
780 {
781  return vector_1.Dot(vector_2);
782 }
783 
784 // Scaling of 3-vectors with a real number
785 template < class Value_, class Value_2_, typename = OnlyIfVector3<Value_>, typename = OnlyIfNotVector3<Value_2_> >
786 constexpr auto operator*(Value_ const &vector, Value_2_ scalar)
787 {
788  return vector.Scale(scalar);
789 }
790 
791 template < class Value_, class Value_2_, typename = OnlyIfVector3<Value_>, typename = OnlyIfNotVector3<Value_2_> >
792 constexpr auto operator*(Value_2_ scalar, Value_ const &vector)
793 {
794  return vector.Scale(scalar);
795 }
796 
797 template <class Value_1, class Value_2_, class Value_3>
798 constexpr auto Triple(Vector3<Value_1> const &vector_1, Vector3<Value_2_> const &vector_2, Vector3<Value_3> const &vector_3)
799 {
800  return vector_1.Triple(vector_2, vector_3);
801 }
802 
803 }
804 
805 namespace boost{
806 
807 template<typename Value_>
808 struct range_const_iterator< boca::Vector3<Value_> > {
810 };
811 
812 template<typename Value_>
813 struct range_mutable_iterator< boca::Vector3<Value_> > {
815 };
816 
817 }
constexpr Value_ Perp() const
The transverse component .
Definition: Vector3.hh:409
constexpr Vector3(Value_ x, Value_ y, Value_ z)
Constructor accepting three scalars.
Definition: Vector3.hh:75
constexpr ValueSquare Perp2() const
The transverse component squared .
Definition: Vector3.hh:401
boca::Iterator< boca::Vector3, Value_ > type
Definition: Vector3.hh:814
Angle atan2(Value const &value_1, Value const &value_2)
Arctangent2 .
Definition: Units.hh:185
constexpr ValueCubed< Value_2_, Value_3 > Triple(Vector3< Value_2_ > const &vector_1, Vector3< Value_3 > const &vector_2) const
Triple product between three vectors.
Definition: Vector3.hh:580
constexpr Vector3(Vector3< Value_2_ > const &vector)
Constructor accepting a vector.
Definition: Vector3.hh:102
constexpr Vector3()
Default constructor.
Definition: Vector3.hh:67
boca::Angle DeltaEtaTo(Vector3< Value_2_ > const &vector) const
Difference to vector in PseudoRapidity .
Definition: Vector3.hh:324
void SetPerpEtaPhi(Value_ const &perp, boca::Angle const &eta, boca::Angle const &phi)
Set Perpendicular, Eta and Phi.
Definition: Vector3.hh:185
constexpr Value_ Perp(Vector3< Value_2_ > const &vector) const
The transverse component to a vector.
Definition: Vector3.hh:431
typename boost::units::multiply_typeof_helper< ValueSquare< Value >, Value >::type ValueCubed
Definition: Units.hh:149
Dim3
Three dimensions.
Definition: Vector3.hh:13
Boost provides free peer-reviewed portable C++ source libraries.
Definition: LorentzVectorBase.hh:726
boca::Angle Phi() const
The azimuth angle restricted to .
Definition: Vector3.hh:270
typename std::enable_if< IsVector3< Value_ >::value >::type OnlyIfVector3
Definition: Vector3.hh:775
Vector3 & operator/=(Value_2_ scalar)
division by scalar
Definition: Vector3.hh:650
constexpr ConstIterator< boca::Vector3, Value_ > begin() const
Const begin.
Definition: Vector3.hh:727
void SetTheta(boca::Angle const &theta)
Set theta keeping mag and phi constant.
Definition: Vector3.hh:167
constexpr Vector3(TVector3 const &vector)
Constructor accepting a root::TVector3.
Definition: Vector3.hh:110
constexpr friend Vector3< ValueQuotient< Value_2_ > > operator/(Vector3 const &vector, Value_2_ const &scalar)
division by scalar
Definition: Vector3.hh:670
Vector2< Value_ > & Transversal()
Transversal vector .
Definition: Vector3.hh:256
boost::units::quantity< boost::units::si::plane_angle > Angle
Angle measured in radian.
Definition: Si.hh:35
boost::units::quantity< boost::units::si::plane_angle, Y >::type log(const boost::units::dimensionless_quantity< boost::units::si::system, Y > &number)
log returning Angle
Definition: Units.hh:86
void SetPerp(Value_ perp)
Set the transverse component keeping phi and z constant.
Definition: Vector3.hh:142
const iterator
Definition: Iterator.hh:84
boca::ConstIterator< boca::Vector3, Value_ > type
Definition: Vector3.hh:809
constexpr Vector3< ValueProduct< Value_2_ > > Scale(Value_2_ const &scalar) const
Scale vector with a scalar.
Definition: Vector3.hh:553
constexpr bool operator<(Vector3 const &vector) const
Less than comparison.
Definition: Vector3.hh:594
constexpr auto Triple(Vector3< Value_1 > const &vector_1, Vector3< Value_2_ > const &vector_2, Vector3< Value_3 > const &vector_3)
Definition: Vector3.hh:798
void SetPhi(boca::Angle const &phi)
Set phi keeping the magnitue and theta constant.
Definition: Vector3.hh:150
Vector3(Value_ value, Dim3 dim_3)
Constructor accepting one scalar and its direction.
Definition: Vector3.hh:83
void SetPerpThetaPhi(Value_ perp, boca::Angle const &theta, boca::Angle const &phi)
Set Perpendicular, Theta and Phi.
Definition: Vector3.hh:175
constexpr Value_ const & Z() const
Getter for Z.
Definition: Vector3.hh:216
std::string Stream(Value const &message, int width=20, bool right=false)
Definition: Debug.hh:48
Vector3 & operator*=(Value_2_ scalar)
Scaling with real numbers.
Definition: Vector3.hh:633
constexpr ValueSquare Mag2() const
The magnitude squared .
Definition: Vector3.hh:385
constexpr auto operator*(LorentzVectorBase< Value > const &lorentz_vector_1, LorentzVectorBase< Value_2 > const &lorentz_vector_2)
Scalar product of lorentzvectors.
Definition: LorentzVectorBase.hh:701
Dim3 Third(Dim3 dim_1, Dim3 dim_2)
Definition: Vector3.cpp:26
constexpr Vector3 operator-() const
Unary minus.
Definition: Vector3.hh:678
Vector3< double > Unit() const
Unit vector parallel to this.
Definition: Vector3.hh:517
constexpr Vector3< ValueProduct< Value_2_ > > Cross(Vector3< Value_2_ > const &vector) const
Cross product between two vector.
Definition: Vector3.hh:571
Three dimensional matrix.
Definition: Matrix3.hh:21
double CosTheta() const
Cosine of the polar angle .
Definition: Vector3.hh:287
typename boost::units::divide_typeof_helper< double, Value >::type ValueInverse
Definition: Units.hh:140
Value_ & Y()
Accessor for Y.
Definition: Vector3.hh:240
Vector3 & operator+=(Vector3< Value_2_ > const &vector)
Sum of two vectors.
Definition: Vector3.hh:611
auto sqr(Value const &value)
square of value
Definition: Math.hh:24
boca::Angle Angle(Vector3 const &vector) const
The angle to vector.
Definition: Vector3.hh:341
constexpr friend Vector3< ValueProduct< Value_2_ > > operator^(Vector3 const &vector_1, Vector3< Value_2_ > const &vector_2)
Cross product.
Definition: Vector3.hh:661
constexpr bool operator==(Vector3 const &vector) const
Equality comparison.
Definition: Vector3.hh:602
constexpr Vector2< Value_ > Transversal() const
Transversal vector .
Definition: Vector3.hh:224
ValueSqrt< Value > sqrt(Value const &value)
Square Root.
Definition: Units.hh:160
boca::Angle PseudoRapidity() const
Pseudorapidity .
Definition: Vector3.hh:360
boca::Angle DeltaRTo(Vector3< Value_2_ > const &vector) const
Difference to vector in .
Definition: Vector3.hh:333
void Default(std::string const &variable, const Value value)
Definition: Debug.hh:165
constexpr Vector3(Vector2< Value_ > const &transversal, Value_ z)
Constructor accepting a two vector and a scalar.
Definition: Vector3.hh:93
typename boost::units::multiply_typeof_helper< Value, Value_2 >::type ValueProduct
Definition: Units.hh:134
Iterator< boca::Vector3, Value_ > end()
end
Definition: Vector3.hh:751
Vector3 & Rotate(boca::Angle const &phi, Dim3 dim_1, Dim3 dim_2)
Rotate by phi in (dim_1, dim_2) plain.
Definition: Vector3.hh:445
boca::Angle DeltaPhiTo(Vector3< Value_2_ > const &vector) const
Difference to vector in azimuth restricted to .
Definition: Vector3.hh:315
constexpr Value_ Mag() const
The magnitude .
Definition: Vector3.hh:393
Value_ & X()
Accessor for X.
Definition: Vector3.hh:232
void SetUniform(Value_ value)
Set x, y, z according to value.
Definition: Vector3.hh:124
constexpr ConstIterator< boca::Vector3, Value_ > end() const
Const end.
Definition: Vector3.hh:735
typename std::enable_if< !IsVector3< Value_ >::value >::type OnlyIfNotVector3
Definition: Vector3.hh:772
Boosted Collider Analysis.
Definition: Analysis.hh:15
Vector3 & operator-=(Vector3< Value_2_ > const &vector)
Difference of two vectors.
Definition: Vector3.hh:622
void SetMag(Value_ magnitude)
Set the magnitude keeping theta and phi constant.
Definition: Vector3.hh:133
Value abs(Value const &value)
Absolute value.
Definition: Units.hh:235
Iterator< boca::Vector3, Value_ > begin()
begin
Definition: Vector3.hh:743
double SinTheta() const
Sine of the polar angle .
Definition: Vector3.hh:305
typename boost::units::multiply_typeof_helper< Value, Value >::type ValueSquare
Definition: Units.hh:143
Value_ & Z()
Accessor for Z.
Definition: Vector3.hh:248
Vector2< boca::Angle > EtaPhiVector() const
Angluar vector ( , )
Definition: Vector3.hh:538
Three dimensionial vector.
Definition: PseudoJet.hh:20
Dim3 Next(Dim3 dim)
Definition: Vector3.cpp:40
Value_ & operator[](Dim3 dim_3)
Components by index.
Definition: Vector3.hh:701
boost::units::dimensionless_quantity< boost::units::si::system, Y >::type sinh(const boost::units::quantity< boost::units::si::plane_angle, Y > &theta)
sinh of theta in radians
Definition: Units.hh:68
Angle Restrict(Angle phi)
Restrict an angle to the interval .
Definition: Si.cpp:26
constexpr ValueProduct< Value_2_ > Dot(Vector3< Value_2_ > const &vector) const
Dot product between two vector.
Definition: Vector3.hh:562
boca::Angle Theta() const
The polar angle .
Definition: Vector3.hh:278
constexpr ValueSquare Perp2(Vector3< Value_2_ > const &vector) const
The transverse component to a vector.
Definition: Vector3.hh:418
constexpr void RotateUz(Vector3< Value_2_ > const &vector)
Rotates reference frame from to .
Definition: Vector3.hh:490
Iterator
Definition: Iterator.hh:23
constexpr Value_ const & X() const
Getter for X.
Definition: Vector3.hh:200
double perp(fastjet::PseudoJet const &v_pj, fastjet::PseudoJet const &ref_pj)
Definition: FWM.cc:27
double SinTheta2() const
Square of the sine of the polar angle .
Definition: Vector3.hh:296
boca::Angle Eta() const
The azimuth angle restricted to .
Definition: Vector3.hh:369
typename boost::units::divide_typeof_helper< Value, Value_2 >::type ValueQuotient
Definition: Units.hh:137
constexpr Value_ const & Y() const
Getter for Y.
Definition: Vector3.hh:208
std::string Name(Output output)
Definition: Base.cpp:23
auto Transform(Input_ const &inputs, Function_ function)
Definition: Vector.hh:42
Value_ const & operator[](Dim3 dim_3) const
Components by index.
Definition: Vector3.hh:686
Vector3 & Rotate(boca::Angle const &phi, Dim3 dim)
Rotate by phi around axis dim.
Definition: Vector3.hh:460
void SetMagThetaPhi(Value_ mag, boca::Angle const &theta, boca::Angle const &phi)
Set mag, theta, phi.
Definition: Vector3.hh:158
Vector3 Orthogonal() const
Vector orthogonal to this.
Definition: Vector3.hh:526
Two dimensional Vector.
Definition: PseudoJet.hh:23
Definition: Vector3.hh:766
double Tan2(Vector3 const &vector)
Square of the tangent of the polar angle to a vector.
Definition: Vector3.hh:351
std::vector< Dim3 > Dimensions3()
Definition: Vector3.cpp:21