262 ClassImp(TLorentzVector);
265 void TLorentzVector::Boost(Double_t bx, Double_t by, Double_t bz)
268 Double_t b2 = bx*bx + by*by + bz*bz;
269 Double_t gamma = 1.0 / TMath::Sqrt(1.0 - b2);
270 Double_t bp = bx*X() + by*Y() + bz*Z();
271 Double_t gamma2 = b2 > 0 ? (gamma - 1.0)/b2 : 0.0;
273 SetX(X() + gamma2*bp*bx + gamma*bx*T());
274 SetY(Y() + gamma2*bp*by + gamma*by*T());
275 SetZ(Z() + gamma2*bp*bz + gamma*bz*T());
276 SetT(gamma*(T() + bp));
279 Double_t TLorentzVector::Rapidity()
const
282 return 0.5*log( (E()+Pz()) / (E()-Pz()) );
285 TLorentzVector &TLorentzVector::operator *= (
const TLorentzRotation & m)
288 return *
this = m.VectorMultiplication(*
this);
291 TLorentzVector &TLorentzVector::Transform(
const TLorentzRotation & m)
294 return *
this = m.VectorMultiplication(*
this);
297 void TLorentzVector::Streamer(TBuffer &R__b)
302 if (R__b.IsReading()) {
303 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
305 R__b.ReadClassBuffer(TLorentzVector::Class(),
this, R__v, R__s, R__c);
309 if (R__v != 2) TObject::Streamer(R__b);
315 R__b.CheckByteCount(R__s, R__c, TLorentzVector::IsA());
317 R__b.WriteClassBuffer(TLorentzVector::Class(),
this);
325 void TLorentzVector::Print(Option_t *)
const
327 Printf(
"(x,y,z,t)=(%f,%f,%f,%f) (P,eta,phi,E)=(%f,%f,%f,%f)",
328 fP.x(),fP.y(),fP.z(),fE,