1 #ifndef GeometryVector_oldBasic3DVector_h
2 #define GeometryVector_oldBasic3DVector_h
3 #if defined(__CINT__) && !defined(__REFLEX__)
17 namespace detailsBasic3DVector {
19 eta(
float x,
float y,
float z) {
float t(z/
std::sqrt(x*x+y*y)); return ::asinhf(
t);}
21 eta(
double x,
double y,
double z) {
double t(z/
std::sqrt(x*x+y*y)); return ::asinh(
t);}
23 eta(
long double x,
long double y,
long double z) {
long double t(z/
std::sqrt(x*x+y*y)); return ::asinhl(
t);}
27 template <
typename T>
65 template <
class OtherPo
int>
119 return x()==rh.
x() &&
y()==rh.
y() &&
z()==rh.
z();
163 if (my_mag==0)
return *
this;
165 return *
this * my_mag;
214 return x()*v.
x() +
y()*v.
y() +
z()*v.
z();
224 return x()*v.
x() +
y()*v.
y() +
z()*v.
z();
230 z()*v.
x() - v.
z()*
x(),
245 x()*v.
y() - v.
x()*
y());
260 namespace geometryDetails {
261 std::ostream &
print3D(std::ostream&
s,
double x,
double y,
double z);
266 inline std::ostream & operator<<( std::ostream& s, const Basic3DVector<T>&
v) {
272 template <
class T,
class U>
276 return RT(a.
x()+b.
x(), a.
y()+b.
y(), a.
z()+b.
z(), a.
w()+b.
w());
279 template <
class T,
class U>
283 return RT(a.
x()-b.
x(), a.
y()-b.
y(), a.
z()-b.
z(), a.
w()-b.
w());
293 template <
class T,
class U>
296 return v1.
x()*v2.
x() + v1.
y()*v2.
y() + v1.
z()*v2.
z();
313 template <
class T,
typename S>
315 return static_cast<T>(
t)*v;
318 template <
class T,
typename S>
320 return static_cast<T>(
t)*v;
327 template <
class T,
typename S>
339 #endif // GeometryVector_Basic3DVector_h
Basic3DVector< typename PreciseFloatType< T, U >::Type > cross(const Basic3DVector< U > &v) const
Basic2DVector< T > xy() const
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
PreciseFloatType< T, U >::Type dot(const Basic3DVector< U > &v) const
MatrixMeschach operator+(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
T perp2() const
Squared magnitude of transverse component.
Geom::Theta< T > theta() const
Basic3DVector unit() const
MatrixMeschach operator-(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
bool operator==(const Basic3DVector &rh) const
Basic3DVector(const Basic3DVector &p)
Copy constructor from same type. Should not be needed but for gcc bug 12685.
Geom::Phi< T > phi() const
Basic3DVector< long double > operator/(const Basic3DVector< long double > &v, S s)
Basic3DVector(mathSSE::Vec4< U > const &iv)
Basic3DVector< float > Basic3DVectorF
Basic3DVector & operator/=(T t)
Scaling by a scalar value (division)
Basic3DVector(const Geom::Theta< U > &theta, const Geom::Phi< U > &phi, const T &r)
float float float z float t(z/std::sqrt(x *x+y *y))
T z() const
Cartesian z coordinate.
Basic3DVector & operator*=(T t)
Scaling by a scalar value (multiplication)
Basic3DVector & operator+=(const Basic3DVector< U > &p)
Basic3DVector< T > MathVector
T perp() const
Magnitude of transverse component.
Basic3DVector< double > Basic3DVectorD
Basic3DVector & operator-=(const Basic3DVector< U > &p)
Basic3DVector< long double > Basic3DVectorLD
T value() const
Explicit access to value in case implicit conversion not OK.
T value() const
Explicit access to value in case implicit conversion not OK.
Basic3DVector(const Basic3DVector< U > &p)
Copy constructor and implicit conversion from Basic3DVector of different precision.
Basic3DVector(const Basic2DVector< T > &p)
constructor from 2D vector (X and Y from 2D vector, z set to zero)
Geom::Spherical2Cartesian< T > Spherical
Geom::Cylindrical2Cartesian< T > Cylindrical
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
T transverse() const
Another name for perp()
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
MatrixMeschach operator*(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
std::ostream & print3D(std::ostream &s, double x, double y, double z)
Basic3DVector operator-() const
Unary minus, returns a vector with components (-x(),-y(),-z())
Basic3DVector(const OtherPoint &p)
class Geom::Polar2Cartesian __attribute__
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.