71 __host__ __device__
inline Vector4R();
74 __host__ __device__
inline Vector4R(
const Vector4R& other);
80 __host__ __device__
inline Vector4R&
operator=(
const Vector4R& v2);
81 __host__ __device__
inline Vector4R&
operator+=(
const Vector4R& v2);
82 __host__ __device__
inline Vector4R&
operator-=(
const Vector4R& v2);
84 __host__ __device__
inline GReal_t cont(
const Vector4R& v4)
const;
85 __host__
inline friend std::ostream&
operator<<(std::ostream& s,
91 __host__ __device__
inline void applyBoostTo(
const Vector4R& p4,
92 bool inverse =
false);
94 bool inverse =
false);
97 __host__ __device__
inline Vector4R
cross(
const Vector4R& v2);
98 __host__ __device__
inline GReal_t dot(
const Vector4R& v2)
const;
103 const Vector4R& p2,
const Vector4R& p3)
const;
104 __host__ __device__
inline GReal_t dotr3(
const Vector4R& p1,
105 const Vector4R& p2)
const;
106 __host__ __device__
inline GReal_t mag2r3(
const Vector4R& p1)
const;
107 __host__ __device__
inline GReal_t magr3(
const Vector4R& p1)
const;
124 bool inverse =
false);
162 return v[0] * v[0] - v[1] * v[1] - v[2] * v[2] - v[3] * v[3];
209 return v1.v[0] * v2.v[0] - v1.v[1] * v2.v[1] - v1.v[2] * v2.v[2]
216 return v[0] * v4.v[0] - v[1] * v4.v[1] - v[2] * v4.v[2] - v[3] * v4.v[3];
283 GReal_t m2 = v[0] * v[0] - v[1] * v[1] - v[2] * v[2] - v[3] * v[3];
333 GReal_t x = (ck * ct * cp - sk * sp) * v[1]
334 + (-sk * ct * cp - ck * sp) * v[2] + st * cp * v[3];
335 GReal_t y = (ck * ct * sp + sk * cp) * v[1]
336 + (-sk * ct * sp + ck * cp) * v[2] + st * sp * v[3];
337 GReal_t z = -ck * st * v[1] + sk * st * v[2] + ct * v[3];
348 s <<
"(" << v.v[0] <<
"," << v.v[1] <<
"," << v.v[2] <<
"," << v.v[3]
381 b2 = bxx + byy + bzz;
383 if (b2 > 0.0 && b2 < 1.0)
386 gamma = 1.0 / sqrt(1.0 - b2);
388 GReal_t gb2 = (gamma - 1.0) / b2;
405 v[0] = gamma * e2 - gbx * px2 - gby * py2 - gbz * pz2;
407 v[1] = -gbx * e2 + gb2 * bxx * px2 + px2 + gb2xy * py2
410 v[2] = -gby * e2 + gb2 * byy * py2 + py2 + gb2xy * px2
413 v[3] = -gbz * e2 + gb2 * bzz * pz2 + pz2 + gb2yz * py2
418 v[0] = gamma * e2 + gbx * px2 + gby * py2 + gbz * pz2;
420 v[1] = gbx * e2 + gb2 * bxx * px2 + px2 + gb2xy * py2 + gb2xz * pz2;
422 v[2] = gby * e2 + gb2 * byy * py2 + py2 + gb2xy * px2 + gb2yz * pz2;
424 v[3] = gbz * e2 + gb2 * bzz * pz2 + pz2 + gb2yz * py2 + gb2xz * px2;
431 const GReal_t bz,
bool inverse)
440 b2 = bxx + byy + bzz;
442 if (b2 > 0.0 && b2 < 1.0)
445 gamma = 1.0 / sqrt(1.0 - b2);
447 GReal_t gb2 = (gamma - 1.0) / b2;
464 v[0] = gamma * e2 - gbx * px2 - gby * py2 - gbz * pz2;
466 v[1] = -gbx * e2 + gb2 * bxx * px2 + px2 + gb2xy * py2
469 v[2] = -gby * e2 + gb2 * byy * py2 + py2 + gb2xy * px2
472 v[3] = -gbz * e2 + gb2 * bzz * pz2 + pz2 + gb2yz * py2
477 v[0] = gamma * e2 + gbx * px2 + gby * py2 + gbz * pz2;
479 v[1] = gbx * e2 + gb2 * bxx * px2 + px2 + gb2xy * py2 + gb2xz * pz2;
481 v[2] = gby * e2 + gb2 * byy * py2 + py2 + gb2xy * px2 + gb2yz * pz2;
483 v[3] = gbz * e2 + gb2 * bzz * pz2 + pz2 + gb2yz * py2 + gb2xz * px2;
497 temp.v[1] = v[2] * p2.v[3] - v[3] * p2.v[2];
498 temp.v[2] = v[3] * p2.v[1] - v[1] * p2.v[3];
499 temp.v[3] = v[1] * p2.v[2] - v[2] * p2.v[1];
510 temp = v[1] * v[1] + v[2] * v[2] + v[3] * v[3];
525 temp = v[1] * p2.v[1];
526 temp += v[2] * p2.v[2];
527 temp += v[3] * p2.v[3];
538 return 1 /
mass2() * ((*this) * p1) * ((*
this) * p2) - p1 * p2;
545 return Square((*
this) * p1) /
mass2() - p1.
mass2();
__host__ __device__ friend Vector4R operator/(const Vector4R &v2, GReal_t d)
__host__ __device__ friend Vector4R operator*(GReal_t d, const Vector4R &v2)
__host__ __device__ GReal_t get(GInt_t i) const
__host__ __device__ Vector4R cross(const Vector4R &v2)
__host__ __device__ Vector4R & operator/=(GReal_t c)
__host__ __device__ GReal_t mag2r3(const Vector4R &p1) const
__host__ __device__ GReal_t d3mag() const
__host__ __device__ Vector4R & operator*=(GReal_t c)
__host__ __device__ Vector4R & operator=(const Vector4R &v2)
Vector3R operator+(const Vector3R &v1, const Vector3R &v2)
__host__ __device__ GReal_t dotr3(const Vector4R &p1, const Vector4R &p2) const
Vector3R rotateEuler(const Vector3R &v, GReal_t alpha, GReal_t beta, GReal_t gamma)
__host__ __device__ GReal_t get(GInt_t i) const
__host__ __device__ GReal_t mass2() const
__host__ __device__ Vector4R & operator-=(const Vector4R &v2)
__host__ __device__ Vector4R & operator+=(const Vector4R &v2)
__host__ __device__ GReal_t scalartripler3(const Vector4R &p1, const Vector4R &p2, const Vector4R &p3) const
__host__ __device__ GReal_t dot(const Vector4R &v2) const
__host__ __device__ void set(GInt_t i, GReal_t d)
Vector4R boostTo(const Vector4R &rs, const Vector4R &p4, bool inverse=false)
Vector3R operator/(const Vector3R &v1, GReal_t c)
ostream & operator<<(ostream &s, const Vector3R &v)
double GReal_t
Double 8 bytes or float 4 bytes.
__host__ __device__ void applyBoostTo(const Vector4R &p4, bool inverse=false)
__host__ __device__ GReal_t magr3(const Vector4R &p1) const
__host__ __device__ friend Vector4R operator-(const Vector4R &v1, const Vector4R &v2)
Vector3R operator-(const Vector3R &v1, const Vector3R &v2)
__host__ friend std::ostream & operator<<(std::ostream &s, const Vector4R &v)
Vector3R operator*(GReal_t c, const Vector3R &v2)
int GInt_t
Signed integer 4 bytes (int)
__host__ __device__ Vector4R()
__host__ __device__ GReal_t cont(const Vector4R &v4) const
__host__ __device__ void applyRotateEuler(GReal_t alpha, GReal_t beta, GReal_t gamma)
__host__ __device__ friend Vector4R operator+(const Vector4R &v1, const Vector4R &v2)
__host__ __device__ GReal_t mass() const