File indexing completed on 2024-04-06 12:13:40
0001 #include "GeneratorInterface/GenFilters/plugins/MCFilterZboostHelper.h"
0002
0003 #include <cmath>
0004
0005 HepMC::FourVector MCFilterZboostHelper::zboost(const HepMC::FourVector& mom, double betaBoost) {
0006
0007 double b2 = betaBoost * betaBoost;
0008 double gamma = 1.0 / std::sqrt(1.0 - b2);
0009 double bp = betaBoost * mom.pz();
0010 double gamma2 = b2 > 0 ? (gamma - 1.0) / b2 : 0.0;
0011
0012 return HepMC::FourVector(
0013 mom.px(), mom.py(), mom.pz() + gamma2 * bp * betaBoost + gamma * betaBoost * mom.e(), gamma * (mom.e() + bp));
0014 }