12#ifndef ROOT7_REveVector
13#define ROOT7_REveVector
21namespace Experimental {
34 template <
typename OO>
46 Error(
"REveVectorT",
"Subsequent members cannot be accessed as array!");
52 Error(
"REveVectorT",
"Subsequent members cannot be accessed as array!");
59 "Subsequent members cannot be accessed as array!");
65 "Subsequent members cannot be accessed as array!");
70 operator const TT*()
const {
return Arr(); }
71 operator TT*() {
return Arr(); }
85 template <
typename OO>
134 return fX == 0 && fY == 0 && fZ == 0 ? 0 :
TMath::ATan2(Perp(), fZ);
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-=;
303template <
typename TT>
310 template <
typename OO>
318 operator const TT*()
const {
return &
fX; }
319 operator TT*() {
return &
fX; }
328 const TT*
Arr()
const {
return &
fX; }
335 template <
typename OO>
365 return fX == 0.0 && fY == 0.0 ? 0.0 :
TMath::ATan2(fY, fX);
373 (fY -
b.fY)*(fY -
b.fY));
380 return ((fX -
b.fX) * (fX -
b.fX) +
381 (fY -
b.fY) * (fY -
b.fY));
388 return a.fX*fX +
a.fY*fY;
395 return fX *
a.fY - fY *
a.fX;
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
REveVector2T A two-vector template without TObject inheritance and virtual functions.
REveVector2T & operator-=(const REveVector2T &v)
REveVector2T & Mult(const REveVector2T &a, TT af)
REveVector2T(const Float_t *v)
void Normalize(TT length=1)
Normalize the vector to length if current length is non-zero.
void Set(const Float_t *v)
void Set(const REveVector2T< OO > &v)
TT & operator[](Int_t idx)
REveVector2T(const Double_t *v)
TT SquareDistance(const REveVector2T &v) const
TT operator[](Int_t idx) const
REveVector2T & operator+=(const REveVector2T &v)
TT Distance(const REveVector2T &v) const
TT Dot(const REveVector2T &a) const
REveVector2T & operator*=(TT s)
REveVector2T(const REveVector2T< OO > &v)
void Dump() const
Dump to stdout as "(x, y)\n".
REveVector2T & Sub(const REveVector2T &p, const REveVector2T &q)
TT Cross(const REveVector2T &a) const
void Set(const Double_t *v)
REveVector4T A four-vector template without TObject inheritance and virtual functions.
REveVector4T & operator-=(const REveVector4T &v)
REveVector4T(const REveVector4T< OO > &v)
REveVector4T(const REveVectorT< OO > &v)
REveVector4T(const Double_t *v)
void Dump() const
Dump to stdout as "(x, y, z; t)\n".
REveVector4T(const Float_t *v)
REveVector4T(const REveVectorT< OO > &v, Float_t t)
REveVector4T(TT x, TT y, TT z, TT t=0)
REveVector4T & operator+=(const REveVector4T &v)
REveVector4T & operator*=(TT s)
REveVectorT A three-vector template without TObject inheritance and virtual functions.
void Set(TT x, TT y, TT z)
TT Normalize(TT length=1)
Normalize the vector to length if current length is non-zero.
REveVectorT(const REveVectorT< OO > &v)
REveVectorT & operator*=(TT s)
REveVectorT & operator-=(const REveVectorT &v)
REveVectorT & Mult(const REveVectorT &a, TT af)
REveVectorT(TT x, TT y, TT z)
REveVectorT Cross(const REveVectorT &a) const
TT Distance(const REveVectorT &v) const
void Set(const REveVectorT< OO > &v)
void Set(const Double_t *v)
TT operator[](Int_t idx) const
REveVectorT(const Float_t *v)
REveVectorT & Sub(const REveVectorT &a, const REveVectorT &b)
REveVectorT Orthogonal() const
Returns an orthogonal vector (not normalized).
TT SquareDistance(const REveVectorT &v) const
void Set(const Float_t *v)
void OrthoNormBase(REveVectorT &a, REveVectorT &b) const
Set vectors a and b to be normal to this and among themselves, both of length 1.
TT Eta() const
Calculate eta of the point, pretending it's a momentum vector.
REveVectorT(const Double_t *v)
TT Dot(const REveVectorT &a) const
REveVectorT & operator+=(const REveVectorT &v)
void Dump() const
Dump to stdout as "(x, y, z)\n".
REveVector4T< Double_t > REveVector4D
ELogLevel operator+(ELogLevel severity, int offset)
REveVector2T< Double_t > REveVector2D
REveVectorT< Float_t > REveVectorF
REveVector2T< Float_t > REveVector2F
REveVector4T< Float_t > REveVector4F
REveVector2T< Float_t > REveVector2
REveVectorT< TT > operator-(const REveVectorT< TT > &a, const REveVectorT< TT > &b)
REveVectorT< TT > operator*(const REveVectorT< TT > &a, TT b)
REveVector4T< Float_t > REveVector4
REveVectorT< Float_t > REveVector
REveVectorT< Double_t > REveVectorD
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
Double_t Sqrt(Double_t x)
Returns the square root of x.