rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.2

Specialized version of the ThreeVector with momentum functionality. More...

#include <Vector3.hh>

Inheritance diagram for Rivet::ThreeMomentum:
Rivet::Vector3 Rivet::Vector< 3 >

Public Types

using EVector = RivetEigen::Matrix< double, N, 1 >
 Vector.
 

Public Member Functions

template<typename V3TYPE , typename std::enable_if< HasXYZ< V3TYPE >::value, int >::type DUMMY = 0>
 ThreeMomentum (const V3TYPE &other)
 
 ThreeMomentum (const Vector< 3 > &other)
 
 ThreeMomentum (const double px, const double py, const double pz)
 
double x () const
 
double x2 () const
 
Vector3setX (double x)
 
double y () const
 
double y2 () const
 
Vector3setY (double y)
 
double z () const
 
double z2 () const
 
Vector3setZ (double z)
 
double dot (const Vector3 &v) const
 Dot-product with another vector.
 
Vector3 cross (const Vector3 &v) const
 Cross-product with another vector.
 
double angle (const Vector3 &v) const
 Angle in radians to another vector.
 
Vector3 unitVec () const
 Unit-normalized version of this vector.
 
Vector3 unit () const
 Synonym for unitVec.
 
Vector3 polarVec () const
 Polar projection of this vector into the x-y plane.
 
Vector3 perpVec () const
 Synonym for polarVec.
 
Vector3 rhoVec () const
 Synonym for polarVec.
 
double polarRadius2 () const
 Square of the polar radius (.
 
double perp2 () const
 Synonym for polarRadius2.
 
double rho2 () const
 Synonym for polarRadius2.
 
double polarRadius () const
 Polar radius.
 
double perp () const
 Synonym for polarRadius.
 
double rho () const
 Synonym for polarRadius.
 
double azimuthalAngle (const PhiMapping mapping=ZERO_2PI) const
 Angle subtended by the vector's projection in x-y and the x-axis.
 
double phi (const PhiMapping mapping=ZERO_2PI) const
 Synonym for azimuthalAngle.
 
double tanTheta () const
 Tangent of the polar angle.
 
double polarAngle () const
 Angle subtended by the vector and the z-axis.
 
double theta () const
 Synonym for polarAngle.
 
double pseudorapidity () const
 Purely geometric approximation to rapidity.
 
double eta () const
 Synonym for pseudorapidity.
 
double abseta () const
 Convenience shortcut for fabs(eta())
 
Vector3operator+= (const Vector3 &v)
 In-place addition operator.
 
Vector3operator-= (const Vector3 &v)
 In-place subtraction operator.
 
const doubleget (const size_t index) const
 
doubleget (const size_t index)
 
const doubleoperator[] (const size_t index) const
 Direct access to vector elements by index.
 
doubleoperator[] (const size_t index)
 Direct access to vector elements by index.
 
Vector< N > & set (const size_t index, const double value)
 Set indexed value.
 
constexpr size_t size () const
 Vector dimensionality.
 
bool isZero (double tolerance=1E-5) const
 Check for nullness, allowing for numerical precision.
 
double mod2 () const
 Calculate the modulus-squared of a vector. \( \sum_{i=1}^N x_i^2 \).
 
double mod () const
 Calculate the modulus of a vector. \( \sqrt{\sum_{i=1}^N x_i^2} \).
 
bool operator== (const Vector< N > &a) const
 
bool operator!= (const Vector< N > &a) const
 
Coordinate setters
ThreeMomentumsetPx (double px)
 Set x-component of momentum \( p_x \).
 
ThreeMomentumsetPy (double py)
 Set y-component of momentum \( p_y \).
 
ThreeMomentumsetPz (double pz)
 Set z-component of momentum \( p_z \).
 
Accessors
double px () const
 Get x-component of momentum \( p_x \).
 
double px2 () const
 Get x-squared \( p_x^2 \).
 
double py () const
 Get y-component of momentum \( p_y \).
 
double py2 () const
 Get y-squared \( p_y^2 \).
 
double pz () const
 Get z-component of momentum \( p_z \).
 
double pz2 () const
 Get z-squared \( p_z^2 \).
 
double p () const
 Get the modulus of the 3-momentum.
 
double p2 () const
 Get the modulus-squared of the 3-momentum.
 
ThreeMomentum pTvec () const
 Calculate the transverse momentum vector \( \vec{p}_T \).
 
ThreeMomentum ptvec () const
 Synonym for pTvec.
 
double pT2 () const
 Calculate the squared transverse momentum \( p_T^2 \).
 
double pt2 () const
 Calculate the squared transverse momentum \( p_T^2 \).
 
double pT () const
 Calculate the transverse momentum \( p_T \).
 
double pt () const
 Calculate the transverse momentum \( p_T \).
 
Arithmetic operators (needed again for covariant returns)
ThreeMomentumoperator*= (double a)
 Multiply by a scalar.
 
ThreeMomentumoperator/= (double a)
 Divide by a scalar.
 
ThreeMomentumoperator+= (const ThreeMomentum &v)
 Add two 3-momenta.
 
ThreeMomentumoperator-= (const ThreeMomentum &v)
 Subtract two 3-momenta.
 
ThreeMomentum operator- () const
 Multiply all components by -1.
 

Static Public Member Functions

static Vector3 mkX ()
 
static Vector3 mkY ()
 
static Vector3 mkZ ()
 

Detailed Description

Specialized version of the ThreeVector with momentum functionality.

Member Function Documentation

◆ azimuthalAngle()

double Rivet::Vector3::azimuthalAngle ( const PhiMapping  mapping = ZERO_2PI) const
inlineinherited

Angle subtended by the vector's projection in x-y and the x-axis.

Note
Returns zero in the case of a vector with null x and y components.
Todo:
Would it be better to return NaN in the null-perp case? Or throw?!

References Rivet::Vector3::eta(), and Rivet::mapAngle().

Referenced by Rivet::FourVector::azimuthalAngle(), Rivet::deltaPhi(), Rivet::deltaPhi(), Rivet::deltaPhi(), Rivet::deltaR2(), Rivet::deltaR2(), Rivet::deltaR2(), and Rivet::Vector3::phi().

◆ pseudorapidity()

double Rivet::Vector3::pseudorapidity ( ) const
inlineinherited

Purely geometric approximation to rapidity.

eta = -ln[ tan(theta/2) ]

Also invariant under z-boosts, equal to y for massless particles.

Implemented using the tan half-angle formula tan(theta/2) = sin(theta) / [1 + cos(theta)] = pT / (p + pz)

<

Todo:
Add [[ unlikely ]] with C++20

<

Todo:
Add [[ unlikely ]] with C++20

References Rivet::Vector3::eta(), Rivet::Vector< 3 >::mod(), and Rivet::Vector3::perp().

Referenced by Rivet::deltaEta(), Rivet::deltaEta(), Rivet::deltaEta(), Rivet::deltaR2(), Rivet::deltaR2(), Rivet::deltaR2(), Rivet::Vector3::eta(), and Rivet::FourVector::pseudorapidity().


The documentation for this class was generated from the following file:
  • /Users/chrisg/software/rivet/include/Rivet/Math/Vector3.hh