8 #ifndef DDSegmentation_SEGMENTATIONUTIL_H_
9 #define DDSegmentation_SEGMENTATIONUTIL_H_
15 namespace DDSegmentation {
33 return std::sqrt(position.
X * position.
X + position.
Y * position.
Y + position.
Z * position.
Z);
38 return std::sqrt(position.
X * position.
X + position.
Y * position.
Y);
48 return std::atan2(position.
Y, position.
X);
57 return Vector3D(r * std::cos(phi), r * std::sin(phi), z);
62 return std::sqrt(r * r + z * z);
67 return r * std::cos(phi);
72 return r * std::sin(phi);
77 return r * std::atan(z / r);
86 return Vector3D(r * std::cos(phi), r * std::sin(phi), r * std::tan(theta));
91 double r = mag * sin(theta);
92 return Vector3D(r * std::cos(phi), r * std::sin(phi), mag * std::cos(theta));
double magFromXYZ(const Vector3D &position)
Conversions from Cartesian to cylindrical/spherical coordinates ///.
double radiusFromXYZ(const Vector3D &position)
calculates the radius in the xy-plane from Cartesian coordinates
Vector3D positionFromMagThetaPhi(double mag, double theta, double phi)
calculates the Cartesian position from spherical coordinates
double thetaFromXYZ(const Vector3D &position)
calculates the polar angle theta from Cartesian coordinates
double yFromRPhiZ(double r, double phi, double)
calculates y from cylindrical coordinates
double magFromRPhiZ(double r, double, double z)
calculates the radius in xyz from cylindrical coordinates
double phiFromXYZ(const Vector3D &position)
calculates the azimuthal angle phi from Cartesian coordinates
Simple container for a physics vector.
double xFromRPhiZ(double r, double phi, double)
calculates x from cylindrical coordinates
double thetaFromRPhiZ(double r, double, double z)
calculates the polar angle theta from cylindrical coordinates
Vector3D positionFromRThetaPhi(double r, double theta, double phi)
Conversions from spherical to Cartesian coordinates ///.
Vector3D positionFromRPhiZ(double r, double phi, double z)
Conversions from cylindrical to Cartesian coordinates ///.