12#ifndef ROOT_TEveVector
13#define ROOT_TEveVector
32 template <
typename OO>
47 Error(
"TEveVectorT",
"Subsequent nembers cannot be accessed as array!");
53 Error(
"TEveVectorT",
"Subsequent nembers cannot be accessed as array!");
60 "Subsequent nembers cannot be accessed as array!");
66 "Subsequent nembers cannot be accessed as array!");
71 operator const TT*()
const {
return Arr(); }
72 operator TT*() {
return Arr(); }
86 template <
typename OO>
144 Float_t ptot =
Mag();
return ptot == 0 ? 1 : fZ/ptot;
152 (fY -
b.fY)*(fY -
b.fY) +
153 (fZ -
b.fZ)*(fZ -
b.fZ));
160 return ((fX -
b.fX) * (fX -
b.fX) +
161 (fY -
b.fY) * (fY -
b.fY) +
162 (fZ -
b.fZ) * (fZ -
b.fZ));
169 return a.fX*fX +
a.fY*fY +
a.fZ*fZ;
177 r.fX = fY *
a.fZ - fZ *
a.fY;
178 r.fY = fZ *
a.fX - fX *
a.fZ;
179 r.fZ = fX *
a.fY - fY *
a.fX;
240template <
typename TT>
249 template <
typename OO>
251 template <
typename OO>
253 template <
typename OO>
265 using TP::operator+=;
266 using TP::operator-=;
308template <
typename TT>
315 template <
typename OO>
323 operator const TT*()
const {
return &
fX; }
324 operator TT*() {
return &
fX; }
333 const TT*
Arr()
const {
return &
fX; }
340 template <
typename OO>
372 return fX == 0.0 && fY == 0.0 ? 0.0 :
TMath::ATan2(fY, fX);
380 (fY -
b.fY)*(fY -
b.fY));
387 return ((fX -
b.fX) * (fX -
b.fX) +
388 (fY -
b.fY) * (fY -
b.fY));
395 return a.fX*fX +
a.fY*fY;
402 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 y, Double_t x)
Double_t Sqrt(Double_t x)