![]() |
ROOT 6.13/01 Reference Guide |
TLorentzVector is a general four-vector class, which can be used either for the description of position and time (x,y,z,t) or momentum and energy (px,py,pz,E).
TLorentzVector has been implemented as a set a TVector3 and a Double_t variable. By default all components are initialized by zero.
For backward compatibility there are two constructors from an Double_t and Float_t C array.
There are two sets of access functions to the components of a LorentzVector: X(), Y(), Z(), T() and Px(), Py(), Pz() and E(). Both sets return the same values but the first set is more relevant for use where TLorentzVector describes a combination of position and time and the second set is more relevant where TLorentzVector describes momentum and energy:
The components of TLorentzVector can also accessed by index:
You can use the Vect() member function to get the vector component of TLorentzVector:
For setting components also two sets of member functions can be used:
To set more the one component by one call you can use the SetVect() function for the TVector3 part or SetXYZT(), SetPxPyPzE(). For convenience there is
also a SetXYZM():
There are a couple of member functions to get and set the TVector3 part of the parameters in spherical coordinate systems:
or get information about the r-coordinate in cylindrical systems:
for convenience there are two more set functions SetPtEtaPhiE(pt,eta,phi,e); and SetPtEtaPhiM(pt,eta,phi,m);
The TLorentzVector class provides operators to add, subtract or compare four-vectors:
The scalar product of two four-vectors is calculated with the (-,-,-,+) metric,
i.e. s = v1*v2 = t1*t2-x1*x2-y1*y2-z1*z2
The magnitude squared mag2 of a four-vector is therefore:
It mag2 is negative mag = -Sqrt(-mag*mag). The member functions are:
Since in case of momentum and energy the magnitude has the meaning of invariant mass TLorentzVector provides the more meaningful aliases M2() and M(); The member functions Beta() and Gamma() returns beta and gamma = 1/Sqrt(1-beta*beta).
A boost in a general direction can be parameterised with three parameters which can be taken as the components of a three vector b = (bx,by,bz). With x = (x,y,z) and gamma = 1/Sqrt(1-beta*beta) (beta being the module of vector b), an arbitrary active Lorentz boost transformation (from the rod frame to the original frame) can be written as:
The member function Boost() performs a boost transformation from the rod frame to the original frame. BoostVector() returns a TVector3 of the spatial components divided by the time component:
There are four sets of functions to rotate the TVector3 component of a TLorentzVector:
v.Rotate(TMath::Pi()/4., v1); // rotation around v1
Member functions Plus() and Minus() return the positive and negative light-cone components:
CAVEAT: The values returned are T{+,-}Z. It is known that some authors find it easier to define these components as (T{+,-}Z)/sqrt(2). Thus check what definition is used in the physics you're working in and adapt your code accordingly.
A general Lorentz transformation see class TLorentzRotation can be used by the Transform() member function, the *= or operator of the TLorentzRotation class:
Definition at line 32 of file TLorentzVector.h.
Public Types | |
enum | { kX =0, kY =1, kZ =2, kT =3, kNUM_COORDINATES =4, kSIZE =kNUM_COORDINATES } |
typedef Double_t | Scalar |
Public Member Functions | |
TLorentzVector () | |
TLorentzVector (Double_t x, Double_t y, Double_t z, Double_t t) | |
TLorentzVector (const Double_t *carray) | |
TLorentzVector (const Float_t *carray) | |
TLorentzVector (const TVector3 &vector3, Double_t t) | |
TLorentzVector (const TLorentzVector &lorentzvector) | |
virtual | ~TLorentzVector () |
Double_t | Angle (const TVector3 &v) const |
Double_t | Beta () const |
void | Boost (Double_t, Double_t, Double_t) |
void | Boost (const TVector3 &) |
TVector3 | BoostVector () const |
Double_t | CosTheta () const |
Double_t | DeltaPhi (const TLorentzVector &) const |
Double_t | DeltaR (const TLorentzVector &) const |
Double_t | Dot (const TLorentzVector &) const |
Double_t | DrEtaPhi (const TLorentzVector &) const |
Double_t | E () const |
Double_t | Energy () const |
Double_t | Et () const |
Double_t | Et (const TVector3 &) const |
Double_t | Et2 () const |
Double_t | Et2 (const TVector3 &) const |
Double_t | Eta () const |
TVector2 | EtaPhiVector () |
Double_t | Gamma () const |
void | GetXYZT (Double_t *carray) const |
void | GetXYZT (Float_t *carray) const |
Double_t | M () const |
Double_t | M2 () const |
Double_t | Mag () const |
Double_t | Mag2 () const |
Double_t | Minus () const |
Double_t | Mt () const |
Double_t | Mt2 () const |
Bool_t | operator!= (const TLorentzVector &) const |
Double_t | operator() (int i) const |
Double_t & | operator() (int i) |
TLorentzVector | operator* (Double_t a) const |
Double_t | operator* (const TLorentzVector &) const |
TLorentzVector & | operator*= (Double_t a) |
TLorentzVector & | operator*= (const TRotation &) |
TLorentzVector & | operator*= (const TLorentzRotation &) |
TLorentzVector | operator+ (const TLorentzVector &) const |
TLorentzVector & | operator+= (const TLorentzVector &) |
TLorentzVector | operator- (const TLorentzVector &) const |
TLorentzVector | operator- () const |
TLorentzVector & | operator-= (const TLorentzVector &) |
TLorentzVector & | operator= (const TLorentzVector &) |
Bool_t | operator== (const TLorentzVector &) const |
Double_t | operator[] (int i) const |
Double_t & | operator[] (int i) |
Double_t | P () const |
Double_t | Perp () const |
Double_t | Perp (const TVector3 &v) const |
Double_t | Perp2 () const |
Double_t | Perp2 (const TVector3 &v) const |
Double_t | Phi () const |
Double_t | Plus () const |
virtual void | Print (Option_t *option="") const |
Print the TLorentz vector components as (x,y,z,t) and (P,eta,phi,E) representations. More... | |
Double_t | PseudoRapidity () const |
Double_t | Pt () const |
Double_t | Pt (const TVector3 &v) const |
Double_t | Px () const |
Double_t | Py () const |
Double_t | Pz () const |
Double_t | Rapidity () const |
Double_t | Rho () const |
void | Rotate (Double_t, const TVector3 &) |
void | RotateUz (TVector3 &newUzVector) |
void | RotateX (Double_t angle) |
void | RotateY (Double_t angle) |
void | RotateZ (Double_t angle) |
void | SetE (Double_t a) |
void | SetPerp (Double_t) |
void | SetPhi (Double_t phi) |
void | SetPtEtaPhiE (Double_t pt, Double_t eta, Double_t phi, Double_t e) |
void | SetPtEtaPhiM (Double_t pt, Double_t eta, Double_t phi, Double_t m) |
void | SetPx (Double_t a) |
void | SetPxPyPzE (Double_t px, Double_t py, Double_t pz, Double_t e) |
void | SetPy (Double_t a) |
void | SetPz (Double_t a) |
void | SetRho (Double_t rho) |
void | SetT (Double_t a) |
void | SetTheta (Double_t theta) |
void | SetVect (const TVector3 &vect3) |
void | SetVectM (const TVector3 &spatial, Double_t mass) |
void | SetVectMag (const TVector3 &spatial, Double_t magnitude) |
void | SetX (Double_t a) |
void | SetXYZM (Double_t x, Double_t y, Double_t z, Double_t m) |
void | SetXYZT (Double_t x, Double_t y, Double_t z, Double_t t) |
void | SetY (Double_t a) |
void | SetZ (Double_t a) |
Double_t | T () const |
Double_t | Theta () const |
TLorentzVector & | Transform (const TRotation &) |
TLorentzVector & | Transform (const TLorentzRotation &) |
TVector3 | Vect () const |
Double_t | X () const |
Double_t | Y () const |
Double_t | Z () const |
Private Attributes | |
Double_t | fE |
TVector3 | fP |
#include <TLorentzVector.h>
typedef Double_t TLorentzVector::Scalar |
Definition at line 41 of file TLorentzVector.h.
anonymous enum |
Enumerator | |
---|---|
kX | |
kY | |
kZ | |
kT | |
kNUM_COORDINATES | |
kSIZE |
Definition at line 43 of file TLorentzVector.h.
|
inline |
Definition at line 593 of file TLorentzVector.h.
|
inline |
Definition at line 596 of file TLorentzVector.h.
|
inline |
Definition at line 599 of file TLorentzVector.h.
|
inline |
Definition at line 602 of file TLorentzVector.h.
|
inline |
Definition at line 605 of file TLorentzVector.h.
|
inline |
Definition at line 608 of file TLorentzVector.h.
|
inlinevirtual |
Definition at line 61 of file TLorentzVector.h.
|
inline |
Definition at line 478 of file TLorentzVector.h.
|
inline |
Definition at line 503 of file TLorentzVector.h.
void TLorentzVector::Boost | ( | Double_t | bx, |
Double_t | by, | ||
Double_t | bz | ||
) |
Definition at line 250 of file TLorentzVector.cxx.
|
inline |
Definition at line 551 of file TLorentzVector.h.
|
inline |
Definition at line 547 of file TLorentzVector.h.
|
inline |
Definition at line 305 of file TLorentzVector.h.
|
inline |
Definition at line 456 of file TLorentzVector.h.
|
inline |
Definition at line 463 of file TLorentzVector.h.
|
inline |
Definition at line 520 of file TLorentzVector.h.
|
inline |
Definition at line 469 of file TLorentzVector.h.
|
inline |
Definition at line 285 of file TLorentzVector.h.
|
inline |
Definition at line 286 of file TLorentzVector.h.
|
inline |
Definition at line 440 of file TLorentzVector.h.
|
inline |
Definition at line 451 of file TLorentzVector.h.
|
inline |
Definition at line 435 of file TLorentzVector.h.
|
inline |
Definition at line 445 of file TLorentzVector.h.
|
inline |
Definition at line 460 of file TLorentzVector.h.
|
inline |
Definition at line 473 of file TLorentzVector.h.
|
inline |
Definition at line 507 of file TLorentzVector.h.
|
inline |
Definition at line 352 of file TLorentzVector.h.
|
inline |
Definition at line 357 of file TLorentzVector.h.
|
inline |
Definition at line 492 of file TLorentzVector.h.
|
inline |
Definition at line 491 of file TLorentzVector.h.
|
inline |
Definition at line 486 of file TLorentzVector.h.
|
inline |
Definition at line 482 of file TLorentzVector.h.
|
inline |
Definition at line 543 of file TLorentzVector.h.
|
inline |
Definition at line 498 of file TLorentzVector.h.
|
inline |
Definition at line 494 of file TLorentzVector.h.
|
inline |
Definition at line 409 of file TLorentzVector.h.
|
inline |
Definition at line 613 of file TLorentzVector.h.
|
inline |
Definition at line 631 of file TLorentzVector.h.
|
inline |
Definition at line 401 of file TLorentzVector.h.
|
inline |
Definition at line 524 of file TLorentzVector.h.
|
inline |
Definition at line 395 of file TLorentzVector.h.
|
inline |
Definition at line 579 of file TLorentzVector.h.
TLorentzVector & TLorentzVector::operator*= | ( | const TLorentzRotation & | m | ) |
Definition at line 270 of file TLorentzVector.cxx.
|
inline |
Definition at line 371 of file TLorentzVector.h.
|
inline |
Definition at line 375 of file TLorentzVector.h.
|
inline |
Definition at line 381 of file TLorentzVector.h.
|
inline |
Definition at line 391 of file TLorentzVector.h.
|
inline |
Definition at line 385 of file TLorentzVector.h.
|
inline |
Definition at line 365 of file TLorentzVector.h.
|
inline |
Definition at line 405 of file TLorentzVector.h.
|
inline |
Definition at line 363 of file TLorentzVector.h.
|
inline |
Definition at line 362 of file TLorentzVector.h.
|
inline |
Definition at line 284 of file TLorentzVector.h.
|
inline |
Definition at line 415 of file TLorentzVector.h.
|
inline |
Definition at line 427 of file TLorentzVector.h.
|
inline |
Definition at line 413 of file TLorentzVector.h.
|
inline |
Definition at line 423 of file TLorentzVector.h.
|
inline |
Definition at line 297 of file TLorentzVector.h.
|
inline |
Definition at line 539 of file TLorentzVector.h.
|
virtual |
Print the TLorentz vector components as (x,y,z,t) and (P,eta,phi,E) representations.
Definition at line 310 of file TLorentzVector.cxx.
|
inline |
Definition at line 555 of file TLorentzVector.h.
|
inline |
Definition at line 417 of file TLorentzVector.h.
|
inline |
Definition at line 431 of file TLorentzVector.h.
|
inline |
Definition at line 281 of file TLorentzVector.h.
|
inline |
Definition at line 282 of file TLorentzVector.h.
|
inline |
Definition at line 283 of file TLorentzVector.h.
Double_t TLorentzVector::Rapidity | ( | ) | const |
Definition at line 264 of file TLorentzVector.cxx.
|
inline |
Definition at line 310 of file TLorentzVector.h.
|
inline |
Definition at line 575 of file TLorentzVector.h.
|
inline |
Definition at line 571 of file TLorentzVector.h.
|
inline |
Definition at line 559 of file TLorentzVector.h.
|
inline |
Definition at line 563 of file TLorentzVector.h.
|
inline |
Definition at line 567 of file TLorentzVector.h.
|
inline |
Definition at line 291 of file TLorentzVector.h.
|
inline |
Definition at line 419 of file TLorentzVector.h.
|
inline |
Definition at line 318 of file TLorentzVector.h.
|
inline |
Definition at line 347 of file TLorentzVector.h.
|
inline |
Definition at line 342 of file TLorentzVector.h.
|
inline |
Definition at line 288 of file TLorentzVector.h.
|
inline |
Definition at line 331 of file TLorentzVector.h.
|
inline |
Definition at line 289 of file TLorentzVector.h.
|
inline |
Definition at line 290 of file TLorentzVector.h.
|
inline |
Definition at line 322 of file TLorentzVector.h.
|
inline |
Definition at line 279 of file TLorentzVector.h.
|
inline |
Definition at line 314 of file TLorentzVector.h.
|
inline |
Definition at line 295 of file TLorentzVector.h.
|
inline |
Definition at line 516 of file TLorentzVector.h.
|
inline |
Definition at line 512 of file TLorentzVector.h.
|
inline |
Definition at line 276 of file TLorentzVector.h.
|
inline |
Definition at line 335 of file TLorentzVector.h.
|
inline |
Definition at line 326 of file TLorentzVector.h.
|
inline |
Definition at line 277 of file TLorentzVector.h.
|
inline |
Definition at line 278 of file TLorentzVector.h.
|
inline |
Definition at line 274 of file TLorentzVector.h.
|
inline |
Definition at line 301 of file TLorentzVector.h.
|
inline |
Definition at line 584 of file TLorentzVector.h.
TLorentzVector & TLorentzVector::Transform | ( | const TLorentzRotation & | m | ) |
Definition at line 276 of file TLorentzVector.cxx.
|
inline |
Definition at line 293 of file TLorentzVector.h.
|
inline |
Definition at line 271 of file TLorentzVector.h.
|
inline |
Definition at line 272 of file TLorentzVector.h.
|
inline |
Definition at line 273 of file TLorentzVector.h.
|
private |
Definition at line 37 of file TLorentzVector.h.
|
private |
Definition at line 36 of file TLorentzVector.h.