public:
TLorentzVector TLorentzVector(Double_t x = 0.0, Double_t y = 0.0, Double_t z = 0.0, Double_t t = 0.0) TLorentzVector TLorentzVector(Double_t* carray) TLorentzVector TLorentzVector(Float_t* carray) TLorentzVector TLorentzVector(TVector3& vector3, Double_t t) TLorentzVector TLorentzVector(TLorentzVector& lorentzvector) TLorentzVector operator+(TLorentzVector& q) TLorentzVector operator-(TLorentzVector& q) TLorentzVector operator-() TLorentzVector operator*(Double_t a) void ~TLorentzVector() Double_t Angle(TVector3& v) Double_t Beta() void Boost(Double_t, Double_t, Double_t) void Boost(TVector3& b) TVector3 BoostVector() TClass* Class() Double_t CosTheta() Double_t DeltaPhi(TLorentzVector& v) Double_t DeltaR(TLorentzVector& v) Double_t Dot(TLorentzVector& q) Double_t DrEtaPhi(TLorentzVector& v) Double_t E() Double_t Energy() Double_t Eta() TVector2 EtaPhiVector() Double_t Gamma() virtual TClass* IsA() Double_t M() Double_t M2() Double_t Mag() Double_t Mag2() Double_t Minus() Double_t Mt() Double_t Mt2() Bool_t operator!=(TLorentzVector& q) Double_t operator()(int i) Double_t operator*(TLorentzVector& q) TLorentzVector& operator*=(Double_t a) TLorentzVector& operator*=(TRotation& m) TLorentzVector& operator*=(TLorentzRotation&) TLorentzVector& operator+=(TLorentzVector& q) TLorentzVector& operator-=(TLorentzVector& q) TLorentzVector& operator=(TLorentzVector& q) Bool_t operator==(TLorentzVector& q) Double_t operator[](int i) Double_t Perp() Double_t Perp(TVector3& v) Double_t Perp2() Double_t Perp2(TVector3& v) Double_t Phi() Double_t Plus() Double_t PseudoRapidity() Double_t Pt() Double_t Pt(TVector3& v) Double_t Px() Double_t Py() Double_t Pz() Double_t Rapidity() Double_t Rho() void Rotate(Double_t a, TVector3& v) 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 r) 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(TVector3& vect3) void SetVectM(TVector3& spatial, Double_t mass) void SetVectMag(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) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) Double_t T() Double_t Theta() TLorentzVector& Transform(TRotation& m) TLorentzVector& Transform(TLorentzRotation&) TVector3 Vect() Double_t X() Double_t Y() Double_t Z()Data Members
private:
Double_t fX x or px Double_t fY y or py Double_t fZ z or pz Double_t fE time or energy of (x,y,z,t) or (px,py,pz,e) public:
static const enum TObject:: kX static const enum TObject:: kY static const enum TObject:: kZ static const enum TObject:: kT static const enum TObject:: kNUM_COORDINATES static const enum TObject:: kSIZE
*-*-*-*-*-*-*-*-*-*-*-*The Physics Vector package *-*-*-*-*-*-*-*-*-*-*-* *-* ========================== * *-* The Physics Vector package consists of five classes: * *-* - TVector2 * *-* - TVector3 * *-* - TRotation * *-* - TLorentzVector * *-* - TLorentzRotation * *-* It is a combination of CLHEPs Vector package written by * *-* Leif Lonnblad, Andreas Nilsson and Evgueni Tcherniaev * *-* and a ROOT package written by Pasha Murat. * *-* for CLHEP see: http://wwwinfo.cern.ch/asd/lhc++/clhep/ * *-* Adaption to ROOT by Peter Malzacher * *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* /*
TLorentzVector v1; // initialized
by (0., 0., 0., 0.)
TLorentzVector v2(1., 1., 1., 1.);
TLorentzVector v3(v1);
TLorentzVector v4(TVector3(1., 2., 3.),4.);
For backward compatibility there are two constructors from an Double_t
and Float_t C array.
Double_t xx =v.X();
...
Double_t tt = v.T();
Double_t px = v.Px();
...
Double_t ee = v.E();
The components of TLorentzVector can also accessed by index:
xx = v(0); or
xx = v[0];
yy = v(1);
yy = v[1];
zz = v(2);
zz = v[2];
tt = v(3);
tt = v[3];
You can use the Vect() member function to get the vector component of TLorentzVector:
TVector3 p = v.Vect();
For setting components also two sets of member functions can be used:
SetX(),.., SetPx(),..:
v.SetX(1.); or
v.SetPx(1.);
...
...
v.SetT(1.);
v.SetE(1.);
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():
v.SetVect(TVector3(1,2,3));
v.SetXYZT(x,y,z,t);
v.SetPxPyPzE(px,py,pz,e);
v.SetXYZM(x,y,z,m); // ->
v=(x,y,z,e=Sqrt(x*x+y*y+z*z+m*m))
Double_t m, theta, cost, phi, pp, pp2, ppv2, pp2v2;
m = v.Rho();
t = v.Theta();
cost = v.CosTheta();
phi = v.Phi();
v.SetRho(10.);
v.SetTheta(TMath::Pi()*.3);
v.SetPhi(TMath::Pi());
or get infoormation about the r-coordinate in cylindrical systems:
Double_t pp, pp2, ppv2, pp2v2;
pp = v.Perp(); // get transvers component
pp2 = v.Perp2(); // get transverse component squared
ppv2 = v.Perp(v1); // get
transvers component with
// respect to another vector
pp2v2 = v.Perp(v1);
for convenience there are two more set functions SetPtEtaPhiE(pt,eta,phi,e); and SetPtEtaPhiM(pt,eta,phi,m);
v3 = -v1;
v1 = v2+v3;
v1+= v3;
v1 = v2 + v3;
v1-= v3;
if (v1 == v2) {...}
if(v1 != v3) {...}
Double_t s, s2;
s = v1.Dot(v2); // scalar
product
s = v1*v2; // scalar product
s2 = v.Mag2(); or s2 = v.M2();
s = v.Mag();
s = v.M();
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).
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:
TVector3 b;
v.Boost(bx,by,bz);
v.Boost(b);
b = v.BoostVector(); // b=(x/t,y/t,z/t)
Double_t pcone = v.Plus();
Double_t mcone = v.Minus();
TLorentzRotation l;
v.Transform(l);
v = l*v; or
v *= l; // Attention v = l*v
*/
NewUzVector must be normalized !
Double_t X() Double_t Y() Double_t Z() Double_t T() void SetX(Double_t a) void SetY(Double_t a) void SetZ(Double_t a) void SetT(Double_t a) Double_t Px() Double_t Py() Double_t Pz() Double_t E() Double_t Energy() void SetPx(Double_t a) void SetPy(Double_t a) void SetPz(Double_t a) void SetE(Double_t a) TVector3 Vect() void SetVect(TVector3& vect3) Double_t Theta() Double_t CosTheta() Double_t Phi() Double_t Rho() void SetTheta(Double_t theta) void SetPhi(Double_t phi) void SetRho(Double_t rho) void SetPxPyPzE(Double_t px, Double_t py, Double_t pz, Double_t e) void SetXYZT(Double_t x, Double_t y, Double_t z, Double_t t) void SetXYZM(Double_t x, Double_t y, Double_t z, Double_t m) void SetPtEtaPhiM(Double_t pt, Double_t eta, Double_t phi, Double_t m) void SetPtEtaPhiE(Double_t pt, Double_t eta, Double_t phi, Double_t e) Double_t operator()(int i) Double_t operator[](int i) TLorentzVector& operator=(TLorentzVector& q) TLorentzVector operator+(TLorentzVector& q) TLorentzVector& operator+=(TLorentzVector& q) TLorentzVector operator-(TLorentzVector& q) TLorentzVector& operator-=(TLorentzVector& q) TLorentzVector operator-() TLorentzVector operator*(Double_t a) TLorentzVector& operator*=(Double_t a) Bool_t operator==(TLorentzVector& q) Bool_t operator!=(TLorentzVector& q) Double_t Perp2() Double_t Pt() Double_t Perp() void SetPerp(Double_t r) Double_t Perp2(TVector3& v) Double_t Pt(TVector3& v) Double_t Perp(TVector3& v) Double_t DeltaPhi(TLorentzVector& v) Double_t DeltaR(TLorentzVector& v) Double_t DrEtaPhi(TLorentzVector& v) TVector2 EtaPhiVector() Double_t Angle(TVector3& v) Double_t Mag2() Double_t M2() Double_t Mag() Double_t M() Double_t Mt2() Double_t Mt() Double_t Beta() Double_t Gamma() Double_t Dot(TLorentzVector& q) Double_t operator*(TLorentzVector& q) void SetVectMag(TVector3& spatial, Double_t magnitude) void SetVectM(TVector3& spatial, Double_t mass) Double_t Plus() Double_t Minus() TVector3 BoostVector() void Boost(TVector3& b) Double_t Eta() Double_t PseudoRapidity() void Rotate(Double_t a, TVector3& v) TLorentzVector& operator*=(TRotation& m) TLorentzVector& Transform(TRotation& m) TLorentzVector& operator*=(TLorentzRotation&) TLorentzVector& Transform(TLorentzRotation&) TClass* Class() TClass* IsA() void ShowMembers(TMemberInspector& insp, char* parent) void Streamer(TBuffer& b) void ~TLorentzVector()