|
|
Go to the documentation of this file. 1 #ifndef GeometryVector_oldBasic3DVector_h
2 #define GeometryVector_oldBasic3DVector_h
3 #if ( defined(__CLING__) || defined(__CINT__) ) && !defined(__REFLEX__)
24 eta(
long double x,
long double y,
long double z) {
long double t(
z/
std::sqrt(x*x+
y*
y)); return ::asinhl(
t);}
28 template <
typename T>
66 template <
class OtherPo
int>
71 #if defined(USE_EXTVECT)
75 #elif defined(USE_SSEVECT)
100 template <
typename U>
130 return x()==rh.
x() &&
y()==rh.
y() &&
z()==rh.
z();
174 if (my_mag==0)
return *
this;
176 return *
this * my_mag;
225 return x()*
v.x() +
y()*
v.y() +
z()*
v.z();
235 return x()*
v.x() +
y()*
v.y() +
z()*
v.z();
241 z()*
v.x() -
v.z()*
x(),
256 x()*
v.y() -
v.x()*
y());
272 std::ostream &
print3D(std::ostream&
s,
double x,
double y,
double z);
283 template <
class T,
class U>
287 return RT(
a.x()+
b.x(),
a.y()+
b.y(),
a.z()+
b.z(),
a.w()+
b.w());
290 template <
class T,
class U>
294 return RT(
a.x()-
b.x(),
a.y()-
b.y(),
a.z()-
b.z(),
a.w()-
b.w());
304 template <
class T,
class U>
307 return v1.
x()*v2.
x() + v1.
y()*v2.
y() + v1.
z()*v2.
z();
324 template <
class T,
typename S>
326 return static_cast<T>(
t)*
v;
329 template <
class T,
typename S>
331 return static_cast<T>(
t)*
v;
338 template <
class T,
typename S>
350 #endif // GeometryVector_Basic3DVector_h
Geom::Theta< T > theta() const
Basic3DVector(const OtherPoint &p)
T transverse() const
Another name for perp()
Basic2DVector< T > xy() const
Basic3DVector(const Geom::Theta< U > &theta, const Geom::Phi< U > &phi, const T &r)
Basic3DVector & operator/=(T t)
Scaling by a scalar value (division)
Basic3DVector< typename PreciseFloatType< T, U >::Type > operator+(const Basic3DVector< T > &a, const Basic3DVector< U > &b)
vector sum and subtraction of vectors of possibly different precision
T perp2() const
Squared magnitude of transverse component.
std::ostream & operator<<(std::ostream &s, const Basic3DVector< T > &v)
simple text output to standard streams
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
T operator*(const Basic3DVector< T > &v1, const Basic3DVector< T > &v2)
scalar product of vectors of same precision
PreciseFloatType< T, U >::Type dot(const Basic3DVector< U > &v) const
Basic3DVector(const Basic3DVector &p)
Copy constructor from same type. Should not be needed but for gcc bug 12685.
Basic3DVector< typename PreciseFloatType< T, U >::Type > cross(const Basic3DVector< U > &v) const
T y() const
Cartesian y coordinate.
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
float __attribute__((always_inline)) __attribute__((pure)) eta(float x
std::ostream & print3D(std::ostream &s, double x, double y, double z)
T operator[](int i) const
Basic3DVector & operator*=(T t)
Scaling by a scalar value (multiplication)
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.
bool operator==(const Basic3DVector &rh) const
Basic3DVector< T > MathVector
class Basic3DVector __attribute__((aligned(16)))
Basic3DVector< T > operator/(const Basic3DVector< T > &v, S s)
Basic3DVector< double > Basic3DVectorD
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
Basic3DVector & operator+=(const Basic3DVector< U > &p)
Basic3DVector operator-() const
Unary minus, returns a vector with components (-x(),-y(),-z())
Basic3DVector & operator-=(const Basic3DVector< U > &p)
Basic3DVector< long double > Basic3DVectorLD
Basic3DVector(const Basic3DVector< U > &p)
Copy constructor and implicit conversion from Basic3DVector of different precision.
Geom::Spherical2Cartesian< T > Spherical
T x() const
Cartesian x coordinate.
Geom::Cylindrical2Cartesian< T > Cylindrical
T perp() const
Magnitude of transverse component.
T z() const
Cartesian z coordinate.
Basic3DVector unit() const
Geom::Phi< T > phi() const
Basic3DVector(const Basic2DVector< T > &p)
constructor from 2D vector (X and Y from 2D vector, z set to zero)
Basic3DVector operator-() const
Unary minus, returns a vector with components (-x(),-y(),-z())
Basic3DVector< float > Basic3DVectorF