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 Boost (long double bz)
 

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.

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.

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::Boost ( long double  bz)
inline

Definition at line 83 of file MathUtils.h.

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  }
double gamma(double KE, const simb::MCParticle *part)
long double genie::utils::math::LongLorentzVector::Dx ( void  )
inline

Definition at line 64 of file MathUtils.h.

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

Definition at line 65 of file MathUtils.h.

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

Definition at line 66 of file MathUtils.h.

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

Definition at line 60 of file MathUtils.h.

60 { return fE; }
long double genie::utils::math::LongLorentzVector::M ( void  )
inline

Definition at line 62 of file MathUtils.h.

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

Definition at line 61 of file MathUtils.h.

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

Definition at line 57 of file MathUtils.h.

57 { return fPx; }
long double genie::utils::math::LongLorentzVector::Py ( void  )
inline

Definition at line 58 of file MathUtils.h.

58 { return fPy; }
long double genie::utils::math::LongLorentzVector::Pz ( void  )
inline

Definition at line 59 of file MathUtils.h.

59 { return fPz; }
void genie::utils::math::LongLorentzVector::Rotate ( LongLorentzVector  axis)
inline

Definition at line 68 of file MathUtils.h.

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 98 of file MathUtils.h.

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

Definition at line 95 of file MathUtils.h.

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

Definition at line 96 of file MathUtils.h.

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

Definition at line 97 of file MathUtils.h.


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