Logo ROOT  
Reference Guide
REveVector.hxx
Go to the documentation of this file.
1 // @(#)root/eve7:$Id$
2 // Author: Matevz Tadel 2007, 2018
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT7_REveVector
13 #define ROOT7_REveVector
14 
15 #include "TMath.h"
16 #include <cstddef>
17 
18 class TVector3;
19 
20 namespace ROOT {
21 namespace Experimental {
22 
23 ////////////////////////////////////////////////////////////////////////////////
24 /// REveVectorT
25 /// A three-vector template without TObject inheritance and virtual functions.
26 ////////////////////////////////////////////////////////////////////////////////
27 
28 template <typename TT>
29 class REveVectorT {
30 public:
31  TT fX{0}, fY{0}, fZ{0}; // Components of the vector.
32 
33  REveVectorT() = default;
34  template <typename OO>
35  REveVectorT(const REveVectorT<OO>& v) : fX(v.fX), fY(v.fY), fZ(v.fZ) {}
36  REveVectorT(const Float_t* v) : fX(v[0]), fY(v[1]), fZ(v[2]) {}
37  REveVectorT(const Double_t* v) : fX(v[0]), fY(v[1]), fZ(v[2]) {}
38  REveVectorT(TT x, TT y, TT z) : fX(x), fY(y), fZ(z) {}
39 
40  void Dump() const;
41 
42 #ifdef R__WIN32
43  const TT *Arr() const
44  {
45  if (offsetof(REveVectorT, fZ) != offsetof(REveVectorT, fX) + 2 * sizeof(TT))
46  Error("REveVectorT", "Subsequent members cannot be accessed as array!");
47  return &fX;
48  }
49  TT *Arr()
50  {
51  if (offsetof(REveVectorT, fZ) != offsetof(REveVectorT, fX) + 2 * sizeof(TT))
52  Error("REveVectorT", "Subsequent members cannot be accessed as array!");
53  return &fX;
54  }
55 #else
56  const TT *Arr() const
57  {
58  static_assert(offsetof(REveVectorT, fZ) == offsetof(REveVectorT, fX) + 2 * sizeof(TT),
59  "Subsequent members cannot be accessed as array!");
60  return &fX;
61  }
62  TT *Arr()
63  {
64  static_assert(offsetof(REveVectorT, fZ) == offsetof(REveVectorT, fX) + 2 * sizeof(TT),
65  "Subsequent members cannot be accessed as array!");
66  return &fX;
67  }
68 #endif
69 
70  operator const TT*() const { return Arr(); }
71  operator TT*() { return Arr(); }
72 
73  TT operator [] (Int_t idx) const { return Arr()[idx]; }
74  TT& operator [] (Int_t idx) { return Arr()[idx]; }
75 
76  REveVectorT& operator*=(TT s) { fX *= s; fY *= s; fZ *= s; return *this; }
77  REveVectorT& operator+=(const REveVectorT& v) { fX += v.fX; fY += v.fY; fZ += v.fZ; return *this; }
78  REveVectorT& operator-=(const REveVectorT& v) { fX -= v.fX; fY -= v.fY; fZ -= v.fZ; return *this; }
79 
80  void Set(const Float_t* v) { fX = v[0]; fY = v[1]; fZ = v[2]; }
81  void Set(const Double_t* v) { fX = v[0]; fY = v[1]; fZ = v[2]; }
82  void Set(TT x, TT y, TT z) { fX = x; fY = y; fZ = z; }
83  void Set(const TVector3& v);
84 
85  template <typename OO>
86  void Set(const REveVectorT<OO>& v) { fX = v.fX; fY = v.fY; fZ = v.fZ; }
87 
88  void NegateXYZ() { fX = - fX; fY = -fY; fZ = -fZ; }
89  TT Normalize(TT length=1);
90 
91  TT Phi() const;
92  TT Theta() const;
93  TT CosTheta() const;
94  TT Eta() const;
95 
96  TT Mag2() const { return fX*fX + fY*fY + fZ*fZ; }
97  TT Mag() const { return TMath::Sqrt(Mag2()); }
98 
99  TT Perp2() const { return fX*fX + fY*fY; }
100  TT Perp() const { return TMath::Sqrt(Perp2()); }
101  TT R() const { return Perp(); }
102 
103  TT Distance(const REveVectorT& v) const;
104  TT SquareDistance(const REveVectorT& v) const;
105 
106  TT Dot(const REveVectorT& a) const;
107 
108  REveVectorT Cross(const REveVectorT& a) const;
109 
110  REveVectorT& Sub(const REveVectorT& a, const REveVectorT& b);
111  REveVectorT& Mult(const REveVectorT& a, TT af);
112 
113  REveVectorT Orthogonal() const;
114  void OrthoNormBase(REveVectorT& a, REveVectorT& b) const;
115 
116  Bool_t IsZero() const { return fX == 0 && fY == 0 && fZ == 0; }
117 };
118 
122 
123 //______________________________________________________________________________
124 template<typename TT>
125 inline TT REveVectorT<TT>::Phi() const
126 {
127  return fX == 0 && fY == 0 ? 0 : TMath::ATan2(fY, fX);
128 }
129 
130 //______________________________________________________________________________
131 template<typename TT>
132 inline TT REveVectorT<TT>::Theta() const
133 {
134  return fX == 0 && fY == 0 && fZ == 0 ? 0 : TMath::ATan2(Perp(), fZ);
135 }
136 
137 //______________________________________________________________________________
138 template<typename TT>
139 inline TT REveVectorT<TT>::CosTheta() const
140 {
141  Float_t ptot = Mag(); return ptot == 0 ? 1 : fZ/ptot;
142 }
143 
144 //______________________________________________________________________________
145 template<typename TT>
146 inline TT REveVectorT<TT>::Distance(const REveVectorT& b) const
147 {
148  return TMath::Sqrt((fX - b.fX)*(fX - b.fX) +
149  (fY - b.fY)*(fY - b.fY) +
150  (fZ - b.fZ)*(fZ - b.fZ));
151 }
152 
153 //______________________________________________________________________________
154 template<typename TT>
156 {
157  return ((fX - b.fX) * (fX - b.fX) +
158  (fY - b.fY) * (fY - b.fY) +
159  (fZ - b.fZ) * (fZ - b.fZ));
160 }
161 
162 //______________________________________________________________________________
163 template<typename TT>
164 inline TT REveVectorT<TT>::Dot(const REveVectorT& a) const
165 {
166  return a.fX*fX + a.fY*fY + a.fZ*fZ;
167 }
168 
169 //______________________________________________________________________________
170 template<typename TT>
172 {
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;
177  return r;
178 }
179 
180 //______________________________________________________________________________
181 template<typename TT>
183 {
184  fX = a.fX - b.fX;
185  fY = a.fY - b.fY;
186  fZ = a.fZ - b.fZ;
187  return *this;
188 }
189 
190 //______________________________________________________________________________
191 template<typename TT>
193 {
194  fX = a.fX * af;
195  fY = a.fY * af;
196  fZ = a.fZ * af;
197  return *this;
198 }
199 
200 //______________________________________________________________________________
201 template<typename TT>
203 {
205  return r += b;
206 }
207 
208 //______________________________________________________________________________
209 template<typename TT>
211 {
213  return r -= b;
214 }
215 
216 //______________________________________________________________________________
217 template<typename TT>
219 {
221  return r *= b;
222 }
223 
224 //______________________________________________________________________________
225 template<typename TT>
227 {
229  return r *= b;
230 }
231 
232 ////////////////////////////////////////////////////////////////////////////////
233 /// REveVector4T
234 /// A four-vector template without TObject inheritance and virtual functions.
235 ////////////////////////////////////////////////////////////////////////////////
236 
237 template <typename TT>
238 class REveVector4T : public REveVectorT<TT>
239 {
241 
242 public:
243  TT fT;
244 
245  REveVector4T() : TP(), fT(0) {}
246  template <typename OO>
247  REveVector4T(const REveVectorT<OO>& v) : TP(v.fX, v.fY, v.fZ), fT(0) {}
248  template <typename OO>
249  REveVector4T(const REveVectorT<OO>& v, Float_t t) : TP(v.fX, v.fY, v.fZ), fT(t) {}
250  template <typename OO>
251  REveVector4T(const REveVector4T<OO>& v) : TP(v.fX, v.fY, v.fZ), fT(v.fT) {}
252  REveVector4T(const Float_t* v) : TP(v), fT(v[3]) {}
253  REveVector4T(const Double_t* v) : TP(v), fT(v[3]) {}
254  REveVector4T(TT x, TT y, TT z, TT t=0) : TP(x, y, z), fT(t) {}
255 
256  void Dump() const;
257 
258  REveVector4T& operator*=(TT s) { TP::operator*=(s); fT *= s; return *this; }
259  REveVector4T& operator+=(const REveVector4T& v) { TP::operator+=(v); fT += v.fT; return *this; }
260  REveVector4T& operator-=(const REveVector4T& v) { TP::operator-=(v); fT -= v.fT; return *this; }
261 
262  using TP::operator+=;
263  using TP::operator-=;
264 };
265 
269 
270 //______________________________________________________________________________
271 template<typename TT>
273 {
274  return REveVector4T<TT>(a.fX + b.fX, a.fY + b.fY, a.fZ + b.fZ, a.fT + b.fT);
275 }
276 
277 //______________________________________________________________________________
278 template<typename TT>
280 {
281  return REveVector4T<TT>(a.fX - b.fX, a.fY - b.fY, a.fZ - b.fZ, a.fT - b.fT);
282 }
283 
284 //______________________________________________________________________________
285 template<typename TT>
287 {
288  return REveVector4T<TT>(a.fX*b, a.fY*b, a.fZ*b, a.fT*b);
289 }
290 
291 //______________________________________________________________________________
292 template<typename TT>
294 {
295  return REveVector4T<TT>(a.fX*b, a.fY*b, a.fZ*b, a.fT*b);
296 }
297 
298 ////////////////////////////////////////////////////////////////////////////////
299 /// REveVector2T
300 /// A two-vector template without TObject inheritance and virtual functions.
301 ////////////////////////////////////////////////////////////////////////////////
302 
303 template <typename TT>
305 {
306 public:
307  TT fX, fY; // Components of the point.
308 
309  REveVector2T() : fX(0), fY(0) {}
310  template <typename OO>
312  REveVector2T(const Float_t* v) : fX(v[0]), fY(v[1]) {}
313  REveVector2T(const Double_t* v) : fX(v[0]), fY(v[1]) {}
314  REveVector2T(TT x, TT y) : fX(x), fY(y) {}
315 
316  void Dump() const;
317 
318  operator const TT*() const { return &fX; }
319  operator TT*() { return &fX; }
320 
321  REveVector2T& operator*=(TT s) { fX *= s; fY *= s; return *this; }
322  REveVector2T& operator+=(const REveVector2T& v) { fX += v.fX; fY += v.fY; return *this; }
323  REveVector2T& operator-=(const REveVector2T& v) { fX -= v.fX; fY -= v.fY; return *this; }
324 
325  TT& operator[](Int_t idx) { return (&fX)[idx]; }
326  TT operator[](Int_t idx) const { return (&fX)[idx]; }
327 
328  const TT* Arr() const { return &fX; }
329  TT* Arr() { return &fX; }
330 
331  void Set(const Float_t* v) { fX = v[0]; fY = v[1]; }
332  void Set(const Double_t* v) { fX = v[0]; fY = v[1]; }
333  void Set(TT x, TT y) { fX = x; fY = y; }
334 
335  template <typename OO>
336  void Set(const REveVector2T<OO>& v) { fX = v.fX; fY = v.fY; }
337 
338  void NegateXY() { fX = - fX; fY = -fY; }
339  void Normalize(TT length=1);
340 
341  TT Phi() const;
342 
343  TT Mag2() const { return fX*fX + fY*fY;}
344  TT Mag() const { return TMath::Sqrt(Mag2());}
345 
346  TT Distance(const REveVector2T& v) const;
347  TT SquareDistance(const REveVector2T& v) const;
348 
349  TT Dot(const REveVector2T& a) const;
350  TT Cross(const REveVector2T& a) const;
351 
352  REveVector2T& Sub(const REveVector2T& p, const REveVector2T& q);
353 
354  REveVector2T& Mult(const REveVector2T& a, TT af);
355 };
356 
360 
361 //______________________________________________________________________________
362 template<typename TT>
363 inline TT REveVector2T<TT>::Phi() const
364 {
365  return fX == 0.0 && fY == 0.0 ? 0.0 : TMath::ATan2(fY, fX);
366 }
367 
368 //______________________________________________________________________________
369 template<typename TT>
371 {
372  return TMath::Sqrt((fX - b.fX)*(fX - b.fX) +
373  (fY - b.fY)*(fY - b.fY));
374 }
375 
376 //______________________________________________________________________________
377 template<typename TT>
379 {
380  return ((fX - b.fX) * (fX - b.fX) +
381  (fY - b.fY) * (fY - b.fY));
382 }
383 
384 //______________________________________________________________________________
385 template<typename TT>
386 inline TT REveVector2T<TT>::Dot(const REveVector2T<TT>& a) const
387 {
388  return a.fX*fX + a.fY*fY;
389 }
390 
391 //______________________________________________________________________________
392 template<typename TT>
394 {
395  return fX * a.fY - fY * a.fX;
396 }
397 
398 //______________________________________________________________________________
399 template<typename TT>
401 {
402  fX = p.fX - q.fX;
403  fY = p.fY - q.fY;
404  return *this;
405 }
406 
407 //______________________________________________________________________________
408 template<typename TT>
410 {
411  fX = a.fX * af;
412  fY = a.fY * af;
413  return *this;
414 }
415 
416 //______________________________________________________________________________
417 template<typename TT>
419 {
421  return r += b;
422 }
423 
424 //______________________________________________________________________________
425 template<typename TT>
427 {
429  return r -= b;
430 }
431 
432 //______________________________________________________________________________
433 template<typename TT>
435 {
437  return r *= b;
438 }
439 
440 //______________________________________________________________________________
441 template<typename TT>
443 {
445  return r *= b;
446 }
447 
448 }}
449 
450 #endif
ROOT::Experimental::REveVector2T::Set
void Set(const Double_t *v)
Definition: REveVector.hxx:332
ROOT::Experimental::REveVector2T::Set
void Set(TT x, TT y)
Definition: REveVector.hxx:333
ROOT::Experimental::REveVectorT::Set
void Set(const REveVectorT< OO > &v)
Definition: REveVector.hxx:86
ROOT::Experimental::REveVector4T::REveVector4T
REveVector4T(const REveVectorT< OO > &v)
Definition: REveVector.hxx:247
TVector3
Definition: TVector3.h:22
ROOT::Experimental::REveVectorT::Cross
REveVectorT Cross(const REveVectorT &a) const
Definition: REveVector.hxx:171
ROOT::Experimental::REveVector2T::Arr
const TT * Arr() const
Definition: REveVector.hxx:328
TMath::ATan2
Double_t ATan2(Double_t y, Double_t x)
Definition: TMath.h:679
ROOT::Experimental::REveVector4T
REveVector4T A four-vector template without TObject inheritance and virtual functions.
Definition: REveVector.hxx:238
ROOT::Experimental::REveVector2T::Mult
REveVector2T & Mult(const REveVector2T &a, TT af)
Definition: REveVector.hxx:409
ROOT::Experimental::REveVectorT::fX
TT fX
Definition: REveVector.hxx:31
ROOT::Experimental::REveVector2T::fX
TT fX
Definition: REveVector.hxx:307
ROOT::Experimental::REveVector2T::Phi
TT Phi() const
Definition: REveVector.hxx:363
ROOT::Experimental::REveVectorT::Dot
TT Dot(const REveVectorT &a) const
Definition: REveVector.hxx:164
ROOT::Experimental::REveVector4F
REveVector4T< Float_t > REveVector4F
Definition: REveVector.hxx:267
ROOT::Experimental::REveVectorT::Set
void Set(TT x, TT y, TT z)
Definition: REveVector.hxx:82
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TMath::Sqrt
Double_t Sqrt(Double_t x)
Definition: TMath.h:691
ROOT::Experimental::REveVector2T::operator*=
REveVector2T & operator*=(TT s)
Definition: REveVector.hxx:321
Float_t
float Float_t
Definition: RtypesCore.h:57
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
ROOT::Experimental::REveVector2T::Sub
REveVector2T & Sub(const REveVector2T &p, const REveVector2T &q)
Definition: REveVector.hxx:400
ROOT::Experimental::REveVector4T::REveVector4T
REveVector4T(const REveVector4T< OO > &v)
Definition: REveVector.hxx:251
x
Double_t x[n]
Definition: legend1.C:17
ROOT::Experimental::REveVector4
REveVector4T< Float_t > REveVector4
Definition: REveVector.hxx:266
ROOT::Experimental::REveVector
REveVectorT< Float_t > REveVector
Definition: REveVector.hxx:119
ROOT::Experimental::REveVectorT::Set
void Set(const Double_t *v)
Definition: REveVector.hxx:81
ROOT::Experimental::REveVector2T::Distance
TT Distance(const REveVector2T &v) const
Definition: REveVector.hxx:370
ROOT::Experimental::REveVector2T::Dot
TT Dot(const REveVector2T &a) const
Definition: REveVector.hxx:386
ROOT::Experimental::REveVectorT
REveVectorT A three-vector template without TObject inheritance and virtual functions.
Definition: REveVector.hxx:29
v
@ v
Definition: rootcling_impl.cxx:3635
b
#define b(i)
Definition: RSha256.hxx:118
ROOT::Experimental::REveVector2T::operator[]
TT operator[](Int_t idx) const
Definition: REveVector.hxx:326
ROOT::Experimental::REveVectorT::Theta
TT Theta() const
Definition: REveVector.hxx:132
ROOT::Experimental::REveVectorT::Sub
REveVectorT & Sub(const REveVectorT &a, const REveVectorT &b)
Definition: REveVector.hxx:182
bool
ROOT::Experimental::REveVectorT::Arr
TT * Arr()
Definition: REveVector.hxx:62
ROOT::Experimental::REveVectorT::IsZero
Bool_t IsZero() const
Definition: REveVector.hxx:116
ROOT::Experimental::REveVector4T::fT
TT fT
Definition: REveVector.hxx:243
q
float * q
Definition: THbookFile.cxx:89
ROOT::Experimental::REveVectorT::Mag
TT Mag() const
Definition: REveVector.hxx:97
ROOT::Experimental::REveVector2
REveVector2T< Float_t > REveVector2
Definition: REveVector.hxx:357
ROOT::Experimental::REveVectorT::Perp
TT Perp() const
Definition: REveVector.hxx:100
ROOT::Experimental::REveVectorF
REveVectorT< Float_t > REveVectorF
Definition: REveVector.hxx:120
ROOT::Math::Mag
T Mag(const SVector< T, D > &rhs)
Vector magnitude (Euclidian norm) Compute : .
Definition: Functions.h:252
ROOT::Experimental::REveVectorT::Orthogonal
REveVectorT Orthogonal() const
Returns an orthogonal vector (not normalized).
Definition: REveVector.cxx:82
ROOT::Experimental::REveVectorT::Normalize
TT Normalize(TT length=1)
Normalize the vector to length if current length is non-zero.
Definition: REveVector.cxx:68
ROOT::Experimental::REveVectorT::Mag2
TT Mag2() const
Definition: REveVector.hxx:96
ROOT::Experimental::REveVector2T::Set
void Set(const REveVector2T< OO > &v)
Definition: REveVector.hxx:336
ROOT::Experimental::REveVector2T::NegateXY
void NegateXY()
Definition: REveVector.hxx:338
ROOT::Experimental::REveVectorT::REveVectorT
REveVectorT(const REveVectorT< OO > &v)
Definition: REveVector.hxx:35
ROOT::Experimental::REveVector4T::REveVector4T
REveVector4T(const REveVectorT< OO > &v, Float_t t)
Definition: REveVector.hxx:249
ROOT::Experimental::REveVectorT::Phi
TT Phi() const
Definition: REveVector.hxx:125
ROOT::Experimental::REveVectorT::REveVectorT
REveVectorT(const Double_t *v)
Definition: REveVector.hxx:37
ROOT::Experimental::REveVectorT::NegateXYZ
void NegateXYZ()
Definition: REveVector.hxx:88
ROOT::Experimental::REveVector2T::Mag
TT Mag() const
Definition: REveVector.hxx:344
ROOT::Experimental::REveVectorT::Dump
void Dump() const
Dump to stdout as "(x, y, z)\n".
Definition: REveVector.cxx:40
ROOT::Experimental::REveVector2F
REveVector2T< Float_t > REveVector2F
Definition: REveVector.hxx:358
operator+=
std::string & operator+=(std::string &left, const TString &right)
Definition: TString.h:478
ROOT::Experimental::REveVectorT::fZ
TT fZ
Definition: REveVector.hxx:31
ROOT::Experimental::REveVectorT::Set
void Set(const Float_t *v)
Definition: REveVector.hxx:80
a
auto * a
Definition: textangle.C:12
ROOT::Experimental::REveVectorD
REveVectorT< Double_t > REveVectorD
Definition: REveVector.hxx:121
ROOT::Experimental::REveVectorT::fY
TT fY
Definition: REveVector.hxx:31
ROOT::Experimental::REveVector2T::Mag2
TT Mag2() const
Definition: REveVector.hxx:343
ROOT::Experimental::REveVectorT::Perp2
TT Perp2() const
Definition: REveVector.hxx:99
ROOT::Experimental::REveVector2T::REveVector2T
REveVector2T(const Float_t *v)
Definition: REveVector.hxx:312
ROOT::Experimental::REveVectorT::CosTheta
TT CosTheta() const
Definition: REveVector.hxx:139
ROOT::Experimental::REveVector2T::Arr
TT * Arr()
Definition: REveVector.hxx:329
ROOT::Experimental::REveVector4T::REveVector4T
REveVector4T(TT x, TT y, TT z, TT t=0)
Definition: REveVector.hxx:254
y
Double_t y[n]
Definition: legend1.C:17
ROOT::Experimental::REveVector4T::REveVector4T
REveVector4T()
Definition: REveVector.hxx:245
ROOT::Experimental::REveVector4D
REveVector4T< Double_t > REveVector4D
Definition: REveVector.hxx:268
ROOT::Experimental::REveVector2T::REveVector2T
REveVector2T(const Double_t *v)
Definition: REveVector.hxx:313
ROOT::Experimental::REveVector2D
REveVector2T< Double_t > REveVector2D
Definition: REveVector.hxx:359
ROOT::Experimental::REveVectorT::Eta
TT Eta() const
Calculate eta of the point, pretending it's a momentum vector.
Definition: REveVector.cxx:56
ROOT::Experimental::REveVector4T::Dump
void Dump() const
Dump to stdout as "(x, y, z; t)\n".
Definition: REveVector.cxx:121
ROOT::Experimental::REveVectorT::REveVectorT
REveVectorT(TT x, TT y, TT z)
Definition: REveVector.hxx:38
ROOT::Experimental::REveVector4T::REveVector4T
REveVector4T(const Double_t *v)
Definition: REveVector.hxx:253
ROOT::Experimental::REveVectorT::REveVectorT
REveVectorT()=default
ROOT::Experimental::REveVector4T::REveVector4T
REveVector4T(const Float_t *v)
Definition: REveVector.hxx:252
ROOT::Experimental::REveVectorT::operator*=
REveVectorT & operator*=(TT s)
Definition: REveVector.hxx:76
ROOT::Experimental::REveVectorT::Distance
TT Distance(const REveVectorT &v) const
Definition: REveVector.hxx:146
ROOT::Experimental::REveVectorT::OrthoNormBase
void OrthoNormBase(REveVectorT &a, REveVectorT &b) const
Set vectors a and b to be normal to this and among themselves, both of length 1.
Definition: REveVector.cxx:98
ROOT::Experimental::REveVector2T::operator-=
REveVector2T & operator-=(const REveVector2T &v)
Definition: REveVector.hxx:323
Double_t
double Double_t
Definition: RtypesCore.h:59
ROOT::Experimental::REveVectorT::operator+=
REveVectorT & operator+=(const REveVectorT &v)
Definition: REveVector.hxx:77
ROOT::Experimental::REveVector2T::SquareDistance
TT SquareDistance(const REveVector2T &v) const
Definition: REveVector.hxx:378
ROOT::Experimental::REveVector2T::operator+=
REveVector2T & operator+=(const REveVector2T &v)
Definition: REveVector.hxx:322
ROOT::Experimental::REveVector4T::operator+=
REveVector4T & operator+=(const REveVector4T &v)
Definition: REveVector.hxx:259
ROOT::Experimental::REveVectorT::SquareDistance
TT SquareDistance(const REveVectorT &v) const
Definition: REveVector.hxx:155
ROOT::Experimental::REveVector4T::TP
REveVectorT< TT > TP
Definition: REveVector.hxx:240
ROOT::Experimental::REveVectorT::Arr
const TT * Arr() const
Definition: REveVector.hxx:56
ROOT::Experimental::REveVector2T::Cross
TT Cross(const REveVector2T &a) const
Definition: REveVector.hxx:393
ROOT::Experimental::REveVector2T
REveVector2T A two-vector template without TObject inheritance and virtual functions.
Definition: REveVector.hxx:304
ROOT::Experimental::REveVector2T::REveVector2T
REveVector2T(const REveVector2T< OO > &v)
Definition: REveVector.hxx:311
ROOT::Experimental::REveVectorT::operator[]
TT operator[](Int_t idx) const
Definition: REveVector.hxx:73
ROOT::Experimental::REveVector2T::REveVector2T
REveVector2T(TT x, TT y)
Definition: REveVector.hxx:314
ROOT::Experimental::operator*
REveVectorT< TT > operator*(const REveVectorT< TT > &a, TT b)
Definition: REveVector.hxx:218
ROOT::Experimental::REveVectorT::operator-=
REveVectorT & operator-=(const REveVectorT &v)
Definition: REveVector.hxx:78
ROOT::Experimental::REveVector2T::REveVector2T
REveVector2T()
Definition: REveVector.hxx:309
ROOT::Experimental::REveVectorT::R
TT R() const
Definition: REveVector.hxx:101
ROOT::Experimental::operator-
REveVectorT< TT > operator-(const REveVectorT< TT > &a, const REveVectorT< TT > &b)
Definition: REveVector.hxx:210
ROOT::Math::VectorUtil::Perp
double Perp(const Vector1 &v, const Vector2 &u)
Find the magnitude of the vector component of v perpendicular to the given direction of u.
Definition: VectorUtil.h:211
ROOT::Experimental::REveVectorT::REveVectorT
REveVectorT(const Float_t *v)
Definition: REveVector.hxx:36
ROOT::Experimental::REveVector2T::Normalize
void Normalize(TT length=1)
Normalize the vector to length if current length is non-zero.
Definition: REveVector.cxx:140
ROOT::Experimental::REveVector4T::operator-=
REveVector4T & operator-=(const REveVector4T &v)
Definition: REveVector.hxx:260
ROOT::Experimental::REveVector2T::Set
void Set(const Float_t *v)
Definition: REveVector.hxx:331
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Experimental::REveVector2T::Dump
void Dump() const
Dump to stdout as "(x, y)\n".
Definition: REveVector.cxx:153
ROOT::Experimental::REveVector4T::operator*=
REveVector4T & operator*=(TT s)
Definition: REveVector.hxx:258
ROOT::Experimental::REveVectorT::Mult
REveVectorT & Mult(const REveVectorT &a, TT af)
Definition: REveVector.hxx:192
TMath.h
ROOT::Experimental::REveVector2T::fY
TT fY
Definition: REveVector.hxx:307
ROOT::Experimental::operator+
REveException operator+(const REveException &s1, const std::string &s2)
Definition: REveTypes.cxx:21
int
Error
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition: TError.cxx:187
ROOT::Experimental::REveVector2T::operator[]
TT & operator[](Int_t idx)
Definition: REveVector.hxx:325