Rivet API documentation
![]() |
Rivet 4.1.3
|
Vector4.hh
373 template <typename V4TYPE, typename std::enable_if<HasXYZT<V4TYPE>::value, int>::type DUMMY = 0>
476 if (theta < 0 || theta > M_PI) throw std::domain_error("Polar angle outside 0..pi in calculation");
489 if (theta < 0 || theta > M_PI) throw std::domain_error("Polar angle outside 0..pi in calculation");
903 inline double deltaR2(const FourVector& a, const FourVector& b, RapScheme scheme = PSEUDORAPIDITY) {
928 inline double deltaR(const FourVector& a, const FourVector& b, RapScheme scheme = PSEUDORAPIDITY) {
939 inline double deltaR2(const FourVector& v, double eta2, double phi2, RapScheme scheme = PSEUDORAPIDITY) {
961 inline double deltaR(const FourVector& v, double eta2, double phi2, RapScheme scheme = PSEUDORAPIDITY) {
972 inline double deltaR2(double eta1, double phi1, const FourVector& v, RapScheme scheme = PSEUDORAPIDITY) {
994 inline double deltaR(double eta1, double phi1, const FourVector& v, RapScheme scheme = PSEUDORAPIDITY) {
1005 inline double deltaR2(const FourMomentum& a, const FourMomentum& b, RapScheme scheme = PSEUDORAPIDITY) {
1008 case RAPIDITY: return deltaR2(a.rapidity(), a.azimuthalAngle(), b.rapidity(), b.azimuthalAngle());
1019 inline double deltaR(const FourMomentum& a, const FourMomentum& b, RapScheme scheme = PSEUDORAPIDITY) {
1029 inline double deltaR2(const FourMomentum& v, double eta2, double phi2, RapScheme scheme = PSEUDORAPIDITY) {
1042 inline double deltaR(const FourMomentum& v, double eta2, double phi2, RapScheme scheme = PSEUDORAPIDITY) {
1052 inline double deltaR2(double eta1, double phi1, const FourMomentum& v, RapScheme scheme = PSEUDORAPIDITY) {
1065 inline double deltaR(double eta1, double phi1, const FourMomentum& v, RapScheme scheme = PSEUDORAPIDITY) {
1075 inline double deltaR2(const FourMomentum& a, const FourVector& b, RapScheme scheme = PSEUDORAPIDITY) {
1079 return deltaR2(a.rapidity(), a.azimuthalAngle(), FourMomentum(b).rapidity(), b.azimuthalAngle());
1089 inline double deltaR(const FourMomentum& a, const FourVector& b, RapScheme scheme = PSEUDORAPIDITY) {
1099 inline double deltaR2(const FourVector& a, const FourMomentum& b, RapScheme scheme = PSEUDORAPIDITY) {
1108 inline double deltaR(const FourVector& a, const FourMomentum& b, RapScheme scheme = PSEUDORAPIDITY) {
1560 out << "(" << (fabs(lv.t()) < 1E-30 ? 0.0 : lv.t()) << "; " << (fabs(lv.x()) < 1E-30 ? 0.0 : lv.x())
Specialized version of the FourVector with momentum/energy functionality.
Definition Vector4.hh:363
double p2() const
Get the modulus-squared of the 3-momentum.
Definition Vector4.hh:656
double mass() const
Get the mass (the Lorentz self-invariant).
Definition Vector4.hh:629
double rapidity() const
Calculate the rapidity.
Definition Vector4.hh:662
FourMomentum reverse() const
Multiply space components only by -1.
Definition Vector4.hh:788
FourMomentum & setPtPhiME(double pt, double phi, double mass, double E)
Definition Vector4.hh:572
FourMomentum & setRapPhiMPt(double y, double phi, double mass, double pt)
Definition Vector4.hh:521
FourMomentum & setPz(double pz)
Set z-component of momentum .
Definition Vector4.hh:426
FourMomentum & setXYZE(double px, double py, double pz, double E)
Alias for setPE.
Definition Vector4.hh:442
static FourMomentum mkThetaPhiME(double theta, double phi, double mass, double E)
Make a vector from (theta,phi,energy) coordinates and the mass.
Definition Vector4.hh:834
double pt() const
Calculate the transverse momentum .
Definition Vector4.hh:704
FourMomentum & setPE(double px, double py, double pz, double E)
Set the p coordinates and energy simultaneously.
Definition Vector4.hh:433
static FourMomentum mkRapPhiME(double y, double phi, double mass, double E)
Make a vector from (y,phi,energy) coordinates and the mass.
Definition Vector4.hh:824
double Et2() const
Calculate the transverse energy .
Definition Vector4.hh:709
static FourMomentum mkXYZE(double px, double py, double pz, double E)
Make a vector from (px,py,pz,E) coordinates.
Definition Vector4.hh:804
FourMomentum & setPy(double py)
Set y-component of momentum .
Definition Vector4.hh:420
FourMomentum & setPx(double px)
Set x-component of momentum .
Definition Vector4.hh:414
double pt2() const
Calculate the squared transverse momentum .
Definition Vector4.hh:695
static FourMomentum mkPtPhiME(double pt, double phi, double mass, double E)
Make a vector from (pT,phi,energy) coordinates and the mass.
Definition Vector4.hh:844
Vector3 pTvec() const
Calculate the transverse momentum vector .
Definition Vector4.hh:682
FourMomentum & setRapPhiME(double y, double phi, double mass, double E)
Definition Vector4.hh:504
double mass2() const
Get the squared mass (the Lorentz self-invariant).
Definition Vector4.hh:640
FourMomentum & setEtaPhiMPt(double eta, double phi, double mass, double pt)
Definition Vector4.hh:485
double pT2() const
Calculate the squared transverse momentum .
Definition Vector4.hh:691
static FourMomentum mkEtaPhiME(double eta, double phi, double mass, double E)
Make a vector from (eta,phi,energy) coordinates and the mass.
Definition Vector4.hh:814
FourMomentum & operator-=(const FourMomentum &v)
Subtract from this 4-vector. NB time as well as space components are subtracted.
Definition Vector4.hh:775
static FourMomentum mkXYZM(double px, double py, double pz, double mass)
Make a vector from (px,py,pz) coordinates and the mass.
Definition Vector4.hh:809
FourMomentum & setThetaPhiME(double theta, double phi, double mass, double E)
Definition Vector4.hh:535
double E() const
Get energy (time component of momentum).
Definition Vector4.hh:590
FourMomentum & setXYZM(double px, double py, double pz, double mass)
Alias for setPM.
Definition Vector4.hh:463
FourMomentum & operator+=(const FourMomentum &v)
Add to this 4-vector. NB time as well as space components are added.
Definition Vector4.hh:769
static FourMomentum mkEtaPhiMPt(double eta, double phi, double mass, double pt)
Make a vector from (eta,phi,pT) coordinates and the mass.
Definition Vector4.hh:819
static FourMomentum mkRapPhiMPt(double y, double phi, double mass, double pt)
Make a vector from (y,phi,pT) coordinates and the mass.
Definition Vector4.hh:829
double pT() const
Calculate the transverse momentum .
Definition Vector4.hh:700
static FourMomentum mkThetaPhiMPt(double theta, double phi, double mass, double pt)
Make a vector from (theta,phi,pT) coordinates and the mass.
Definition Vector4.hh:839
FourMomentum & setThetaPhiMPt(double theta, double phi, double mass, double pt)
Definition Vector4.hh:555
FourMomentum operator-() const
Multiply all components (time and space) by -1.
Definition Vector4.hh:781
double absrapidity() const
Absolute rapidity.
Definition Vector4.hh:673
FourMomentum & setEtaPhiME(double eta, double phi, double mass, double E)
Definition Vector4.hh:472
FourMomentum & operator/=(double a)
Divide by a scalar.
Definition Vector4.hh:763
FourMomentum & setE(double E)
Set energy (time component of momentum).
Definition Vector4.hh:408
FourMomentum & operator*=(double a)
Multiply by a scalar.
Definition Vector4.hh:757
FourMomentum & setPM(double px, double py, double pz, double mass)
Set the p coordinates and mass simultaneously.
Definition Vector4.hh:456
Specialisation of VectorN to a general (non-momentum) Lorentz 4-vector.
Definition Vector4.hh:32
FourVector operator-() const
Multiply all components (space and time) by -1.
Definition Vector4.hh:276
FourVector & operator/=(double a)
Divide by a scalar.
Definition Vector4.hh:258
Vector3 vector3() const
Get the spatial part of the 4-vector as a 3-vector.
Definition Vector4.hh:219
double angle(const FourVector &v) const
Angle between this vector and another.
Definition Vector4.hh:133
double phi(const PhiMapping mapping=ZERO_2PI) const
Synonym for azimuthalAngle.
Definition Vector4.hh:187
double contract(const FourVector &v) const
Contract two 4-vectors, with metric signature (+ - - -).
Definition Vector4.hh:236
double azimuthalAngle(const PhiMapping mapping=ZERO_2PI) const
Angle subtended by the 3-vector's projection in x-y and the x-axis.
Definition Vector4.hh:183
double dot(const FourVector &v) const
Contract two 4-vectors, with metric signature (+ - - -).
Definition Vector4.hh:242
FourVector & operator*=(double a)
Multiply by a scalar.
Definition Vector4.hh:252
double operator*(const FourVector &v) const
Contract two 4-vectors, with metric signature (+ - - -).
Definition Vector4.hh:247
double pseudorapidity() const
Pseudorapidity (defined purely by the 3-vector components).
Definition Vector4.hh:201
double polarRadius() const
Magnitude of projection of 3-vector on to the plane.
Definition Vector4.hh:157
double angle(const Vector3 &v3) const
Angle between this vector and another (3-vector).
Definition Vector4.hh:137
Vector3 polarVec() const
Projection of 3-vector on to the plane.
Definition Vector4.hh:170
double polarRadius2() const
Mod-square of the projection of the 3-vector on to the plane This is a more efficient function than ...
Definition Vector4.hh:144
FourVector reverse() const
Multiply space components only by -1.
Definition Vector4.hh:283
double polarAngle() const
Angle subtended by the 3-vector and the z-axis.
Definition Vector4.hh:192
FourVector & operator-=(const FourVector &v)
Subtract from this 4-vector. NB time as well as space components are subtracted.
Definition Vector4.hh:270
double abspseudorapidity() const
Get the directly.
Definition Vector4.hh:210
FourVector & operator+=(const FourVector &v)
Add to this 4-vector.
Definition Vector4.hh:264
Object implementing Lorentz transform calculations and boosts.
Definition LorentzTrans.hh:21
double pseudorapidity() const
Purely geometric approximation to rapidity.
Definition Vector3.hh:251
double phi(const PhiMapping mapping=ZERO_2PI) const
Synonym for azimuthalAngle.
Definition Vector3.hh:212
double polarRadius2() const
Square of the polar radius (.
Definition Vector3.hh:174
double azimuthalAngle(const PhiMapping mapping=ZERO_2PI) const
Angle subtended by the vector's projection in x-y and the x-axis.
Definition Vector3.hh:203
double angle(const Vector3 &v) const
Angle in radians to another vector.
Definition Vector3.hh:136
double polarAngle() const
Angle subtended by the vector and the z-axis.
Definition Vector3.hh:232
Vector3 polarVec() const
Polar projection of this vector into the x-y plane.
Definition Vector3.hh:159
double mod2() const
Calculate the modulus-squared of a vector. .
Definition VectorN.hh:88
Vector< N > & set(const size_t index, const double value)
Definition VectorN.hh:63
MOMS & isortBy(MOMS &pbs, const CMP &cmp)
Sort a container of momenta by cmp and return by reference for non-const inputs.
Definition Vector4.hh:1422
MOMS & isortByE(MOMS &pbs)
Sort a container of momenta by E (decreasing) and return by reference for non-const inputs.
Definition Vector4.hh:1447
MOMS & isortByEt(MOMS &pbs)
Sort a container of momenta by Et (decreasing) and return by reference for non-const inputs.
Definition Vector4.hh:1458
bool cmpMomByDescEta(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by decreasing eta (pseudorapidity).
Definition Vector4.hh:1383
bool cmpMomByMass(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by decreasing mass.
Definition Vector4.hh:1369
bool cmpMomByP(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by decreasing 3-momentum magnitude |p|.
Definition Vector4.hh:1342
bool cmpMomByAscEt(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by increasing transverse energy.
Definition Vector4.hh:1355
bool cmpMomByRap(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by increasing rapidity.
Definition Vector4.hh:1398
bool cmpMomByE(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by decreasing energy.
Definition Vector4.hh:1360
MOMS sortBy(const MOMS &pbs, const CMP &cmp)
Sort a container of momenta by cmp and return by value for const inputs.
Definition Vector4.hh:1428
bool cmpMomByAbsRap(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by increasing absolute rapidity.
Definition Vector4.hh:1408
MOMS sortByPt(const MOMS &pbs)
Sort a container of momenta by pT (decreasing) and return by value for const inputs.
Definition Vector4.hh:1441
MOMS sortByEt(const MOMS &pbs)
Sort a container of momenta by Et (decreasing) and return by value for const inputs.
Definition Vector4.hh:1463
bool cmpMomByEt(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by decreasing transverse energy.
Definition Vector4.hh:1351
bool cmpMomByAscPt(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by increasing pT.
Definition Vector4.hh:1337
bool cmpMomByAscP(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by increasing 3-momentum magnitude |p|.
Definition Vector4.hh:1346
bool cmpMomByAscMass(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by increasing mass.
Definition Vector4.hh:1373
MOMS sortByE(const MOMS &pbs)
Sort a container of momenta by E (decreasing) and return by value for const inputs.
Definition Vector4.hh:1452
bool cmpMomByPt(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by decreasing pT.
Definition Vector4.hh:1333
bool cmpMomByAbsEta(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by increasing absolute eta (pseudorapidity).
Definition Vector4.hh:1388
bool cmpMomByDescAbsEta(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by increasing absolute eta (pseudorapidity).
Definition Vector4.hh:1393
bool cmpMomByEta(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by increasing eta (pseudorapidity).
Definition Vector4.hh:1378
bool cmpMomByAscE(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by increasing energy.
Definition Vector4.hh:1364
bool cmpMomByDescAbsRap(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by decreasing absolute rapidity.
Definition Vector4.hh:1413
MOMS & isortByPt(MOMS &pbs)
Sort a container of momenta by pT (decreasing) and return by reference for non-const inputs.
Definition Vector4.hh:1436
bool cmpMomByDescRap(const FourMomentum &a, const FourMomentum &b)
Comparison to give a sorting by decreasing rapidity.
Definition Vector4.hh:1403
double mass(const FourMomentum &a, const FourMomentum &b)
Calculate mass of two 4-vectors.
Definition Vector4.hh:1474
double mass2(const FourMomentum &a, const FourMomentum &b)
Calculate mass^2 of two 4-vectors.
Definition Vector4.hh:1479
double pT(const Vector3 &a, const Vector3 &b)
Calculate transverse momentum of pair of 3-vectors.
Definition Vector3.hh:691
double E(const ParticleBase &p)
Unbound function access to E.
Definition ParticleBaseUtils.hh:829
Definition LHCbCommon.hh:9
constexpr std::enable_if_t< std::is_arithmetic_v< NUM >, int > sign(NUM val)
Find the sign of a number.
Definition MathUtils.hh:295
double deltaR(double rap1, double phi1, double rap2, double phi2)
Definition MathUtils.hh:754
double deltaPhi(double phi1, double phi2, bool sign=false)
Calculate the difference between two angles in radians.
Definition MathUtils.hh:724
double deltaEta(double eta1, double eta2, bool sign=false)
Definition MathUtils.hh:732
double deltaR2(double rap1, double phi1, double rap2, double phi2)
Definition MathUtils.hh:747
std::ostream & operator<<(std::ostream &os, const AnalysisInfo &ai)
Stream an AnalysisInfo as a text description.
Definition AnalysisInfo.hh:463
std::enable_if_t< std::is_floating_point_v< NUM >, bool > isZero(NUM val, double tolerance=1e-8)
Compare a number to zero.
Definition MathUtils.hh:23
std::enable_if_t< std::is_arithmetic_v< NUM >, NUM > sqr(NUM a)
Named number-type squaring operation.
Definition MathUtils.hh:237
double contract(const FourVector &a, const FourVector &b)
Contract two 4-vectors, with metric signature (+ - - -).
Definition Vector4.hh:292
double add(double a, double b, double tolerance=1e-5)
Add two numbers with FP fuzziness.
Definition MathUtils.hh:248
RapScheme
Enum for rapidity variable to be used in calculating , applying rapidity cuts, etc.
Definition MathConstants.hh:46
Cmp< T > cmp(const T &t1, const T &t2)
Global helper function for easy creation of Cmp objects.
Definition Cmp.hh:253
double angle(const Vector2 &a, const Vector2 &b)
Angle (in radians) between two 2-vectors.
Definition Vector2.hh:194
double rapidity(double E, double pz)
Calculate a rapidity value from the supplied energy E and longitudinal momentum pz.
Definition MathUtils.hh:759
Generated on for Rivet by
