12#ifndef ROOT_TEveVector
13#define ROOT_TEveVector
32 template <
typename OO>
44 Error(
"TEveVectorT",
"Subsequent nembers cannot be accessed as array!");
50 Error(
"TEveVectorT",
"Subsequent nembers cannot be accessed as array!");
57 "Subsequent nembers cannot be accessed as array!");
63 "Subsequent nembers cannot be accessed as array!");
68 operator const TT*()
const {
return Arr(); }
69 operator TT*() {
return Arr(); }
83 template <
typename OO>
141 Float_t ptot =
Mag();
return ptot == 0 ? 1 : fZ/ptot;
149 (fY -
b.fY)*(fY -
b.fY) +
150 (fZ -
b.fZ)*(fZ -
b.fZ));
157 return ((fX -
b.fX) * (fX -
b.fX) +
158 (fY -
b.fY) * (fY -
b.fY) +
159 (fZ -
b.fZ) * (fZ -
b.fZ));
166 return a.fX*fX +
a.fY*fY +
a.fZ*fZ;
174 r.fX = fY *
a.fZ - fZ *
a.fY;
175 r.fY = fZ *
a.fX - fX *
a.fZ;
176 r.fZ = fX *
a.fY - fY *
a.fX;
237template <
typename TT>
246 template <
typename OO>
248 template <
typename OO>
250 template <
typename OO>
262 using TP::operator+=;
263 using TP::operator-=;
305template <
typename TT>
312 template <
typename OO>
320 operator const TT*()
const {
return &
fX; }
321 operator TT*() {
return &
fX; }
330 const TT*
Arr()
const {
return &
fX; }
337 template <
typename OO>
369 return fX == 0.0 && fY == 0.0 ? 0.0 :
TMath::ATan2(fY, fX);
377 (fY -
b.fY)*(fY -
b.fY));
384 return ((fX -
b.fX) * (fX -
b.fX) +
385 (fY -
b.fY) * (fY -
b.fY));
392 return a.fX*fX +
a.fY*fY;
399 return fX *
a.fY - fY *
a.fX;
void Error(const char *location, const char *msgfmt,...)
TEveVector2T< Float_t > TEveVector2
TEveVectorT< Float_t > TEveVectorF
TEveVectorT< TT > operator+(const TEveVectorT< TT > &a, const TEveVectorT< TT > &b)
TEveVectorT< Double_t > TEveVectorD
TEveVectorT< TT > operator*(const TEveVectorT< TT > &a, TT b)
TEveVectorT< Float_t > TEveVector
TEveVector4T< Float_t > TEveVector4F
TEveVector4T< Double_t > TEveVector4D
TEveVector2T< Double_t > TEveVector2D
TEveVector2T< Float_t > TEveVector2F
TEveVectorT< TT > operator-(const TEveVectorT< TT > &a, const TEveVectorT< TT > &b)
TEveVector4T< Float_t > TEveVector4
Minimal, templated two-vector.
TEveVector2T(const TEveVector2T< OO > &v)
void Set(const Double_t *v)
TT Cross(const TEveVector2T &a) const
void Dump() const
Dump to stdout as "(x, y)\n".
TT Distance(const TEveVector2T &v) const
TT Dot(const TEveVector2T &a) const
TEveVector2T(const Double_t *v)
TEveVector2T & Mult(const TEveVector2T &a, TT af)
void Normalize(TT length=1)
Normalize the vector to length if current length is non-zero.
TT SquareDistance(const TEveVector2T &v) const
TT operator[](Int_t idx) const
TEveVector2T(const Float_t *v)
TEveVector2T & operator-=(const TEveVector2T &v)
void Set(const Float_t *v)
TT & operator[](Int_t idx)
void Set(const TEveVector2T< OO > &v)
ClassDefNV(TEveVector2T, 1)
TEveVector2T & operator+=(const TEveVector2T &v)
TEveVector2T & operator*=(TT s)
TEveVector2T & Sub(const TEveVector2T &p, const TEveVector2T &q)
Minimal, templated four-vector.
TEveVector4T(const TEveVectorT< OO > &v)
ClassDefNV(TEveVector4T, 1)
TEveVector4T(const Float_t *v)
void Dump() const
Dump to stdout as "(x, y, z; t)\n".
TEveVector4T(TT x, TT y, TT z, TT t=0)
TEveVector4T & operator-=(const TEveVector4T &v)
TEveVector4T & operator*=(TT s)
TEveVector4T & operator+=(const TEveVector4T &v)
TEveVector4T(const TEveVectorT< OO > &v, Float_t t)
TEveVector4T(const TEveVector4T< OO > &v)
TEveVector4T(const Double_t *v)
Minimal, templated three-vector.
TEveVectorT Cross(const TEveVectorT &a) const
void OrthoNormBase(TEveVectorT &a, TEveVectorT &b) const
Set vectors a and b to be normal to this and among themselves, both of length 1.
void Set(TT x, TT y, TT z)
void Set(const Double_t *v)
TT Distance(const TEveVectorT &v) const
TEveVectorT(TT x, TT y, TT z)
TEveVectorT & Mult(const TEveVectorT &a, TT af)
TT Normalize(TT length=1)
Normalize the vector to length if current length is non-zero.
TEveVectorT(const Float_t *v)
TEveVectorT & operator+=(const TEveVectorT &v)
TT Eta() const
Calculate eta of the point, pretending it's a momentum vector.
TEveVectorT & operator-=(const TEveVectorT &v)
TT Dot(const TEveVectorT &a) const
void Set(const TEveVectorT< OO > &v)
TEveVectorT & operator*=(TT s)
TEveVectorT(const Double_t *v)
ClassDefNV(TEveVectorT, 2)
TT operator[](Int_t idx) const
TEveVectorT Orthogonal() const
Returns an orthogonal vector (not normalized).
void Dump() const
Dump to stdout as "(x, y, z)\n".
TEveVectorT & Sub(const TEveVectorT &a, const TEveVectorT &b)
void Set(const Float_t *v)
TEveVectorT(const TEveVectorT< OO > &v)
TT SquareDistance(const TEveVectorT &v) const
TVector3 is a general three vector class, which can be used for the description of different vectors ...
T Mag(const SVector< T, D > &rhs)
Vector magnitude (Euclidian norm) Compute : .
double Perp(const Vector1 &v, const Vector2 &u)
Find the magnitude of the vector component of v perpendicular to the given direction of u.
static constexpr double s
Double_t ATan2(Double_t, Double_t)
Double_t Sqrt(Double_t x)