HackAnalysis
2
|
A 4-momentum class for vectors. More...
#include <Vectors.h>
Public Member Functions | |
Constructors etc. | |
P4 () | |
Default constructor of a null vector. | |
P4 (double px, double py, double pz, double E) | |
Constructor from Cartesian/Minkowski coordinates. | |
P4 (const P4 &v) | |
Copy constructor. | |
P4 & | operator= (const P4 &v) |
Copy assignment operator. | |
void | clear () |
Set the components to zero. | |
Coordinate setters | |
P4 & | setPx (double px) |
Set the px coordinate. | |
P4 & | setPy (double py) |
Set the py coordinate. | |
P4 & | setPz (double pz) |
Set the pz coordinate. | |
P4 & | setT (double t) |
P4 & | setE (double E) |
P4 & | setM (double mass) |
Set the mass // Mark: preserve momentum, update energy. | |
P4 & | setPM (double px, double py, double pz, double mass) |
Set the p coordinates and mass simultaneously. | |
P4 & | setXYZM (double px, double py, double pz, double mass) |
Alias for setPM. | |
P4 & | SetVectM (const HEP::P3 &vec, double mass) |
P4 & | translate_zt (double dz, double dt) |
P4 & | setPE (double px, double py, double pz, double E) |
P4 & | setXYZE (double px, double py, double pz, double E) |
Alias for setPE. | |
P4 & | SetPxPyPzE (double px, double py, double pz, double mass) |
P4 & | setEtaPhiME (double eta, double phi, double mass, double E) |
P4 & | setEtaPhiMPt (double eta, double phi, double mass, double pt) |
P4 & | setRapPhiME (double y, double phi, double mass, double E) |
P4 & | setRapPhiMPt (double y, double phi, double mass, double pt) |
P4 & | setThetaPhiME (double theta, double phi, double mass, double E) |
P4 & | setThetaPhiMPt (double theta, double phi, double mass, double pt) |
P4 & | setPtPhiME (double pt, double phi, double mass, double E) |
Coordinate getters | |
double | px2 () const |
Get px^2. | |
double | px () const |
Get px. | |
double | py2 () const |
Get py^2. | |
double | py () const |
Get py. | |
double | pz2 () const |
Get pz^2. | |
double | pz () const |
Get pz. | |
double | m2 () const |
Get m^2. | |
double | m () const |
Get m. | |
double | M () const |
double | M2 () const |
double | X () const |
double | Y () const |
Get py^2. | |
double | Z () const |
Get pz^2. | |
double | E () const |
double | E2 () const |
double | T () const |
double | T2 () const |
double | p2 () const |
Get E^2. More... | |
double | p () const |
Get the spatial 3-vector |p|. | |
double | P () const |
Get the spatial 3-vector |p|. | |
double | rho2 () const |
Get the spatial 3-vector |px^2 + py^2|. | |
double | rho () const |
Get the spatial 3-vector sqrt|px^2 + py^2|. | |
double | pT2 () const |
Get the transverse momentum squared (same as rho2) | |
double | pT () const |
Get the transverse momentum (same as rho) | |
double | mT2 () const |
double | mT () const |
double | phi () const |
Get the spatial phi. | |
double | theta () const |
Get the spatial theta. | |
double | eta () const |
Get the spatial vector pseudorapidity. | |
double | abseta () const |
Get the spatial vector absolute pseudorapidity. | |
double | rap () const |
Get the 4-momentum rapidity. | |
double | absrap () const |
Get the 4-momentum absolute rapidity. | |
Calculations w.r.t. other P4 vectors | |
double | dot3 (const P4 &v) const |
Spatial dot product. | |
double | dot (const P4 &v) const |
Lorentz dot product with the positive metric term on E. | |
double | angleTo (const P4 &v) const |
Spatial angle to another P4 vector. | |
double | deltaPhi (const P4 &v) const |
Difference in phi between two vectors. | |
double | deltaEta (const P4 &v) const |
Difference in pseudorapidity between two vectors. | |
double | deltaRap (const P4 &v) const |
Difference in rapidity between two vectors. | |
double | deltaR2_eta (const P4 &v) const |
Difference in pseudorapidity-based R^2 between two vectors. | |
double | deltaR_eta (const P4 &v) const |
Difference in pseudorapidity-based R between two vectors. | |
double | deltaR2_rap (const P4 &v) const |
Difference in rapidity-based R^2 between two vectors. | |
double | deltaR_rap (const P4 &v) const |
Difference in rapidity-based R between two vectors. | |
P4 | cross (const P4 &v) const |
Self-modifying operators | |
P4 | operator- () const |
P4 & | operator+= (const P4 &v) |
P4 & | operator-= (const P4 &v) |
P4 & | operator*= (double a) |
P4 & | operator/= (double a) |
P4 & | Boost (double bx, double by, double bz) |
P4 & | Boost (const HEP::P3 &b) |
P3 | Vect () const |
P3 | BoostVector () const |
P4 & | Rotate (const double &angle, const P3 &axis) |
Static Public Member Functions | |
Static methods for vector making | |
static P4 | mkXYZE (double px, double py, double pz, double E) |
Make a vector from (px,py,pz,E) coordinates. | |
static P4 | mkXYZM (double px, double py, double pz, double mass) |
Make a vector from (px,py,pz) coordinates and the mass. | |
static P4 | mkEtaPhiME (double eta, double phi, double mass, double E) |
Make a vector from (eta,phi,energy) coordinates and the mass. | |
static P4 | mkEtaPhiMPt (double eta, double phi, double mass, double pt) |
Make a vector from (eta,phi,pT) coordinates and the mass. | |
static P4 | mkRapPhiME (double y, double phi, double mass, double E) |
Make a vector from (y,phi,energy) coordinates and the mass. | |
static P4 | mkRapPhiMPt (double y, double phi, double mass, double pt) |
Make a vector from (y,phi,pT) coordinates and the mass. | |
static P4 | mkThetaPhiME (double theta, double phi, double mass, double E) |
Make a vector from (theta,phi,energy) coordinates and the mass. | |
static P4 | mkThetaPhiMPt (double theta, double phi, double mass, double pt) |
Make a vector from (theta,phi,pT) coordinates and the mass. | |
static P4 | mkPtPhiME (double pt, double phi, double mass, double E) |
Make a vector from (pT,phi,energy) coordinates and the mass. | |
A 4-momentum class for vectors.
Changed round compared to HEPUtils so that we can have spacetime vectors too, not necessarily on-shell
|
inline |
Get E^2.
Get E Get the spatial 3-vector |p|^2
|
inline |
Set the vector state from (eta,phi,energy) coordinates and the mass
eta = -ln(tan(theta/2)) -> theta = 2 atan(exp(-eta))
|
inline |
Set the vector state from (eta,phi,pT) coordinates and the mass
eta = -ln(tan(theta/2)) -> theta = 2 atan(exp(-eta))
|
inline |
Set the p coordinates and energy simultaneously
|
inline |
Set the vector state from (pT,phi,energy) coordinates and the mass
pz = sqrt(E^2 - mass^2 - pt^2)
|
inline |
Set the vector state from (y,phi,energy) coordinates and the mass
y = 0.5 * ln((E+pz)/(E-pz)) -> (E^2 - pz^2) exp(2y) = (E+pz)^2 & (E^2 - pz^2) exp(-2y) = (E-pz)^2 -> E = sqrt(pt^2 + m^2) cosh(y) -> pz = sqrt(pt^2 + m^2) sinh(y) -> sqrt(pt^2 + m^2) = E / cosh(y)
|
inline |
Set the vector state from (y,phi,pT) coordinates and the mass
y = 0.5 * ln((E+pz)/(E-pz)) -> E = sqrt(pt^2 + m^2) cosh(y) [see above]
|
inline |
Set the vector state from (theta,phi,energy) coordinates and the mass
p = sqrt(E^2 - mass^2) pz = p cos(theta) pt = p sin(theta)
|
inline |
Set the vector state from (theta,phi,pT) coordinates and the mass
p = pt / sin(theta) pz = p cos(theta) E = sqrt(p^2 + mass^2)