12 #ifndef HAMMER_MATH_FOURMOMENTUM
13 #define HAMMER_MATH_FOURMOMENTUM
17 #include <boost/operators.hpp>
31 :
public boost::addable<
33 boost::subtractable<FourMomentum,
34 boost::dividable2<FourMomentum, double,
35 boost::multipliable2<FourMomentum, double>>>> {
127 double mass2()
const;
148 double theta()
const;
151 std::array<double, 3>
pVec()
const;
190 double gamma()
const;
220 void boostBy(
const std::array<double, 3>& v);
276 double dot(
const std::array<double, 3>& a,
const std::array<double, 3>& b);
278 double costheta(
const std::array<double, 3>& a,
const std::array<double, 3>& b);
FourMomentum boostToRestFrameOf(const FourMomentum &mom, double vx, double vy, double vz)
FourMomentum & boostToRestFrameOf(const FourMomentum &v)
returns a boosted 4-vector
FourMomentum()
default constructor
static FourMomentum fromPM(double px, double py, double pz, double mass)
builder method based on 3-momentum and invariant mass
double eta() const
returns the pseudorapidity (along the z-axis)
double phi() const
returns the azimuthal angle
FourMomentum & operator-=(const FourMomentum &v)
subtract the 4-momentum by another
double p2() const
returns the squared 3-momentum
double p() const
returns the absolute value of the 3-momentum
double gamma() const
returns the for the Lorentz transformation to the rest frame
double E() const
returns the energy
FourMomentum & operator+=(const FourMomentum &v)
adds the another 4-momentum to itself
double costheta(const std::array< double, 3 > &a, const std::array< double, 3 > &b)
Hammer configuration definitions.
double dot(const FourMomentum &v) const
contracts the 4-momentum with another
FourMomentum & setPy(double py)
set the 4-momentum momentum y component
double angle(const FourMomentum &v, const FourMomentum &w)
computes the angle between the spatial components of two 4-momenta
double pt() const
returns the transverse momentum
static FourMomentum fromPtEtaPhiM(double pt, double eta, double phi, double mass)
builder method based on collider-friendly variables
double mass2() const
returns the squared invariant mass
double mass() const
returns the invariant mass if the invariant mass squared is negative returns
FourMomentum & setE(double E)
set the 4-momentum energy
FourMomentum PFlip() const
construct a copy of itself with all the signs of the spatial components flipped
double beta() const
returns the value of the boost to the rest frame
void boostBy(const std::array< double, 3 > &v)
FourMomentum operator-() const
construct a copy of itself with all the signs of the components flipped
double epsilon(const FourMomentum &a, const FourMomentum &b, const FourMomentum &c, const FourMomentum &d)
contracts four 4-momenta with an 4D epsilon tensor.
std::array< double, 4 > _vec
the contents of the 4-momentum in the notation .
double deltaR(const FourMomentum &v, const FourMomentum &w)
computes between two 4-momenta
FourMomentum & boostFromRestFrameOf(const FourMomentum &v)
FourMomentum & operator*=(double a)
multiplies the components by a constant
std::array< double, 3 > pVec() const
returns the spatial 3-vector as an array
Tensor operator*(const Tensor &first, double val)
left multiplies a tensor by a real constant
FourMomentum & operator/=(double a)
divides the components by a constant
double deltaPhi(const FourMomentum &v, const FourMomentum &w)
computes the difference between the azimuthal angles of two 4-momenta
FourMomentum & setPz(double pz)
set the 4-momentum momentum z component
std::array< double, 3 > boostVector() const
returns the boost 3-vector
double pz() const
returns the momentum z component
double deltaEta(const FourMomentum &v, const FourMomentum &w)
computes the difference between the pseudorapidities of two 4-momenta
ROOT forward declarations.
double py() const
returns the momentum y component
FourMomentum & setPx(double px)
set the 4-momentum momentum x component
static FourMomentum fromEtaPhiME(double eta, double phi, double mass, double E)
builder method based on collider-friendly variables
double theta() const
returns the polar angle (along the z-axis)
double rapidity() const
returns the rapidity (along the z-axis)
double px() const
returns the momentum x component
Tensor dot(const Tensor &first, const Tensor &second, const set< IndexLabel > &indices)