GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
genie::utils::math::LongLorentzVector Class Reference

#include <MathUtils.h>

Public Member Functions

 LongLorentzVector (double px, double py, double pz, double e)
 
 LongLorentzVector (const TLorentzVector &p4)
 
 ~LongLorentzVector ()
 
long double Px (void)
 
long double Py (void)
 
long double Pz (void)
 
long double E (void)
 
long double P (void)
 
long double M (void)
 
long double M2 (void)
 
long double Dx (void)
 
long double Dy (void)
 
long double Dz (void)
 
void Rotate (LongLorentzVector axis)
 
void BoostZ (long double bz)
 
void BoostY (long double by)
 

Private Attributes

long double fPx
 
long double fPy
 
long double fPz
 
long double fE
 

Detailed Description

Definition at line 40 of file MathUtils.h.

Constructor & Destructor Documentation

genie::utils::math::LongLorentzVector::LongLorentzVector ( double  px,
double  py,
double  pz,
double  e 
)
inline

Definition at line 43 of file MathUtils.h.

References fE, fPx, fPy, and fPz.

43  {
44  fPx = (long double) px;
45  fPy = (long double) py;
46  fPz = (long double) pz;
47  fE = (long double) e;
48  }
const double e
genie::utils::math::LongLorentzVector::LongLorentzVector ( const TLorentzVector &  p4)
inline

Definition at line 49 of file MathUtils.h.

References fE, fPx, fPy, and fPz.

49  {
50  fPx = (long double) p4.Px();
51  fPy = (long double) p4.Py();
52  fPz = (long double) p4.Pz();
53  fE = (long double) p4.E();
54  }
genie::utils::math::LongLorentzVector::~LongLorentzVector ( )
inline

Definition at line 55 of file MathUtils.h.

55 {}

Member Function Documentation

void genie::utils::math::LongLorentzVector::BoostY ( long double  by)
inline

Definition at line 92 of file MathUtils.h.

References fE, and fPy.

Referenced by genie::PhotonCOHGenerator::ProcessEventRecord().

92  {
93  long double b2 = by*by;
94  long double gamma = 1.0 / sqrtl(1.0 - b2);
95  long double bp = by*fPy;
96  long double gamma2 = b2 > 0 ? (gamma - 1.0)/b2 : 0.0;
97  fPy = fPy + gamma2*bp*by + gamma*by*fE;
98  fE = gamma*(fE + bp);
99  }
void genie::utils::math::LongLorentzVector::BoostZ ( long double  bz)
inline

Definition at line 83 of file MathUtils.h.

References fE, and fPz.

Referenced by genie::LeptoHadronization::Hadronize(), genie::HENuElGenerator::ProcessEventRecord(), genie::PhotonCOHGenerator::ProcessEventRecord(), genie::PhotonRESGenerator::ProcessEventRecord(), and genie::GLRESGenerator::ProcessEventRecord().

83  {
84  long double b2 = bz*bz;
85  long double gamma = 1.0 / sqrtl(1.0 - b2);
86  long double bp = bz*fPz;
87  long double gamma2 = b2 > 0 ? (gamma - 1.0)/b2 : 0.0;
88  fPz = fPz + gamma2*bp*bz + gamma*bz*fE;
89  fE = gamma*(fE + bp);
90  }
long double genie::utils::math::LongLorentzVector::Dx ( void  )
inline

Definition at line 64 of file MathUtils.h.

References fPx, fPy, and fPz.

Referenced by genie::HEDISGenerator::AddPrimaryLepton(), and Rotate().

long double genie::utils::math::LongLorentzVector::Dy ( void  )
inline

Definition at line 65 of file MathUtils.h.

References fPx, fPy, and fPz.

Referenced by genie::HEDISGenerator::AddPrimaryLepton(), and Rotate().

long double genie::utils::math::LongLorentzVector::Dz ( void  )
inline

Definition at line 66 of file MathUtils.h.

References fPx, fPy, and fPz.

Referenced by genie::HEDISGenerator::AddPrimaryLepton(), and Rotate().

long double genie::utils::math::LongLorentzVector::E ( void  )
inline
long double genie::utils::math::LongLorentzVector::M ( void  )
inline

Definition at line 62 of file MathUtils.h.

References fE, fPx, fPy, and fPz.

Referenced by genie::HEDISGenerator::AddPrimaryLepton().

long double genie::utils::math::LongLorentzVector::M2 ( void  )
inline

Definition at line 63 of file MathUtils.h.

References fE, fPx, fPy, and fPz.

long double genie::utils::math::LongLorentzVector::P ( void  )
inline

Definition at line 61 of file MathUtils.h.

References fPx, fPy, and fPz.

Referenced by genie::HEDISGenerator::AddPrimaryLepton().

long double genie::utils::math::LongLorentzVector::Px ( void  )
inline
long double genie::utils::math::LongLorentzVector::Py ( void  )
inline
long double genie::utils::math::LongLorentzVector::Pz ( void  )
inline
void genie::utils::math::LongLorentzVector::Rotate ( LongLorentzVector  axis)
inline

Definition at line 68 of file MathUtils.h.

References Dx(), Dy(), Dz(), fPx, fPy, and fPz.

Referenced by genie::HEDISGenerator::AddPrimaryLepton().

68  {
69  long double up = axis.Dx()*axis.Dx() + axis.Dy()*axis.Dy();
70  if (up) {
71  up = sqrtl(up);
72  long double pxaux = fPx, pyaux = fPy, pzaux = fPz;
73  fPx = (axis.Dx()*axis.Dz()*pxaux - axis.Dy()*pyaux + axis.Dx()*up*pzaux)/up;
74  fPy = (axis.Dy()*axis.Dz()*pxaux + axis.Dx()*pyaux + axis.Dy()*up*pzaux)/up;
75  fPz = (axis.Dz()*axis.Dz()*pxaux - pxaux + axis.Dz()*up*pzaux)/up;
76  }
77  else if (axis.Dz() < 0.) { // phi=0 teta=pi
78  fPx = -fPx;
79  fPz = -fPz;
80  }
81  }

Member Data Documentation

long double genie::utils::math::LongLorentzVector::fE
private

Definition at line 106 of file MathUtils.h.

Referenced by BoostY(), BoostZ(), E(), LongLorentzVector(), M(), and M2().

long double genie::utils::math::LongLorentzVector::fPx
private

Definition at line 103 of file MathUtils.h.

Referenced by Dx(), Dy(), Dz(), LongLorentzVector(), M(), M2(), P(), Px(), and Rotate().

long double genie::utils::math::LongLorentzVector::fPy
private

Definition at line 104 of file MathUtils.h.

Referenced by BoostY(), Dx(), Dy(), Dz(), LongLorentzVector(), M(), M2(), P(), Py(), and Rotate().

long double genie::utils::math::LongLorentzVector::fPz
private

Definition at line 105 of file MathUtils.h.

Referenced by BoostZ(), Dx(), Dy(), Dz(), LongLorentzVector(), M(), M2(), P(), Pz(), and Rotate().


The documentation for this class was generated from the following file: