19#ifndef ROOT_Math_GenVector_Cartesian3D
20#define ROOT_Math_GenVector_Cartesian3D 1
45template <
class T =
double>
68 template <
class CoordSystem>
81 { dest[0] =
fX; dest[1] =
fY; dest[2] =
fZ; }
151 template <
class CoordSystem>
172 T
x()
const {
return X();}
173 T
y()
const {
return Y();}
174 T
z()
const {
return Z(); }
181 const T rho =
v.Rho();
184 fX = rho * std::cos(
v.Phi());
185 fY = rho * std::sin(
v.Phi());
195 const T rho =
v.Rho();
197 fX = rho * cos(
v.Phi());
199 fY = rho * sin(
v.Phi());
206#if defined(__ROOTCLING__) || defined(G__DICTIONARY)
212 void SetTheta(
Scalar theta);
235#if defined(__ROOTCLING__) || defined(G__DICTIONARY)
250void Cartesian3D<T>::SetR(Scalar
r) {
251 GenVector_exception
e(
"Cartesian3D::SetR() is not supposed to be called");
253 Polar3D<Scalar>
v(*
this);
v.SetR(
r); *
this = Cartesian3D<Scalar>(
v);
Class describing a 3D cartesian coordinate system (x, y, z coordinates).
void SetXYZ(Scalar xx, Scalar yy, Scalar zz)
set all values using cartesian coordinates
Cartesian3D & operator=(const CoordSystem &v)
Assignment from any class implementing x(),y() and z() (can assign from any coordinate system).
constexpr Cartesian3D() noexcept=default
Default constructor with x=y=z=0.
static constexpr unsigned int Dimension
bool operator!=(const Cartesian3D &rhs) const
constexpr Cartesian3D(const CoordSystem &v)
Construct from any Vector or coordinate system implementing X(), Y() and Z().
bool operator==(const Cartesian3D &rhs) const
Exact equality.
void SetCoordinates(const Scalar src[])
Set internal data based on an array of 3 Scalar numbers.
void GetCoordinates(Scalar dest[]) const
get internal data into an array of 3 Scalar numbers
void Scale(Scalar a)
scale the vector by a scalar quantity a
constexpr Cartesian3D(const Polar3D< T2 > &v)
void SetCoordinates(Scalar xx, Scalar yy, Scalar zz)
Set internal data based on 3 Scalar numbers.
void SetZ(Scalar zz)
set the z coordinate value keeping x and y constant
void GetCoordinates(Scalar &xx, Scalar &yy, Scalar &zz) const
get internal data into 3 Scalar numbers
void SetX(Scalar xx)
set the x coordinate value keeping y and z constant
void SetY(Scalar yy)
set the y coordinate value keeping x and z constant
void Negate()
negate the vector
Class describing a cylindrical coordinate system based on eta (pseudorapidity) instead of z.
Class describing a polar coordinate system based on r, theta and phi Phi is restricted to be in the r...
Namespace for new Math classes and functions.
Scalar Eta_FromRhoZ(Scalar rho, Scalar z)
Calculate eta given rho and zeta.
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
Rotation3D::Scalar Scalar