19 #include <type_traits> 24 inline float operator*(
const Vec3D left,
const Vec3D right);
35 friend inline std::ostream &
operator<<(std::ostream &os,
const Vec3D &vec);
43 :
CooArray<float>(
std::numeric_limits<float>::max(),
std::numeric_limits<float>::max(),
44 std::numeric_limits<float>::max()) {}
87 (*this) /= this->
Mag();
92 (*this) /= this->
Mag();
97 (*this) /= this->
Mag();
102 (*this) /= this->
Mag();
111 void Dump()
const { std::cout << *
this << std::endl; }
118 float Mag()
const {
return std::sqrt((*
this) * (*
this)); }
132 Vec3D product(a, b, c);
207 template <typename T, typename std::enable_if<std::is_arithmetic<T>::value>::type * =
nullptr>
216 template <typename T, typename std::enable_if<std::is_arithmetic<T>::value>::type * =
nullptr>
231 template <typename T, typename std::enable_if<std::is_arithmetic<T>::value>::type * =
nullptr>
240 template <typename T, typename std::enable_if<std::is_arithmetic<T>::value>::type * =
nullptr>
273 return std::move(right);
282 template <typename T, typename std::enable_if<std::is_arithmetic<T>::value>::type * =
nullptr>
289 template <typename T, typename std::enable_if<std::is_arithmetic<T>::value>::type * =
nullptr>
300 template <typename T, typename std::enable_if<std::is_arithmetic<T>::value>::type * =
nullptr>
307 template <typename T, typename std::enable_if<std::is_arithmetic<T>::value>::type * =
nullptr>
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
Vec3D & operator-=(Vec3D &&right)
Definition: Vec3D.h:193
An array that accepts coordinates as subscripts.
Definition: CooArray.h:22
friend std::ostream & operator<<(std::ostream &os, const Vec3D &vec)
Write coordinates to stream.
Definition: Vec3D.h:323
float operator*(const Vec3D left, const Vec3D right)
Compute the dot-product between two vectors.
Definition: Vec3D.h:316
Vec3D & operator*=(T &&right)
Definition: Vec3D.h:217
Vec3D & operator*=(T const &right)
Multiply a vector by a number.
Definition: Vec3D.h:208
Vec3D & operator+=(Vec3D &&right)
Definition: Vec3D.h:161
Vec3D & operator+=(Vec3D const &right)
Add a vector to this one.
Definition: Vec3D.h:154
Vec3D & operator/=(T &&right)
Definition: Vec3D.h:241
float PolarAngle() const
Compute the polar angle.
Definition: Vec3D.h:141
A class describing a vector in 3D space.
Definition: Vec3D.h:33
Vec3D(float x, float y, float z)
Constructor.
Definition: Vec3D.h:51
Vec3D()
Default constructor.
Definition: Vec3D.h:42
Vec3D CrossProduct(const Vec3D &rhs)
Compute the cross product of two vectors.
Definition: Vec3D.h:128
Vec3D(RefFrame::Direction direction)
Constructs a 3D vector from a given direction.
Definition: Vec3D.h:64
float AzimuthAngle() const
Compute the azimuth angle.
Definition: Vec3D.h:148
Vec3D operator/(Vec3D left, T const &right)
Divide a vector by a number.
Definition: Vec3D.h:301
Vec3D operator-(Vec3D const &right) const
Subtract two vectors.
Definition: Vec3D.h:173
float Mag() const
Compute the vector magnitude.
Definition: Vec3D.h:118
Vec3D(std::array< float, 3 > arr)
Constructor.
Definition: Vec3D.h:58
Vec3D & operator-=(Vec3D const &right)
Subtract a vector from this one.
Definition: Vec3D.h:186
void Dump() const
Dumps the vector components.
Definition: Vec3D.h:111
Vec3D & operator/=(T const &right)
Divide a vector by a number.
Definition: Vec3D.h:232
bool operator==(const Vec3D &right) const
Comparison operator.
Definition: Vec3D.h:254
Vec3D operator+(Vec3D left, Vec3D const &right)
Add two vectors.
Definition: Vec3D.h:267
Direction
Aliases for the six axis directions. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:52