LorentzVectorBase.hh
Go to the documentation of this file.
49 using OnlyIfNotOrSameQuantity = typename std::enable_if < !IsQuantity<Value_2>::value || std::is_same<Value_, Value_2>::value >::type;
128 Scalar() = magnitude >= Value_(0) ? sqrt(sqr(Spatial()) + sqr(magnitude)) : sqrt(std::max((sqr(Spatial()) - sqr(magnitude)), ValueSquare(0)));
143 void SetPerpEtaPhiMag(Value_ const &perp, boca::Angle const &eta, boca::Angle const &phi, Value_ const &mag)
152 void SetPerpEtaPhiT(Value_ const &perp, boca::Angle const &eta, boca::Angle const &phi, Value_ const &t)
272 // if (Scalar() <= Value_(0)) std::cout << "Tried to take rapidity of negative-energy Lorentz vector" << '\n';
273 // auto pt = sqrt(units::max(sqr(Scalar() * std::numeric_limits<double>::epsilon()), Perp2(vector) + Mag2()));
388 return pt2 == ValueSquare(0) ? ValueSquare(0) : sqr(Scalar()) * pt2 / (pt2 + sqr(Spatial().Dot(vector.Unit())));
527 constexpr ValueProduct<Value_2> Euclidean(LorentzVectorBase<Value_2> const &lorentz_vector) const
695 using OnlyIfNotLorentzVectorBase = typename std::enable_if<std::is_base_of<LorentzVectorBase<Value>, Value>::value>::type;
701 constexpr auto operator*(LorentzVectorBase<Value> const &lorentz_vector_1, LorentzVectorBase<Value_2> const &lorentz_vector_2)
void SetVectT(Vector3< Value_ > const &spatial, Value_ t)
Set components.
Definition: LorentzVectorBase.hh:101
void SetVectMag(Vector3< Value_ > const &spatial, Value_ magnitude)
Copy spatial coordinates, and set .
Definition: LorentzVectorBase.hh:134
LorentzVectorBase & operator+=(LorentzVectorBase< Value_2 > const &lorentz_vector)
Additions.
Definition: LorentzVectorBase.hh:559
constexpr ValueSquare Mag2() const
Square of the magnitude .
Definition: LorentzVectorBase.hh:332
constexpr ConstIterator< Vector3, Value_ > end() const
Definition: LorentzVectorBase.hh:668
constexpr Value_ Rho() const
spatial radius
Definition: LorentzVectorBase.hh:324
Boost provides free peer-reviewed portable C++ source libraries.
Definition: LorentzVectorBase.hh:726
constexpr ValueProduct< Value_2 > Dot(LorentzVectorBase< Value_2 > const &lorentz_vector) const
Scalar dot product with a lorentz vector.
Definition: LorentzVectorBase.hh:518
constexpr ConstIterator< Vector3, Value_ > begin() const
Definition: LorentzVectorBase.hh:663
void SetRho(Value_ rho)
Set spatial magnitude.
Definition: LorentzVectorBase.hh:118
constexpr Vector3< Value_ > const & Spatial() const
Getter for the spatial components.
Definition: LorentzVectorBase.hh:168
constexpr double Beta() const
Relative velocity .
Definition: LorentzVectorBase.hh:403
boost::units::quantity< boost::units::si::plane_angle > Angle
Angle measured in radian.
Definition: Si.hh:35
constexpr LorentzVectorBase< ValueProduct< Value_2 > > Scale(Value_2 const &scalar) const
Scale.
Definition: LorentzVectorBase.hh:509
constexpr ValueSquare Rho2() const
Square of the spatial radius .
Definition: LorentzVectorBase.hh:316
Value_ scalar_
time or energy component
Definition: LorentzVectorBase.hh:690
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
constexpr Value_ Minus() const
Negative light cone component .
Definition: LorentzVectorBase.hh:431
constexpr Value_ Mag() const
Magnitude .
Definition: LorentzVectorBase.hh:342
std::string Stream(Value const &message, int width=20, bool right=false)
Definition: Debug.hh:48
constexpr Value_ ScalarT() const
transvere scalar square
Definition: LorentzVectorBase.hh:376
constexpr LorentzVectorBase(Value_ x, Value_ y, Value_ z, Value_ t)
Constructor accepting the components x, y, z, t.
Definition: LorentzVectorBase.hh:73
void SetPerpEtaPhiT(Value_ const &perp, boca::Angle const &eta, boca::Angle const &phi, Value_ const &t)
Set perp, , and time.
Definition: LorentzVectorBase.hh:152
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
constexpr LorentzVectorBase()
Default constructor.
Definition: LorentzVectorBase.hh:66
typename std::enable_if< !IsQuantity< Value_2 >::value >::type OnlyIfNotQuantity
Definition: LorentzVectorBase.hh:54
Vector3< double > Unit() const
Unit vector parallel to this.
Definition: Vector3.hh:517
constexpr LorentzVectorBase(Vector3< Value_ > const &vector3, Value_ const &t)
Constructor accepting a 3-Vector and a scalar component.
Definition: LorentzVectorBase.hh:80
constexpr ValueSquare ScalarT2() const
transvere scalar square
Definition: LorentzVectorBase.hh:368
constexpr ValueSquare MagT2() const
Square of the transvere magnitude .
Definition: LorentzVectorBase.hh:351
constexpr Vector3< double > BoostVector() const
Spatial components divided by the time component.
Definition: LorentzVectorBase.hh:445
constexpr LorentzVectorBase operator-() const
Unary minus.
Definition: LorentzVectorBase.hh:612
constexpr LorentzVectorBase< ValueQuotient< Value_2 > > operator/(Value_2 const &scalar) const
Divison by scalar.
Definition: LorentzVectorBase.hh:604
constexpr Value_ Plus() const
Positive light cone component .
Definition: LorentzVectorBase.hh:421
constexpr Value_ const & T() const
Getter for the scalar component.
Definition: LorentzVectorBase.hh:211
constexpr LorentzVectorBase< Value_ > Boosted(Vector3< double > const &boost) const
Boosted Lorentz vector.
Definition: LorentzVectorBase.hh:466
LorentzVectorBase & operator-=(LorentzVectorBase< Value_2 > const &lorentz_vector)
Subtractions.
Definition: LorentzVectorBase.hh:571
constexpr bool operator<(LorentzVectorBase const &lorentz_vector) const
Less than comparison.
Definition: LorentzVectorBase.hh:542
typename boost::units::multiply_typeof_helper< Value, Value_2 >::type ValueProduct
Definition: Units.hh:134
Iterator< Vector3, Value_ > begin()
Definition: LorentzVectorBase.hh:673
void SetPerpEtaPhiMag(Value_ const &perp, boca::Angle const &eta, boca::Angle const &phi, Value_ const &mag)
Set perp, , and magnitude.
Definition: LorentzVectorBase.hh:143
typename boost::units::multiply_typeof_helper< Value, Value >::type ValueSquare
Definition: Units.hh:143
Value_ & T()
Getter for the spatial components.
Definition: LorentzVectorBase.hh:196
constexpr ValueProduct< Value_2 > Euclidean(LorentzVectorBase< Value_2 > const &lorentz_vector) const
Euclidean product with a lorentz vector.
Definition: LorentzVectorBase.hh:527
LorentzVectorBase & operator/=(Value_2 scalar)
Divison by scalar.
Definition: LorentzVectorBase.hh:593
constexpr Value_ MagT() const
Transvere magnitude .
Definition: LorentzVectorBase.hh:359
void SetMag(Value_ magnitude)
Set Nergy according to spatial component and magnitude .
Definition: LorentzVectorBase.hh:126
boca::Angle Rapidity(Vector3< double > const &vector) const
Rapidity with respect to another vector.
Definition: LorentzVectorBase.hh:266
constexpr ValueSquare ScalarT2(Vector3< Value > const &vector) const
Transverse scalar squared towards a vector.
Definition: LorentzVectorBase.hh:385
boca::Angle DeltaRapTo(LorentzVectorBase< Value_2_ > const &vector) const
Difference in Rapidity to a vector .
Definition: LorentzVectorBase.hh:288
constexpr Value_ const & Scalar() const
Getter for the scalar component.
Definition: LorentzVectorBase.hh:206
constexpr double Gamma() const
Lorentz factor .
Definition: LorentzVectorBase.hh:411
boca::Angle Rapidity() const
Rapidity .
Definition: LorentzVectorBase.hh:252
Value max(Value const &value_1, Value const &value_2)
Maximal value.
Definition: Units.hh:260
double perp(fastjet::PseudoJet const &v_pj, fastjet::PseudoJet const &ref_pj)
Definition: FWM.cc:27
Value_ const & operator[](LorentzDim lorentz_dim) const
components by index.
Definition: LorentzVectorBase.hh:620
Vector3< Value_ > & Spatial()
Accessor for the spatial components.
Definition: LorentzVectorBase.hh:176
typename std::enable_if< std::is_base_of< LorentzVectorBase< Value >, Value >::value >::type OnlyIfNotLorentzVectorBase
Definition: LorentzVectorBase.hh:695
constexpr bool operator==(LorentzVectorBase const &lorentz_vector) const
Equality comparison.
Definition: LorentzVectorBase.hh:550
LorentzVectorBase< Value_ > & Boost(Vector3< double > const &boost)
Boost this Lorentz vector.
Definition: LorentzVectorBase.hh:481
Value_ & operator[](LorentzDim lorentz_dim)
components by index.
Definition: LorentzVectorBase.hh:640
Value_ & Scalar()
Accessor for the scalar.
Definition: LorentzVectorBase.hh:191
LorentzVectorBase & operator*=(Value_2 scalar)
Product with scalar.
Definition: LorentzVectorBase.hh:582
boca::Iterator< boca::LorentzVectorBase, Value_ > type
Definition: LorentzVectorBase.hh:735
constexpr LorentzVectorBase(LorentzVectorBase< Value_2 > const &lorentz_vector)
Copy constructor with casting.
Definition: LorentzVectorBase.hh:88
constexpr Value_ ScalarT(Vector3< Value > const &vector) const
Transverse scalar towards a vector.
Definition: LorentzVectorBase.hh:395
boca::Angle DeltaRTo(LorentzVectorBase< Value_2_ > const &vector) const
Difference in agular space to a vector to vector.
Definition: LorentzVectorBase.hh:297
boca::ConstIterator< boca::LorentzVectorBase, Value_ > type
Definition: LorentzVectorBase.hh:730
constexpr Vector3< double > BoostIntoRestFrame() const
Definition: LorentzVectorBase.hh:458
std::vector< LorentzDim > LorentzDimensions()
Definition: LorentzVectorBase.cpp:17