18 #ifndef _MATH_UTILS_H_
19 #define _MATH_UTILS_H_
24 #include <TLorentzVector.h>
44 fPx = (
long double) px;
45 fPy = (
long double) py;
46 fPz = (
long double) pz;
50 fPx = (
long double) p4.Px();
51 fPy = (
long double) p4.Py();
52 fPz = (
long double) p4.Pz();
53 fE = (
long double) p4.E();
57 long double Px (
void) {
return fPx; }
58 long double Py (
void) {
return fPy; }
59 long double Pz (
void) {
return fPz; }
60 long double E (
void) {
return fE; }
69 long double up = axis.
Dx()*axis.
Dx() + axis.
Dy()*axis.
Dy();
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;
77 else if (axis.
Dz() < 0.) {
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;
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;
121 bool AreEqual (
double x1,
double x2);
135 #endif // _MATH_UTILS_H_
A simple [min,max] interval for integers.
void BoostY(long double by)
bool AreEqual(double x1, double x2)
A simple [min,max] interval for doubles.
TVectorD CholeskyGenerateCorrelatedParams(const TMatrixD &Lch, TVectorD &mean)
bool IsWithinLimits(double x, Range1D_t range)
A simple [min,max] interval for floats.
TVectorD CholeskyCalculateCorrelatedParamVariations(const TMatrixD &Lch, TVectorD &g_uncorrelated)
TMatrixD CholeskyDecomposition(const TMatrixD &cov)
double KahanSummation(double x[], unsigned int n)
LongLorentzVector(double px, double py, double pz, double e)
LongLorentzVector(const TLorentzVector &p4)
void BoostZ(long double bz)
TVectorD CholeskyGenerateCorrelatedParamVariations(const TMatrixD &Lch)
double NonNegative(double x)
void Rotate(LongLorentzVector axis)