12 #ifndef ROOT_TEveVector
13 #define ROOT_TEveVector
25 template <
typename TT>
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>
124 template<
typename TT>
131 template<
typename TT>
138 template<
typename TT>
141 Float_t ptot =
Mag();
return ptot == 0 ? 1 : fZ/ptot;
145 template<
typename TT>
149 (fY - b.
fY)*(fY - b.
fY) +
150 (fZ - b.
fZ)*(fZ - b.
fZ));
154 template<
typename TT>
157 return ((fX - b.
fX) * (fX - b.
fX) +
158 (fY - b.
fY) * (fY - b.
fY) +
159 (fZ - b.
fZ) * (fZ - b.
fZ));
163 template<
typename TT>
166 return a.
fX*fX + a.
fY*fY + a.
fZ*fZ;
170 template<
typename TT>
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;
181 template<
typename TT>
191 template<
typename TT>
201 template<
typename TT>
209 template<
typename TT>
217 template<
typename TT>
225 template<
typename TT>
237 template <
typename TT>
246 template <
typename OO>
248 template <
typename OO>
250 template <
typename OO>
262 using TP::operator+=;
263 using TP::operator-=;
273 template<
typename TT>
280 template<
typename TT>
287 template<
typename TT>
294 template<
typename TT>
305 template <
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>
366 template<
typename TT>
369 return fX == 0.0 && fY == 0.0 ? 0.0 :
TMath::ATan2(fY, fX);
373 template<
typename TT>
377 (fY - b.
fY)*(fY - b.
fY));
381 template<
typename TT>
384 return ((fX - b.
fX) * (fX - b.
fX) +
385 (fY - b.
fY) * (fY - b.
fY));
389 template<
typename TT>
392 return a.
fX*fX + a.
fY*fY;
396 template<
typename TT>
399 return fX * a.
fY - fY * a.
fX;
403 template<
typename TT>
412 template<
typename TT>
421 template<
typename TT>
429 template<
typename TT>
437 template<
typename TT>
445 template<
typename TT>
void Set(const TEveVector2T< OO > &v)
TT Dot(const TEveVector2T &a) const
TEveVectorT & operator*=(TT s)
TEveVector4T< Float_t > TEveVector4
TEveVectorT & operator-=(const TEveVectorT &v)
void Set(const Float_t *v)
TEveVector4T< Double_t > TEveVector4D
TEveVectorT(TT x, TT y, TT z)
T Mag(const SVector< T, D > &rhs)
Vector magnitude (Euclidian norm) Compute : .
TT & operator[](Int_t idx)
TT Distance(const TEveVector2T &v) const
TEveVector4T(TT x, TT y, TT z, TT t=0)
void OrthoNormBase(TEveVectorT &a, TEveVectorT &b) const
Set vectors a and b to be normal to this and among themselves, both of length 1.
TT Dot(const TEveVectorT &a) const
ClassDefNV(TEveVector4T, 1)
void Set(const Double_t *v)
TEveVector2T< Float_t > TEveVector2
TEveVector4T & operator+=(const TEveVector4T &v)
void Set(const Double_t *v)
void Set(const TEveVectorT< OO > &v)
TEveVector4T(const Double_t *v)
TT Distance(const TEveVectorT &v) const
Minimal, templated four-vector.
Minimal, templated three-vector.
ClassDefNV(TEveVectorT, 2)
void Dump() const
Dump to stdout as "(x, y, z)\n".
TEveVectorT< Double_t > TEveVectorD
void Dump() const
Dump to stdout as "(x, y, z; t)\n".
void Set(TT x, TT y, TT z)
TTime operator-(const TTime &t1, const TTime &t2)
TEveVectorT Orthogonal() const
Returns an orthogonal vector (not normalized).
Double_t ATan2(Double_t, Double_t)
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
TEveVectorT Cross(const TEveVectorT &a) const
void Error(const char *location, const char *msgfmt,...)
ClassDefNV(TEveVector2T, 1)
TEveVector2T & operator*=(TT s)
TEveVector4T(const TEveVectorT< OO > &v, Float_t t)
TT Eta() const
Calculate eta of the point, pretending it's a momentum vector.
TVector3 is a general three vector class, which can be used for the description of different vectors ...
TEveVector4T & operator*=(TT s)
TEveVectorT(const Double_t *v)
void Dump() const
Dump to stdout as "(x, y)\n".
TEveVector2T & Mult(const TEveVector2T &a, TT af)
TTime operator*(const TTime &t1, const TTime &t2)
TEveVector4T(const Float_t *v)
Minimal, templated two-vector.
TEveVectorT & Mult(const TEveVectorT &a, TT af)
void Normalize(TT length=1)
Normalize the vector to length if current length is non-zero.
TEveVector2T(const TEveVector2T< OO > &v)
TEveVector2T< Double_t > TEveVector2D
TEveVector2T(const Double_t *v)
void Set(const Float_t *v)
TEveVector2T(const Float_t *v)
TT SquareDistance(const TEveVector2T &v) const
static constexpr double s
TEveVectorT(const Float_t *v)
TEveVectorT & operator+=(const TEveVectorT &v)
TEveVector4T(const TEveVector4T< OO > &v)
TEveVectorT< Float_t > TEveVector
you should not use this method at all Int_t Int_t z
TEveVector4T & operator-=(const TEveVector4T &v)
TEveVectorT(const TEveVectorT< OO > &v)
TEveVectorT< Float_t > TEveVectorF
TEveVector2T & Sub(const TEveVector2T &p, const TEveVector2T &q)
TT operator[](Int_t idx) const
TEveVector4T< Float_t > TEveVector4F
TT Normalize(TT length=1)
Normalize the vector to length if current length is non-zero.
TEveVector2T & operator+=(const TEveVector2T &v)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
TEveVector2T & operator-=(const TEveVector2T &v)
TEveVectorT & Sub(const TEveVectorT &a, const TEveVectorT &b)
TEveVector2T< Float_t > TEveVector2F
double Perp(const Vector1 &v, const Vector2 &u)
Find the magnitude of the vector component of v perpendicular to the given direction of u...
TEveVector4T(const TEveVectorT< OO > &v)
Double_t Sqrt(Double_t x)
TT operator[](Int_t idx) const
TT Cross(const TEveVector2T &a) const
TT SquareDistance(const TEveVectorT &v) const