Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
DisplacementVector3D.h
Go to the documentation of this file.
1// @(#)root/mathcore:$Id$
2// Authors: W. Brown, M. Fischler, L. Moneta 2005
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2005 , LCG ROOT MathLib Team and *
7 * FNAL LCG ROOT MathLib Team *
8 * *
9 * *
10 **********************************************************************/
11
12// Header source file for class DisplacementVector3D
13//
14// Created by: Lorenzo Moneta at Mon May 30 12:21:43 2005
15// Major rewrite: M. FIschler at Wed Jun 8 2005
16//
17// Last update: $Id$
18//
19
20#ifndef ROOT_MathX_GenVectorX_DisplacementVector3D
21#define ROOT_MathX_GenVectorX_DisplacementVector3D 1
22
24
26
28
30
32
34
36
37using namespace ROOT::ROOT_MATH_ARCH;
38
39#include <cassert>
40
41namespace ROOT {
42
43namespace ROOT_MATH_ARCH {
44
45//__________________________________________________________________________________________
46/**
47 Class describing a generic displacement vector in 3 dimensions.
48 This class is templated on the type of Coordinate system.
49 One example is the XYZVector which is a vector based on
50 double precision x,y,z data members by using the
51 ROOT::Math::Cartesian3D<double> Coordinate system.
52 The class is having also an extra template parameter, the coordinate system tag,
53 to be able to identify (tag) vector described in different reference coordinate system,
54 like global or local coordinate systems.
55
56 @ingroup GenVectorX
57
58 @see GenVectorX
59*/
60
61template <class CoordSystem, class Tag = DefaultCoordinateSystemTag>
63
64public:
65 typedef typename CoordSystem::Scalar Scalar;
66 typedef CoordSystem CoordinateType;
68
69 // ------ ctors ------
70
71 /**
72 Default constructor. Construct an empty object with zero values
73 */
75
76 /**
77 Construct from three values of type <em>Scalar</em>.
78 In the case of a XYZVector the values are x,y,z
79 In the case of a polar vector they are r,theta, phi
80 */
82
83 /**
84 Construct from a displacement vector expressed in different
85 coordinates, or using a different Scalar type, but with same coordinate system tag
86 */
87 template <class OtherCoords>
91
92 /**
93 Construct from a position vector expressed in different coordinates
94 but with the same coordinate system tag
95 */
96 template <class OtherCoords>
100
101 /**
102 Construct from a foreign 3D vector type, for example, Hep3Vector
103 Precondition: v must implement methods x(), y() and z()
104 */
105 template <class ForeignVector>
107 {
108 }
109
110#ifdef LATER
111 /**
112 construct from a generic linear algebra vector of at least size 3
113 implementing operator [].
114 \par v LAVector
115 \par index0 index where coordinates starts (typically zero)
116 It works for all Coordinates types,
117 ( x= v[index0] for Cartesian and r=v[index0] for Polar )
118 */
119 template <class LAVector>
120 DisplacementVector3D(const LAVector &v, size_t index0)
121 {
122 fCoordinates = CoordSystem(v[index0], v[index0 + 1], v[index0 + 2]);
123 }
124#endif
125
126 // compiler-generated copy ctor and dtor are fine.
127
128 // ------ assignment ------
129
130 /**
131 Assignment operator from a displacement vector of arbitrary type
132 */
133 template <class OtherCoords>
135 {
136 fCoordinates = v.Coordinates();
137 return *this;
138 }
139
140 /**
141 Assignment operator from a position vector
142 (not necessarily efficient unless one or the other is Cartesian)
143 */
144 template <class OtherCoords>
146 {
147 SetXYZ(rhs.x(), rhs.y(), rhs.z());
148 return *this;
149 }
150
151 /**
152 Assignment from a foreign 3D vector type, for example, Hep3Vector
153 Precondition: v must implement methods x(), y() and z()
154 */
155 template <class ForeignVector>
157 {
158 SetXYZ(v.x(), v.y(), v.z());
159 return *this;
160 }
161
162#ifdef LATER
163 /**
164 assign from a generic linear algebra vector of at least size 3
165 implementing operator []. This could be also a C array
166 \par v LAVector
167 \par index0 index where coordinates starts (typically zero)
168 It works for all Coordinates types,
169 ( x= v[index0] for Cartesian and r=v[index0] for Polar )
170 */
171 template <class LAVector>
172 DisplacementVector3D &assignFrom(const LAVector &v, size_t index0 = 0)
173 {
174 fCoordinates = CoordSystem(v[index0], v[index0 + 1], v[index0 + 2]);
175 return *this;
176 }
177#endif
178
179 // ------ Set, Get, and access coordinate data ------
180
181 /**
182 Retrieve a copy of the coordinates object
183 */
184 CoordSystem Coordinates() const { return fCoordinates; }
185
186 /**
187 Set internal data based on a C-style array of 3 Scalar numbers
188 */
190 {
191 fCoordinates.SetCoordinates(src);
192 return *this;
193 }
194
195 /**
196 Set internal data based on 3 Scalar numbers
197 */
199 {
200 fCoordinates.SetCoordinates(a, b, c);
201 return *this;
202 }
203
204 /**
205 Set internal data based on 3 Scalars at *begin to *end
206 */
207 template <class IT>
209 {
210 IT a = begin;
211 IT b = ++begin;
212 IT c = ++begin;
213 (void)end;
214 assert(++begin == end);
215 SetCoordinates(*a, *b, *c);
216 return *this;
217 }
218
219 /**
220 get internal data into 3 Scalar numbers
221 */
222 void GetCoordinates(Scalar &a, Scalar &b, Scalar &c) const { fCoordinates.GetCoordinates(a, b, c); }
223
224 /**
225 get internal data into a C-style array of 3 Scalar numbers
226 */
227 void GetCoordinates(Scalar dest[]) const { fCoordinates.GetCoordinates(dest); }
228
229 /**
230 get internal data into 3 Scalars at *begin to *end (3 past begin)
231 */
232 template <class IT>
233 void GetCoordinates(IT begin, IT end) const
234 {
235 IT a = begin;
236 IT b = ++begin;
237 IT c = ++begin;
238 (void)end;
239 assert(++begin == end);
240 GetCoordinates(*a, *b, *c);
241 }
242 /**
243 get internal data into 3 Scalars starting at *begin
244 */
245 template <class IT>
246 void GetCoordinates(IT begin) const
247 {
248 Scalar a = Scalar(0);
249 Scalar b = Scalar(0);
250 Scalar c = Scalar(0);
251 GetCoordinates(a, b, c);
252 *begin++ = a;
253 *begin++ = b;
254 *begin = c;
255 }
256
257 /**
258 set the values of the vector from the cartesian components (x,y,z)
259 (if the vector is held in polar or cylindrical eta coordinates,
260 then (x, y, z) are converted to that form)
261 */
263 {
264 fCoordinates.SetXYZ(a, b, c);
265 return *this;
266 }
267
268 // ------------------- Equality -----------------
269
270 /**
271 Exact equality
272 */
273 bool operator==(const DisplacementVector3D &rhs) const { return fCoordinates == rhs.fCoordinates; }
274 bool operator!=(const DisplacementVector3D &rhs) const { return !(operator==(rhs)); }
275
276 // ------ Individual element access, in various coordinate systems ------
277
278 /**
279 Cartesian X, converting if necessary from internal coordinate system.
280 */
281 Scalar X() const { return fCoordinates.X(); }
282
283 /**
284 Cartesian Y, converting if necessary from internal coordinate system.
285 */
286 Scalar Y() const { return fCoordinates.Y(); }
287
288 /**
289 Cartesian Z, converting if necessary from internal coordinate system.
290 */
291 Scalar Z() const { return fCoordinates.Z(); }
292
293 /**
294 Polar R, converting if necessary from internal coordinate system.
295 */
296 Scalar R() const { return fCoordinates.R(); }
297
298 /**
299 Polar theta, converting if necessary from internal coordinate system.
300 */
301 Scalar Theta() const { return fCoordinates.Theta(); }
302
303 /**
304 Polar phi, converting if necessary from internal coordinate system.
305 */
306 Scalar Phi() const { return fCoordinates.Phi(); }
307
308 /**
309 Polar eta, converting if necessary from internal coordinate system.
310 */
311 Scalar Eta() const { return fCoordinates.Eta(); }
312
313 /**
314 Cylindrical transverse component rho
315 */
316 Scalar Rho() const { return fCoordinates.Rho(); }
317
318 // ----- Other fundamental properties -----
319
320 /**
321 Magnitute squared ( r^2 in spherical coordinate)
322 */
323 Scalar Mag2() const { return fCoordinates.Mag2(); }
324
325 /**
326 Transverse component squared (rho^2 in cylindrical coordinates.
327 */
328 Scalar Perp2() const { return fCoordinates.Perp2(); }
329
330 /**
331 return unit vector parallel to this (scalar)
332 */
335 {
336 const auto tot = R();
337 return tot == 0 ? *this : DisplacementVector3D(*this) / tot;
338 }
339
340 /**
341 return unit vector parallel to this (vector)
342 */
345 {
346 SCALAR tot = R();
347 tot(tot == SCALAR(0)) = SCALAR(1);
348 return DisplacementVector3D(*this) / tot;
349 }
350
351 // ------ Setting of individual elements present in coordinate system ------
352
353 /**
354 Change X - Cartesian3D coordinates only
355 */
357 {
358 fCoordinates.SetX(xx);
359 return *this;
360 }
361
362 /**
363 Change Y - Cartesian3D coordinates only
364 */
366 {
367 fCoordinates.SetY(yy);
368 return *this;
369 }
370
371 /**
372 Change Z - Cartesian3D coordinates only
373 */
375 {
376 fCoordinates.SetZ(zz);
377 return *this;
378 }
379
380 /**
381 Change R - Polar3D coordinates only
382 */
384 {
385 fCoordinates.SetR(rr);
386 return *this;
387 }
388
389 /**
390 Change Theta - Polar3D coordinates only
391 */
393 {
394 fCoordinates.SetTheta(ang);
395 return *this;
396 }
397
398 /**
399 Change Phi - Polar3D or CylindricalEta3D coordinates
400 */
402 {
403 fCoordinates.SetPhi(ang);
404 return *this;
405 }
406
407 /**
408 Change Rho - CylindricalEta3D coordinates only
409 */
411 {
412 fCoordinates.SetRho(rr);
413 return *this;
414 }
415
416 /**
417 Change Eta - CylindricalEta3D coordinates only
418 */
420 {
421 fCoordinates.SetEta(etaval);
422 return *this;
423 }
424
425 // ------ Operations combining two vectors ------
426 // -- need to have the specialized version in order to avoid
427
428 /**
429 Return the scalar (dot) product of two displacement vectors.
430 It is possible to perform the product for any type of vector coordinates,
431 but they must have the same coordinate system tag
432 */
433 template <class OtherCoords>
435 {
436 return X() * v.X() + Y() * v.Y() + Z() * v.Z();
437 }
438 /**
439 Return the scalar (dot) product of two vectors.
440 It is possible to perform the product for any classes
441 implementing x(), y() and z() member functions
442 */
443 template <class OtherVector>
444 Scalar Dot(const OtherVector &v) const
445 {
446 return X() * v.x() + Y() * v.y() + Z() * v.z();
447 }
448
449 /**
450 Return vector (cross) product of two displacement vectors,
451 as a vector in the coordinate system of this class.
452 It is possible to perform the product for any type of vector coordinates,
453 but they must have the same coordinate system tag
454 */
455 template <class OtherCoords>
457 {
459 result.SetXYZ(Y() * v.Z() - v.Y() * Z(), Z() * v.X() - v.Z() * X(), X() * v.Y() - v.X() * Y());
460 return result;
461 }
462 /**
463 Return vector (cross) product of two vectors,
464 as a vector in the coordinate system of this class.
465 It is possible to perform the product for any classes
466 implementing X(), Y() and Z() member functions
467 */
468 template <class OtherVector>
470 {
472 result.SetXYZ(Y() * v.z() - v.y() * Z(), Z() * v.x() - v.z() * X(), X() * v.y() - v.x() * Y());
473 return result;
474 }
475
476 /**
477 Self Addition with a displacement vector.
478 */
479 template <class OtherCoords>
481 {
482 SetXYZ(X() + v.X(), Y() + v.Y(), Z() + v.Z());
483 return *this;
484 }
485
486 /**
487 Self Difference with a displacement vector.
488 */
489 template <class OtherCoords>
491 {
492 SetXYZ(x() - v.x(), y() - v.y(), z() - v.z());
493 return *this;
494 }
495
496 /**
497 multiply this vector by a scalar quantity
498 */
500 {
501 fCoordinates.Scale(a);
502 return *this;
503 }
504
505 /**
506 divide this vector by a scalar quantity
507 */
509 {
510 fCoordinates.Scale(1 / a);
511 return *this;
512 }
513
514 // The following methods (v*a and v/a) could instead be free functions.
515 // They were moved into the class to solve a problem on AIX.
516
517 /**
518 Multiply a vector by a real number
519 */
521 {
522 DisplacementVector3D tmp(*this);
523 tmp *= a;
524 return tmp;
525 }
526
527 /**
528 Negative of the vector
529 */
531
532 /**
533 Positive of the vector, return itself
534 */
535 DisplacementVector3D operator+() const { return *this; }
536
537 /**
538 Division of a vector with a real number
539 */
541 {
542 DisplacementVector3D tmp(*this);
543 tmp /= a;
544 return tmp;
545 }
546
547 // Methods providing limited backward name compatibility with CLHEP
548
549 Scalar x() const { return fCoordinates.X(); }
550 Scalar y() const { return fCoordinates.Y(); }
551 Scalar z() const { return fCoordinates.Z(); }
552 Scalar r() const { return fCoordinates.R(); }
553 Scalar theta() const { return fCoordinates.Theta(); }
554 Scalar phi() const { return fCoordinates.Phi(); }
555 Scalar eta() const { return fCoordinates.Eta(); }
556 Scalar rho() const { return fCoordinates.Rho(); }
557 Scalar mag2() const { return fCoordinates.Mag2(); }
558 Scalar perp2() const { return fCoordinates.Perp2(); }
559 DisplacementVector3D unit() const { return Unit(); }
560
561private:
562 CoordSystem fCoordinates; // internal coordinate system
563
564#ifdef NOT_SURE_THIS_SHOULD_BE_FORBIDDEN
565 /**
566 Cross product involving a position vector is inappropriate
567 */
568 template <class T2>
570#endif
571
572 // the following methods should not compile
573
574 // this should not compile (if from a vector or points with different tag
575 template <class OtherCoords, class OtherTag>
579
580 template <class OtherCoords, class OtherTag>
584
585 template <class OtherCoords, class OtherTag>
587
588 template <class OtherCoords, class OtherTag>
590
591 template <class OtherCoords, class OtherTag>
593
594 template <class OtherCoords, class OtherTag>
596
597 template <class OtherCoords, class OtherTag>
599
600 template <class OtherCoords, class OtherTag>
602};
603
604// ---------- DisplacementVector3D class template ends here ------------
605// ---------------------------------------------------------------------
606
607/**
608 Addition of DisplacementVector3D vectors.
609 The (coordinate system) type of the returned vector is defined to
610 be identical to that of the first vector, which is passed by value
611 */
612template <class CoordSystem1, class CoordSystem2, class U>
618
619/**
620 Difference between two DisplacementVector3D vectors.
621 The (coordinate system) type of the returned vector is defined to
622 be identical to that of the first vector.
623*/
624template <class CoordSystem1, class CoordSystem2, class U>
630
631// #endif // not __CINT__
632
633/**
634 Multiplication of a displacement vector by real number a*v
635*/
636template <class CoordSystem, class U>
639{
640 return v *= a;
641 // Note - passing v by value and using operator *= may save one
642 // copy relative to passing v by const ref and creating a temporary.
643}
644
645// v1*v2 notation for Cross product of two vectors is omitted,
646// since it is always confusing as to whether dot product is meant.
647
648#if !defined(ROOT_MATH_SYCL) && !defined(ROOT_MATH_CUDA)
649// ------------- I/O to/from streams -------------
650
651template <
652 class char_t, class traits_t, class T, class U,
653 typename std::enable_if<std::is_arithmetic<typename DisplacementVector3D<T, U>::Scalar>::value>::type * = nullptr>
654std::basic_ostream<char_t, traits_t> &
655operator<<(std::basic_ostream<char_t, traits_t> &os, DisplacementVector3D<T, U> const &v)
656{
657 if (os) {
658
659 typename T::Scalar a, b, c;
660 v.GetCoordinates(a, b, c);
661
665 BR::Output(os, a);
666 BR::Output(os, b);
667 BR::Output(os, c);
668 } else {
671 }
672 }
673 return os;
674} // op<< <>()
675
676template <
677 class char_t, class traits_t, class T, class U,
678 typename std::enable_if<!std::is_arithmetic<typename DisplacementVector3D<T, U>::Scalar>::value>::type * = nullptr>
679std::basic_ostream<char_t, traits_t> &
680operator<<(std::basic_ostream<char_t, traits_t> &os, DisplacementVector3D<T, U> const &v)
681{
682 if (os) {
683 os << "{ ";
684 for (std::size_t i = 0; i < PositionVector3D<T, U>::Scalar::Size; ++i) {
685 os << "(" << v.x()[i] << "," << v.y()[i] << "," << v.z()[i] << ") ";
686 }
687 os << "}";
688 }
689 return os;
690} // op<< <>()
691
692template <class char_t, class traits_t, class T, class U>
693inline std::basic_istream<char_t, traits_t> &
694operator>>(std::basic_istream<char_t, traits_t> &is, DisplacementVector3D<T, U> &v)
695{
696 if (!is)
697 return is;
698
699 typename T::Scalar a, b, c;
700
704 BR::Input(is, a);
705 BR::Input(is, b);
706 BR::Input(is, c);
707 } else {
709 is >> a;
711 is >> b;
713 is >> c;
715 }
716
717 if (is)
718 v.SetCoordinates(a, b, c);
719 return is;
720
721} // op>> <>()
722
723#endif
724
725} // namespace ROOT_MATH_ARCH
726
727} // namespace ROOT
728
729#endif /* ROOT_MathX_GenVectorX_DisplacementVector3D */
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
#define a(i)
Definition RSha256.hxx:99
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 dest
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 result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
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 Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Class describing a 3D cartesian coordinate system (x, y, z coordinates)
Definition Cartesian3D.h:52
Class describing a generic displacement vector in 3 dimensions.
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
Scalar Theta() const
Polar theta, converting if necessary from internal coordinate system.
DisplacementVector3D(const PositionVector3D< OtherCoords, OtherTag > &)
void GetCoordinates(Scalar &a, Scalar &b, Scalar &c) const
get internal data into 3 Scalar numbers
DisplacementVector3D & operator*=(Scalar a)
multiply this vector by a scalar quantity
DisplacementVector3D Cross(const DisplacementVector3D< OtherCoords, OtherTag > &) const
Scalar Perp2() const
Transverse component squared (rho^2 in cylindrical coordinates.
DisplacementVector3D< CoordSystem, Tag > & SetR(Scalar rr)
Change R - Polar3D coordinates only.
DisplacementVector3D & operator=(const DisplacementVector3D< OtherCoords, Tag > &v)
Assignment operator from a displacement vector of arbitrary type.
Scalar Dot(const DisplacementVector3D< OtherCoords, OtherTag > &) const
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(Scalar a, Scalar b, Scalar c)
Set internal data based on 3 Scalar numbers.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
Scalar R() const
Polar R, converting if necessary from internal coordinate system.
CoordSystem Coordinates() const
Retrieve a copy of the coordinates object.
DisplacementVector3D< CoordSystem, Tag > & SetEta(Scalar etaval)
Change Eta - CylindricalEta3D coordinates only.
Scalar Mag2() const
Magnitute squared ( r^2 in spherical coordinate)
DisplacementVector3D operator+() const
Positive of the vector, return itself.
DisplacementVector3D(const ForeignVector &v)
Construct from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement metho...
DisplacementVector3D operator*(Scalar a) const
Multiply a vector by a real number.
DisplacementVector3D< CoordSystem, Tag > & SetPhi(Scalar ang)
Change Phi - Polar3D or CylindricalEta3D coordinates.
bool operator==(const DisplacementVector3D &rhs) const
Exact equality.
void GetCoordinates(IT begin, IT end) const
get internal data into 3 Scalars at *begin to *end (3 past begin)
DisplacementVector3D Unit() const
return unit vector parallel to this (scalar)
Scalar Phi() const
Polar phi, converting if necessary from internal coordinate system.
DisplacementVector3D< CoordSystem, Tag > & SetX(Scalar xx)
Change X - Cartesian3D coordinates only.
DisplacementVector3D< CoordSystem, Tag > & SetZ(Scalar zz)
Change Z - Cartesian3D coordinates only.
DisplacementVector3D & operator=(const PositionVector3D< OtherCoords, OtherTag > &)
DisplacementVector3D & operator+=(const DisplacementVector3D< OtherCoords, OtherTag > &)
Scalar Rho() const
Cylindrical transverse component rho.
DisplacementVector3D(Scalar a, Scalar b, Scalar c)
Construct from three values of type Scalar.
bool operator!=(const DisplacementVector3D &rhs) const
DisplacementVector3D & operator=(const ForeignVector &v)
Assignment from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement meth...
DisplacementVector3D Cross(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return vector (cross) product of two displacement vectors, as a vector in the coordinate system of th...
DisplacementVector3D(const DisplacementVector3D< OtherCoords, Tag > &v)
Construct from a displacement vector expressed in different coordinates, or using a different Scalar ...
DisplacementVector3D & operator+=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Addition with a displacement vector.
DisplacementVector3D & operator/=(Scalar a)
divide this vector by a scalar quantity
DisplacementVector3D< CoordSystem, Tag > & SetRho(Scalar rr)
Change Rho - CylindricalEta3D coordinates only.
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
void GetCoordinates(Scalar dest[]) const
get internal data into a C-style array of 3 Scalar numbers
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(const Scalar src[])
Set internal data based on a C-style array of 3 Scalar numbers.
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(IT begin, IT end)
Set internal data based on 3 Scalars at *begin to *end.
DisplacementVector3D & operator-=(const DisplacementVector3D< OtherCoords, OtherTag > &)
Scalar Eta() const
Polar eta, converting if necessary from internal coordinate system.
DisplacementVector3D & operator-=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Difference with a displacement vector.
DisplacementVector3D operator-() const
Negative of the vector.
DisplacementVector3D & operator=(const PositionVector3D< OtherCoords, Tag > &rhs)
Assignment operator from a position vector (not necessarily efficient unless one or the other is Cart...
DisplacementVector3D(const PositionVector3D< OtherCoords, Tag > &p)
Construct from a position vector expressed in different coordinates but with the same coordinate syst...
DisplacementVector3D< CoordSystem, Tag > & SetY(Scalar yy)
Change Y - Cartesian3D coordinates only.
DisplacementVector3D(const DisplacementVector3D< OtherCoords, OtherTag > &)
Scalar Dot(const OtherVector &v) const
Return the scalar (dot) product of two vectors.
DisplacementVector3D operator/(Scalar a) const
Division of a vector with a real number.
DisplacementVector3D & operator=(const DisplacementVector3D< OtherCoords, OtherTag > &)
Scalar Dot(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return the scalar (dot) product of two displacement vectors.
DisplacementVector3D< CoordSystem, Tag > & SetTheta(Scalar ang)
Change Theta - Polar3D coordinates only.
DisplacementVector3D< CoordSystem, Tag > & SetXYZ(Scalar a, Scalar b, Scalar c)
set the values of the vector from the cartesian components (x,y,z) (if the vector is held in polar or...
DisplacementVector3D Cross(const OtherVector &v) const
Return vector (cross) product of two vectors, as a vector in the coordinate system of this class.
void GetCoordinates(IT begin) const
get internal data into 3 Scalars starting at *begin
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
std::basic_istream< char_t, traits_t > & require_delim(std::basic_istream< char_t, traits_t > &is, manip_t m)
char_t get_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m)
Definition GenVectorIO.h:60
void set_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m, char_t ch)
Definition GenVectorIO.h:77
std::ostream & operator<<(std::ostream &os, const AxisAngle &a)
Stream Output and Input.
Definition AxisAngle.cxx:98
std::basic_istream< char_t, traits_t > & operator>>(std::basic_istream< char_t, traits_t > &is, DisplacementVector2D< T, U > &v)
DisplacementVector2D< CoordSystem1, U > operator-(DisplacementVector2D< CoordSystem1, U > v1, DisplacementVector2D< CoordSystem2, U > const &v2)
Difference between two DisplacementVector2D vectors.
AxisAngle operator*(RotationX const &r1, AxisAngle const &r2)
Multiplication of an axial rotation by an AxisAngle.
DisplacementVector2D< CoordSystem1, U > operator+(DisplacementVector2D< CoordSystem1, U > v1, const DisplacementVector2D< CoordSystem2, U > &v2)
Addition of DisplacementVector2D vectors.