CMS 3D CMS Logo

MCFilterZboostHelper.cc
Go to the documentation of this file.
2 
3 HepMC::FourVector MCFilterZboostHelper::zboost(const HepMC::FourVector& mom, double betaBoost) {
4  //Boost this Lorentz vector (from TLorentzVector::Boost)
5  double b2 = betaBoost*betaBoost;
6  double gamma = 1.0 / sqrt(1.0 - b2);
7  double bp = betaBoost*mom.pz();
8  double gamma2 = b2 > 0 ? (gamma - 1.0)/b2 : 0.0;
9 
10  return HepMC::FourVector(mom.px(), mom.py(), mom.pz() + gamma2*bp*betaBoost + gamma*betaBoost*mom.e(), gamma*(mom.e()+bp));
11 }
HepMC::FourVector zboost(const HepMC::FourVector &, double)
T sqrt(T t)
Definition: SSEVec.h:18