![]() |
Belle II Software light-2607-kasei
|
A fast and root compatible alternative to TVector3. More...
#include <B2Vector3.h>
Public Types | |
| typedef DataType | value_type |
| storage type of the vector | |
Public Member Functions | |
| B2Vector3 (void) | |
| empty Constructor sets everything to 0 | |
| B2Vector3 (const DataType xVal, const DataType yVal, const DataType zVal) | |
| Constructor expecting 3 coordinates. | |
| B2Vector3 (const DataType(&coords)[3]) | |
| Constructor using a reference. | |
| B2Vector3 (const DataType(*coords)[3]) | |
| Constructor using a pointer. | |
| B2Vector3 (const TVector3 &tVec3) | |
| Constructor expecting a TVector3. | |
| B2Vector3 (const TVector3 *tVec3) | |
| Constructor expecting a pointer to a TVector3. | |
| B2Vector3 (const B2Vector3< DataType > &b2Vec3) | |
| Constructor expecting a B2Vector3 of same type. | |
| B2Vector3 (const B2Vector3< DataType > *b2Vec3) | |
| Constructor expecting a pointer to a B2Vector3. | |
| template<typename OtherType> | |
| B2Vector3 (const B2Vector3< OtherType > &b2Vec3) | |
| Constructor expecting a B2Vector3 of different type. | |
| template<typename OtherType> | |
| B2Vector3 (const B2Vector3< OtherType > *b2Vec3) | |
| Constructor expecting a pointer to a B2Vector3 of different type. | |
| B2Vector3 (const ROOT::Math::XYZVector &xyzVec) | |
| Constructor expecting a XYZVector. | |
| B2Vector3 (const ROOT::Math::XYZVector *xyzVec) | |
| Constructor expecting a pointer to a XYZVector. | |
| DataType | operator() (unsigned i) const |
| member access without boundary check | |
| DataType | operator[] (unsigned i) const |
| member access without boundary check | |
| DataType & | operator() (unsigned i) |
| member access without boundary check | |
| DataType & | operator[] (unsigned i) |
| member access without boundary check | |
| B2Vector3< DataType > & | operator= (const B2Vector3< DataType > &b) |
| Assignment via B2Vector3. | |
| B2Vector3< DataType > & | operator= (const TVector3 &b) |
| Assignment via TVector3. | |
| B2Vector3< DataType > & | operator= (const ROOT::Math::XYZVector &b) |
| Assignment via XYZVector. | |
| operator TVector3 () const | |
| type conversion in TVector3 | |
| operator ROOT::Math::XYZVector () const | |
| type conversion in ROOT::Math::XYZVector | |
| bool | operator== (const B2Vector3< DataType > &b) const |
| Comparison for equality with a B2Vector3. | |
| bool | operator== (const TVector3 &b) const |
| Comparison for equality with a TVector3. | |
| bool | operator== (const ROOT::Math::XYZVector &b) const |
| Comparison for equality with a XYZVector. | |
| bool | operator!= (const B2Vector3< DataType > &b) const |
| Comparison != with a B2Vector3. | |
| bool | operator!= (const TVector3 &b) const |
| Comparison != with a TVector3. | |
| bool | operator!= (const ROOT::Math::XYZVector &b) const |
| Comparison != with a XYZVector. | |
| B2Vector3< DataType > & | operator+= (const B2Vector3< DataType > &b) |
| addition | |
| B2Vector3< DataType > & | operator-= (const B2Vector3< DataType > &b) |
| subtraction | |
| B2Vector3< DataType > & | operator*= (DataType a) |
| scaling with real numbers | |
| B2Vector3< DataType > | operator- () const |
| unary minus | |
| B2Vector3< DataType > | operator+ (const B2Vector3< DataType > &b) const |
| Addition of 3-vectors. | |
| B2Vector3< DataType > | operator- (const B2Vector3< DataType > &b) const |
| Subtraction of 3-vectors. | |
| B2Vector3< DataType > | operator* (DataType a) const |
| Scaling of 3-vectors with a real number. | |
| B2Vector3< DataType > | operator/ (DataType a) const |
| Scaling of 3-vectors with a real number. | |
| DataType | operator* (const B2Vector3< DataType > &b) const |
| Scalar product of 3-vectors. | |
| DataType | Phi () const |
| The azimuth angle. | |
| DataType | Theta () const |
| The polar angle. | |
| DataType | CosTheta () const |
| Cosine of the polar angle. | |
| DataType | Mag2 () const |
| The magnitude squared (rho^2 in spherical coordinate system). | |
| DataType | Mag () const |
| The magnitude (rho in spherical coordinate system). | |
| void | SetPhi (DataType phi) |
| Set phi keeping mag and theta constant. | |
| void | SetTheta (DataType theta) |
| Set theta keeping mag and phi constant. | |
| void | SetMag (DataType mag) |
| Set magnitude keeping theta and phi constant. | |
| DataType | Perp2 () const |
| The transverse component squared (R^2 in cylindrical coordinate system). | |
| DataType | Pt () const |
| The transverse component (R in cylindrical coordinate system). | |
| DataType | Perp () const |
| The transverse component (R in cylindrical coordinate system). | |
| void | SetPerp (DataType r) |
| Set the transverse component keeping phi and z constant. | |
| DataType | Perp2 (const B2Vector3< DataType > &axis) const |
| The transverse component w.r.t. | |
| DataType | Pt (const B2Vector3< DataType > &axis) const |
| The transverse component w.r.t. | |
| DataType | Perp (const B2Vector3< DataType > &axis) const |
| The transverse component w.r.t. | |
| DataType | DeltaPhi (const B2Vector3< DataType > &v) const |
| returns phi in the interval [-PI,PI) | |
| DataType | DeltaR (const B2Vector3< DataType > &v) const |
| return deltaR with respect to input-vector | |
| DataType | DrEtaPhi (const B2Vector3< DataType > &v) const |
| return DrEtaPhi with respect to input-vector | |
| void | SetMagThetaPhi (DataType mag, DataType theta, DataType phi) |
| setter with mag, theta, phi | |
| B2Vector3< DataType > | Unit () const |
| Unit vector parallel to this. | |
| B2Vector3< DataType > | Orthogonal () const |
| Vector orthogonal to this one. | |
| DataType | Dot (const B2Vector3< DataType > &p) const |
| Scalar product. | |
| B2Vector3< DataType > | Cross (const B2Vector3< DataType > &p) const |
| Cross product. | |
| DataType | Angle (const B2Vector3< DataType > &q) const |
| The angle w.r.t. | |
| DataType | PseudoRapidity () const |
| Returns the pseudo-rapidity, i.e. | |
| DataType | Eta () const |
| Returns the pseudo-rapidity. | |
| void | RotateX (DataType angle) |
| Rotates the B2Vector3 around the x-axis. | |
| void | RotateY (DataType angle) |
| Rotates the B2Vector3 around the y-axis. | |
| void | RotateZ (DataType angle) |
| Rotates the B2Vector3 around the z-axis. | |
| void | RotateUz (const B2Vector3< DataType > &NewUzVector) |
| Rotates reference frame from Uz to newUz (unit vector). | |
| void | Rotate (DataType alpha, const B2Vector3< DataType > &v) |
| Rotation around an arbitrary axis v with angle alpha. | |
| void | Abs () |
| calculates the absolute value of the coordinates element-wise | |
| void | Sqrt () |
| calculates the square root of the absolute values of the coordinates element-wise | |
| DataType | at (unsigned i) const |
| safe member access (with boundary check!) | |
| DataType | x () const |
| access variable X (= .at(0) without boundary check) | |
| DataType | y () const |
| access variable Y (= .at(1) without boundary check) | |
| DataType | z () const |
| access variable Z (= .at(2) without boundary check) | |
| DataType | X () const |
| access variable X (= .at(0) without boundary check) | |
| DataType | Y () const |
| access variable Y (= .at(1) without boundary check) | |
| DataType | Z () const |
| access variable Z (= .at(2) without boundary check) | |
| DataType | Px () const |
| access variable X (= .at(0) without boundary check) | |
| DataType | Py () const |
| access variable Y (= .at(1) without boundary check) | |
| DataType | Pz () const |
| access variable Z (= .at(2) without boundary check) | |
| void | GetXYZ (Double_t *carray) const |
| directly copies coordinates to an array of double | |
| void | GetXYZ (Float_t *carray) const |
| directly copies coordinates to an array of float | |
| void | GetXYZ (TVector3 *tVec) const |
| directly copies coordinates to a TVector3 | |
| void | GetXYZ (ROOT::Math::XYZVector *xyzVec) const |
| directly copies coordinates to a XYZVector | |
| TVector3 | GetTVector3 () const |
| returns a TVector3 containing the same coordinates | |
| ROOT::Math::XYZVector | GetXYZVector () const |
| returns a XYZVector containing the same coordinates | |
| void | SetX (DataType x) |
| set X/1st-coordinate | |
| void | SetY (DataType y) |
| set Y/2nd-coordinate | |
| void | SetZ (DataType z) |
| set Z/3rd-coordinate | |
| void | SetXYZ (DataType x, DataType y, DataType z) |
| set all coordinates using data type | |
| void | SetXYZ (const TVector3 &tVec) |
| set all coordinates using a reference to TVector3 | |
| void | SetXYZ (const TVector3 *tVec) |
| set all coordinates using a pointer to TVector3 | |
| void | SetXYZ (const ROOT::Math::XYZVector &xyzVec) |
| set all coordinates using a reference to XYZVector | |
| void | SetXYZ (const ROOT::Math::XYZVector *xyzVec) |
| set all coordinates using a pointer to XYZVector | |
| std::string | PrintString (unsigned precision=4) const |
| create a string containing vector in cartesian and spherical coordinates | |
| std::string | PrintStringXYZ (unsigned precision=4) const |
| create a string containing vector in cartesian coordinates | |
| std::string | PrintStringCyl (unsigned precision=4) const |
| create a string containing vector in spherical coordinates | |
| void | Print () |
| just for backward compatibility, should not be used with new code | |
Static Public Member Functions | |
| static DataType | Mpi_pi (DataType angle) |
| returns given angle in the interval [-PI,PI) | |
| static std::string | name () |
| Returns the name of the B2Vector. | |
Protected Attributes | |
| DataType | m_coordinates [3] {} |
| Make sure that we only have floating point vectors. | |
A fast and root compatible alternative to TVector3.
Goals:
DataType: shall be the data type one wants to store in the B2Vector (e.g. double)
Definition at line 42 of file B2Vector3.h.
| typedef DataType value_type |
storage type of the vector
Definition at line 50 of file B2Vector3.h.
|
inline |
empty Constructor sets everything to 0
Definition at line 53 of file B2Vector3.h.
|
inline |
Constructor expecting 3 coordinates.
Definition at line 55 of file B2Vector3.h.
|
inlineexplicit |
Constructor using a reference.
Definition at line 57 of file B2Vector3.h.
|
inlineexplicit |
Constructor using a pointer.
Definition at line 59 of file B2Vector3.h.
|
inline |
Constructor expecting a TVector3.
Definition at line 62 of file B2Vector3.h.
|
inline |
Constructor expecting a pointer to a TVector3.
Definition at line 65 of file B2Vector3.h.
Constructor expecting a B2Vector3 of same type.
Definition at line 67 of file B2Vector3.h.
Constructor expecting a pointer to a B2Vector3.
Definition at line 69 of file B2Vector3.h.
|
inline |
Constructor expecting a B2Vector3 of different type.
Definition at line 71 of file B2Vector3.h.
|
inlineexplicit |
Constructor expecting a pointer to a B2Vector3 of different type.
Definition at line 74 of file B2Vector3.h.
|
inline |
Constructor expecting a XYZVector.
Definition at line 78 of file B2Vector3.h.
|
inline |
Constructor expecting a pointer to a XYZVector.
Definition at line 81 of file B2Vector3.h.
|
inline |
calculates the absolute value of the coordinates element-wise
Definition at line 405 of file B2Vector3.h.
|
inline |
The angle w.r.t.
another B2Vector3.
Definition at line 301 of file B2Vector3.h.
|
inline |
Cosine of the polar angle.
Definition at line 154 of file B2Vector3.h.
|
inline |
Cross product.
Definition at line 295 of file B2Vector3.h.
|
inline |
returns phi in the interval [-PI,PI)
Definition at line 227 of file B2Vector3.h.
|
inline |
return deltaR with respect to input-vector
Definition at line 244 of file B2Vector3.h.
|
inline |
Scalar product.
Definition at line 289 of file B2Vector3.h.
|
inline |
return DrEtaPhi with respect to input-vector
Definition at line 252 of file B2Vector3.h.
|
inline |
Returns the pseudo-rapidity.
Definition at line 330 of file B2Vector3.h.
|
inline |
The magnitude (rho in spherical coordinate system).
Definition at line 158 of file B2Vector3.h.
|
inline |
The magnitude squared (rho^2 in spherical coordinate system).
Definition at line 156 of file B2Vector3.h.
|
inlinestatic |
returns given angle in the interval [-PI,PI)
Definition at line 231 of file B2Vector3.h.
|
inline |
type conversion in ROOT::Math::XYZVector
Definition at line 102 of file B2Vector3.h.
|
inline |
type conversion in TVector3
Definition at line 100 of file B2Vector3.h.
|
inline |
Comparison != with a B2Vector3.
Definition at line 111 of file B2Vector3.h.
|
inline |
Comparison != with a XYZVector.
Definition at line 115 of file B2Vector3.h.
|
inline |
Comparison != with a TVector3.
Definition at line 113 of file B2Vector3.h.
|
inline |
member access without boundary check
Definition at line 88 of file B2Vector3.h.
|
inline |
member access without boundary check
Definition at line 84 of file B2Vector3.h.
|
inline |
|
inline |
Scaling of 3-vectors with a real number.
Definition at line 136 of file B2Vector3.h.
|
inline |
Addition of 3-vectors.
Definition at line 126 of file B2Vector3.h.
|
inline |
unary minus
Definition at line 124 of file B2Vector3.h.
|
inline |
Subtraction of 3-vectors.
Definition at line 131 of file B2Vector3.h.
|
inline |
Scaling of 3-vectors with a real number.
Definition at line 141 of file B2Vector3.h.
|
inline |
Comparison for equality with a B2Vector3.
Definition at line 105 of file B2Vector3.h.
|
inline |
Comparison for equality with a XYZVector.
Definition at line 109 of file B2Vector3.h.
|
inline |
Comparison for equality with a TVector3.
Definition at line 107 of file B2Vector3.h.
|
inline |
member access without boundary check
Definition at line 90 of file B2Vector3.h.
|
inline |
member access without boundary check
Definition at line 86 of file B2Vector3.h.
|
inline |
Vector orthogonal to this one.
Definition at line 276 of file B2Vector3.h.
|
inline |
The transverse component (R in cylindrical coordinate system).
Definition at line 199 of file B2Vector3.h.
|
inline |
The transverse component w.r.t.
given axis.
Definition at line 225 of file B2Vector3.h.
|
inline |
The transverse component squared (R^2 in cylindrical coordinate system).
Definition at line 195 of file B2Vector3.h.
|
inline |
The transverse component w.r.t.
given axis squared.
Definition at line 212 of file B2Vector3.h.
|
inline |
The azimuth angle.
returns phi from -pi to pi
Definition at line 150 of file B2Vector3.h.
|
inline |
just for backward compatibility, should not be used with new code
Definition at line 506 of file B2Vector3.h.
|
inline |
create a string containing vector in cartesian and spherical coordinates
Definition at line 480 of file B2Vector3.h.
|
inline |
create a string containing vector in spherical coordinates
Definition at line 496 of file B2Vector3.h.
|
inline |
create a string containing vector in cartesian coordinates
Definition at line 486 of file B2Vector3.h.
|
inline |
Returns the pseudo-rapidity, i.e.
-ln(tan(theta/2)).
for the sake of keeping compatibility to TVector3, the hardcoded values are not replaced by something more intelligent
Definition at line 318 of file B2Vector3.h.
|
inline |
The transverse component (R in cylindrical coordinate system).
Definition at line 197 of file B2Vector3.h.
|
inline |
The transverse component w.r.t.
given axis.
Definition at line 223 of file B2Vector3.h.
|
inline |
access variable X (= .at(0) without boundary check)
Definition at line 436 of file B2Vector3.h.
|
inline |
access variable Y (= .at(1) without boundary check)
Definition at line 438 of file B2Vector3.h.
|
inline |
access variable Z (= .at(2) without boundary check)
Definition at line 440 of file B2Vector3.h.
|
inline |
Rotation around an arbitrary axis v with angle alpha.
With n = (n1, n2, n3)^T being the unit vector of v, the rotation matrix R(n, alpha) with ca = cos(alpha) and sa = sin(alpha) reads / n1^2*(1-ca)+ca n1*n2*(1-ca)-n3*sa n1*n3*(1-ca)+n2*sa \ R(n, alpha) = | n2*n1*(1-ca)+n3*sa n2^2*(1-ca)+ca n2*n3*(1-ca)-n1*sa | \ n3*n1*(1-ca)-n2*sa n3*n2*(1-ca)+n1*sa n3^2*(1-ca)+ca / . Using this rotation matrix, the full rotation of a vector b (= this) around the axis v by angle alpha can be written as R(n, alpha)*b = n(n*b) + cos(alpha) * (n x b) x n + sin(alpha) * (n x b).
Definition at line 398 of file B2Vector3.h.
|
inline |
Rotates reference frame from Uz to newUz (unit vector).
Definition at line 369 of file B2Vector3.h.
|
inline |
Rotates the B2Vector3 around the x-axis.
Definition at line 334 of file B2Vector3.h.
|
inline |
Rotates the B2Vector3 around the y-axis.
Definition at line 346 of file B2Vector3.h.
|
inline |
Rotates the B2Vector3 around the z-axis.
Definition at line 358 of file B2Vector3.h.
|
inline |
Set magnitude keeping theta and phi constant.
Definition at line 181 of file B2Vector3.h.
|
inline |
setter with mag, theta, phi
Definition at line 258 of file B2Vector3.h.
|
inline |
Set the transverse component keeping phi and z constant.
Definition at line 202 of file B2Vector3.h.
|
inline |
Set phi keeping mag and theta constant.
Definition at line 161 of file B2Vector3.h.
|
inline |
Set theta keeping mag and phi constant.
Definition at line 169 of file B2Vector3.h.
|
inline |
|
inline |
set all coordinates using data type
Definition at line 463 of file B2Vector3.h.
|
inline |
|
inline |
|
inline |
calculates the square root of the absolute values of the coordinates element-wise
Definition at line 413 of file B2Vector3.h.
|
inline |
The polar angle.
Definition at line 152 of file B2Vector3.h.
Unit vector parallel to this.
Definition at line 268 of file B2Vector3.h.
|
inline |
access variable X (= .at(0) without boundary check)
Definition at line 430 of file B2Vector3.h.
|
inline |
access variable X (= .at(0) without boundary check)
Definition at line 424 of file B2Vector3.h.
|
inline |
access variable Y (= .at(1) without boundary check)
Definition at line 432 of file B2Vector3.h.
|
inline |
access variable Y (= .at(1) without boundary check)
Definition at line 426 of file B2Vector3.h.
|
inline |
access variable Z (= .at(2) without boundary check)
Definition at line 434 of file B2Vector3.h.
|
inline |
access variable Z (= .at(2) without boundary check)
Definition at line 428 of file B2Vector3.h.
|
protected |
Make sure that we only have floating point vectors.
contains the coordinates in given data type
Definition at line 47 of file B2Vector3.h.