TLorentzVector v; double pt = 50, eta = 2.5, phi = 0, m = 0; double e = sqrt(m*m + pt*pt/cosh(eta)/cosh(eta)); v.SetPtEtaPhiE(pt, eta, phi, e);
TLorentzVector v; double pt = 20, phi = TMath::PiOver2(), m = 0; double eta = -log(tan(0.5 * acos(-1) - 2.0 * atan(exp(-phi)))); double e = sqrt(m*m + pt*pt/cosh(eta)/cosh(eta)); v.SetPtEtaPhiE(pt, eta, phi, e);This example sets a TLorentzVector with a transverse momentum of 20 GeV/c, azimuthal angle of pi/2, and calculates the pseudorapidity and energy using appropriate formulas. Overall, TLorentzVector is a powerful tool in high-energy physics and particle physics to represent and manipulate four-vectors. It is available in the ROOT package library.